Bug 1428453 - Baldr: remove WasmFrameIter::callsite_ (r=bbouvier)
authorLuke Wagner <luke@mozilla.com>
Mon, 08 Jan 2018 17:53:53 -0600
changeset 452606 e7e9f7e84f6ba1a4c35295415b8f2bfe30982a8f
parent 452605 cf36ca9dd01399d2f6af52052897263bca1c4c6e
child 452607 11a02afca6fe50ecb1a9fd22f42ae42992305af2
push id1648
push usermtabara@mozilla.com
push dateThu, 01 Mar 2018 12:45:47 +0000
treeherdermozilla-release@cbb9688c2eeb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbbouvier
bugs1428453
milestone59.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 1428453 - Baldr: remove WasmFrameIter::callsite_ (r=bbouvier) MozReview-Commit-ID: LBTtxbqZamP
js/src/wasm/WasmFrameIter.cpp
js/src/wasm/WasmFrameIter.h
--- a/js/src/wasm/WasmFrameIter.cpp
+++ b/js/src/wasm/WasmFrameIter.cpp
@@ -30,18 +30,18 @@ using mozilla::DebugOnly;
 using mozilla::Swap;
 
 /*****************************************************************************/
 // WasmFrameIter implementation
 
 WasmFrameIter::WasmFrameIter(JitActivation* activation, wasm::Frame* fp)
   : activation_(activation),
     code_(nullptr),
-    callsite_(nullptr),
     codeRange_(nullptr),
+    lineOrBytecode_(0),
     fp_(fp ? fp : activation->wasmExitFP()),
     unwind_(Unwind::False)
 {
     MOZ_ASSERT(fp_);
 
     // When asynchronously interrupted, exitFP is set to the interrupted frame
     // itself and so we do not want to skip it. Instead, we can recover the
     // Code and CodeRange from the JitActivation, which are set when control
@@ -52,16 +52,18 @@ WasmFrameIter::WasmFrameIter(JitActivati
 
     if (activation->isWasmInterrupted()) {
         code_ = &fp_->tls->instance->code();
         MOZ_ASSERT(code_ == LookupCode(activation->wasmUnwindPC()));
 
         codeRange_ = code_->lookupRange(activation->wasmUnwindPC());
         MOZ_ASSERT(codeRange_->kind() == CodeRange::Function);
 
+        lineOrBytecode_ = codeRange_->funcLineOrBytecode();
+
         MOZ_ASSERT(!done());
         return;
     }
 
     // Otherwise, execution exits wasm code via an exit stub which sets exitFP
     // to the exit stub's frame. Thus, in this case, we want to start iteration
     // at the caller of the exit frame, whose Code, CodeRange and CallSite are
     // indicated by the returnAddress of the exit stub's frame.
@@ -107,17 +109,16 @@ WasmFrameIter::popFrame()
 {
     Frame* prevFP = fp_;
     fp_ = prevFP->callerFP;
     MOZ_ASSERT(!(uintptr_t(fp_) & JitActivation::ExitFpWasmBit));
 
     if (!fp_) {
         code_ = nullptr;
         codeRange_ = nullptr;
-        callsite_ = nullptr;
 
         if (unwind_ == Unwind::True) {
             // TODO with bug 1319203, there may be other JIT frames above.
             activation_->setWasmExitFP(nullptr);
             unwoundAddressOfReturnAddress_ = &prevFP->returnAddress;
         }
 
         MOZ_ASSERT(done());
@@ -127,18 +128,20 @@ WasmFrameIter::popFrame()
     void* returnAddress = prevFP->returnAddress;
 
     code_ = &fp_->tls->instance->code();
     MOZ_ASSERT(code_ == LookupCode(returnAddress));
 
     codeRange_ = code_->lookupRange(returnAddress);
     MOZ_ASSERT(codeRange_->kind() == CodeRange::Function);
 
-    callsite_ = code_->lookupCallSite(returnAddress);
-    MOZ_ASSERT(callsite_);
+    const CallSite* callsite = code_->lookupCallSite(returnAddress);
+    MOZ_ASSERT(callsite);
+
+    lineOrBytecode_ = callsite->lineOrBytecode();
 
     MOZ_ASSERT(!done());
 }
 
 const char*
 WasmFrameIter::filename() const
 {
     MOZ_ASSERT(!done());
@@ -173,18 +176,17 @@ WasmFrameIter::functionDisplayAtom() con
 
     return atom;
 }
 
 unsigned
 WasmFrameIter::lineOrBytecode() const
 {
     MOZ_ASSERT(!done());
-    MOZ_ASSERT_IF(!callsite_, activation_->isWasmInterrupted());
-    return callsite_ ? callsite_->lineOrBytecode() : codeRange_->funcLineOrBytecode();
+    return lineOrBytecode_;
 }
 
 Instance*
 WasmFrameIter::instance() const
 {
     MOZ_ASSERT(!done());
     return fp_->tls->instance;
 }
--- a/js/src/wasm/WasmFrameIter.h
+++ b/js/src/wasm/WasmFrameIter.h
@@ -61,18 +61,18 @@ struct CallableOffsets;
 class WasmFrameIter
 {
   public:
     enum class Unwind { True, False };
 
   private:
     jit::JitActivation* activation_;
     const Code* code_;
-    const CallSite* callsite_;
     const CodeRange* codeRange_;
+    unsigned lineOrBytecode_;
     Frame* fp_;
     Unwind unwind_;
     void** unwoundAddressOfReturnAddress_;
 
     void popFrame();
 
   public:
     // See comment above this class definition.