summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2020-11-09 21:18:57 -0500
committerMatt A. Tobin <email@mattatobin.com>2020-11-09 21:19:45 -0500
commit0ba1d49ae5564a9e0b141b656a8cdc68e7582baf (patch)
tree3aa221579f7f39d791efed8bb988b198e24f5dd8
parente8a6ee355f8bc318946c55ca34558464afe38bd0 (diff)
downloaduxp-0ba1d49ae5564a9e0b141b656a8cdc68e7582baf.tar.gz
Issue #1679 - Part 1: First pass account for some of the refactoring differences in regexp-shim.h
This is the patch Moonchild committed on the aborted branch before the plan was revised.
-rw-r--r--js/src/regexp/regexp-shim.h23
1 files changed, 15 insertions, 8 deletions
diff --git a/js/src/regexp/regexp-shim.h b/js/src/regexp/regexp-shim.h
index 942fcf733f..6b6a8c6394 100644
--- a/js/src/regexp/regexp-shim.h
+++ b/js/src/regexp/regexp-shim.h
@@ -662,7 +662,7 @@ class MOZ_NONHEAP_CLASS Handle {
// this object's lifetime only ends at the end of the full statement.
// Origin:
// https://github.com/v8/v8/blob/03aaa4b3bf4cb01eee1f223b252e6869b04ab08c/src/handles/handles.h#L91-L105
- class MOZ_TEMPORARY_CLASS ObjectRef {
+ class ObjectRef {
public:
T* operator->() { return &object_; }
@@ -742,10 +742,10 @@ inline Handle<T> handle(T object, Isolate* isolate) {
class DisallowHeapAllocation {
public:
DisallowHeapAllocation() {}
- operator const JS::AutoAssertNoGC&() const { return no_gc_; }
+ operator const JS::AutoCheckCannotGC&() const { return no_gc_; }
private:
- const JS::AutoAssertNoGC no_gc_;
+ const JS::AutoCheckCannotGC no_gc_;
};
// This is used inside DisallowHeapAllocation regions to enable
@@ -802,7 +802,7 @@ class String : public HeapObject {
}
private:
const JSLinearString* string_;
- const JS::AutoAssertNoGC& no_gc_;
+ const JS::AutoCheckCannotGC& no_gc_;
};
FlatContent GetFlatContent(const DisallowHeapAllocation& no_gc) {
MOZ_ASSERT(IsFlat());
@@ -1037,7 +1037,7 @@ public:
//********** Stack guard code **********//
inline StackGuard* stack_guard() { return this; }
Object HandleInterrupts() {
- return Object(JS::BooleanValue(cx()->handleInterrupt()));
+ return Object(JS::BooleanValue(cx()->handleInterrupt(cx())));
}
JSContext* cx() const { return cx_; }
@@ -1085,14 +1085,21 @@ class StackLimitCheck {
StackLimitCheck(Isolate* isolate) : cx_(isolate->cx()) {}
// Use this to check for stack-overflows in C++ code.
- bool HasOverflowed() { return !CheckRecursionLimitDontReport(cx_); }
+ bool HasOverflowed() {
+ JS_CHECK_RECURSION_DONT_REPORT(cx_, return true);
+ return false;
+ }
// Use this to check for interrupt request in C++ code.
- bool InterruptRequested() { return cx_->hasAnyPendingInterrupt(); }
+ bool InterruptRequested() {
+ JSRuntime* rt = cx_->runtime();
+ return rt->hasPendingInterrupt();
+ }
// Use this to check for stack-overflow when entering runtime from JS code.
bool JsHasOverflowed() {
- return !CheckRecursionLimitConservativeDontReport(cx_);
+ JS_CHECK_RECURSION_CONSERVATIVE_DONT_REPORT(cx_, return true);
+ return false;
}
private: