Bug 1466118 part 8 - Change compartment check to realm check for JSScript and AbstractFramePtr. r=luke
authorJan de Mooij <jdemooij@mozilla.com>
Tue, 21 Aug 2018 13:14:23 +0200
changeset 488144 64a85b3753acab5c776f732553139878fdcda1cb
parent 488143 1a263d3e088e0cc47b111185579d0d8699b8d190
child 488145 87a88fb8b1a60c125feb18d8cf089f857cb39f71
push id9719
push userffxbld-merge
push dateFri, 24 Aug 2018 17:49:46 +0000
treeherdermozilla-beta@719ec98fba77 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersluke
bugs1466118
milestone63.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1466118 part 8 - Change compartment check to realm check for JSScript and AbstractFramePtr. r=luke
js/src/vm/JSContext-inl.h
js/src/vm/JSContext.cpp
--- a/js/src/vm/JSContext-inl.h
+++ b/js/src/vm/JSContext-inl.h
@@ -150,20 +150,19 @@ class ContextChecks
             checkAtom(JSID_TO_SYMBOL(id), argIndex);
         else
             MOZ_ASSERT(!JSID_IS_GCTHING(id));
     }
 
     void check(JSScript* script, int argIndex) {
         MOZ_ASSERT(JS::CellIsNotGray(script));
         if (script)
-            check(script->compartment(), argIndex);
+            check(script->realm(), argIndex);
     }
 
-    void check(InterpreterFrame* fp, int argIndex);
     void check(AbstractFramePtr frame, int argIndex);
 
     void check(Handle<PropertyDescriptor> desc, int argIndex) {
         check(desc.object(), argIndex);
         if (desc.hasGetterObject())
             check(desc.getterObject(), argIndex);
         if (desc.hasSetterObject())
             check(desc.setterObject(), argIndex);
--- a/js/src/vm/JSContext.cpp
+++ b/js/src/vm/JSContext.cpp
@@ -1557,27 +1557,20 @@ JS::AutoCheckRequestDepth::~AutoCheckReq
         cx->checkRequestDepth--;
     }
 }
 
 #endif
 
 #ifdef JS_CRASH_DIAGNOSTICS
 void
-ContextChecks::check(InterpreterFrame* fp, int argIndex)
-{
-    if (fp)
-        check(fp->environmentChain(), argIndex);
-}
-
-void
 ContextChecks::check(AbstractFramePtr frame, int argIndex)
 {
     if (frame)
-        check(frame.environmentChain(), argIndex);
+        check(frame.realm(), argIndex);
 }
 #endif
 
 void
 AutoEnterOOMUnsafeRegion::crash(const char* reason)
 {
     char msgbuf[1024];
     js::NoteIntentionalCrash();