Bug 1319203: Rename Entry -> InterpEntry in wasm code; r=luke
authorBenjamin Bouvier <benj@benj.me>
Fri, 20 Oct 2017 17:20:57 +0200
changeset 444212 0422da76e0f6506e8d50d39c445a4eb25e4b7807
parent 444211 82622938a7c9cc0444f52a5cb8a8ee8ae51fd1fc
child 444213 37a03f25e750e71f1006aa56fd67b049a0e72057
push id1618
push userCallek@gmail.com
push dateThu, 11 Jan 2018 17:45:48 +0000
treeherdermozilla-release@882ca853e05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersluke
bugs1319203
milestone58.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 1319203: Rename Entry -> InterpEntry in wasm code; r=luke MozReview-Commit-ID: 5tRRsS0McFp
js/src/wasm/WasmCode.h
js/src/wasm/WasmFrameIter.cpp
js/src/wasm/WasmGenerator.cpp
js/src/wasm/WasmInstance.cpp
js/src/wasm/WasmStubs.cpp
js/src/wasm/WasmTypes.cpp
js/src/wasm/WasmTypes.h
--- a/js/src/wasm/WasmCode.h
+++ b/js/src/wasm/WasmCode.h
@@ -162,50 +162,50 @@ class CodeSegment
 // function definition index.
 
 class FuncExport
 {
     Sig sig_;
     MOZ_INIT_OUTSIDE_CTOR struct CacheablePod {
         uint32_t funcIndex_;
         uint32_t codeRangeIndex_;
-        uint32_t entryOffset_;      // Machine code offset
+        uint32_t interpEntryOffset_; // Machine code offset
     } pod;
 
   public:
     FuncExport() = default;
     explicit FuncExport(Sig&& sig, uint32_t funcIndex)
       : sig_(Move(sig))
     {
         pod.funcIndex_ = funcIndex;
         pod.codeRangeIndex_ = UINT32_MAX;
-        pod.entryOffset_ = UINT32_MAX;
+        pod.interpEntryOffset_ = UINT32_MAX;
     }
-    void initEntryOffset(uint32_t entryOffset) {
-        MOZ_ASSERT(pod.entryOffset_ == UINT32_MAX);
-        pod.entryOffset_ = entryOffset;
+    void initInterpEntryOffset(uint32_t entryOffset) {
+        MOZ_ASSERT(pod.interpEntryOffset_ == UINT32_MAX);
+        pod.interpEntryOffset_ = entryOffset;
     }
     void initCodeRangeIndex(uint32_t codeRangeIndex) {
         MOZ_ASSERT(pod.codeRangeIndex_ == UINT32_MAX);
         pod.codeRangeIndex_ = codeRangeIndex;
     }
 
     const Sig& sig() const {
         return sig_;
     }
     uint32_t funcIndex() const {
         return pod.funcIndex_;
     }
     uint32_t codeRangeIndex() const {
         MOZ_ASSERT(pod.codeRangeIndex_ != UINT32_MAX);
         return pod.codeRangeIndex_;
     }
-    uint32_t entryOffset() const {
-        MOZ_ASSERT(pod.entryOffset_ != UINT32_MAX);
-        return pod.entryOffset_;
+    uint32_t interpEntryOffset() const {
+        MOZ_ASSERT(pod.interpEntryOffset_ != UINT32_MAX);
+        return pod.interpEntryOffset_;
     }
 
     WASM_DECLARE_SERIALIZABLE(FuncExport)
 };
 
 typedef Vector<FuncExport, 0, SystemAllocPolicy> FuncExportVector;
 
 // An FuncImport contains the runtime metadata needed to implement a call to an
--- a/js/src/wasm/WasmFrameIter.cpp
+++ b/js/src/wasm/WasmFrameIter.cpp
@@ -587,17 +587,17 @@ AssertMatchesCallSite(const JitActivatio
 {
 #ifdef DEBUG
     const Code* code = LookupCode(callerPC);
     MOZ_ASSERT(code);
 
     const CodeRange* callerCodeRange = code->lookupRange(callerPC);
     MOZ_ASSERT(callerCodeRange);
 
-    if (callerCodeRange->kind() == CodeRange::Entry) {
+    if (callerCodeRange->kind() == CodeRange::InterpEntry) {
         MOZ_ASSERT(callerFP == nullptr);
         return;
     }
 
     const CallSite* callsite = code->lookupCallSite(callerPC);
     MOZ_ASSERT(callsite);
 #endif
 }
@@ -619,17 +619,17 @@ ProfilingFrameIterator::initFromExitFP(c
     // Since we don't have the pc for fp, start unwinding at the caller of fp.
     // This means that the innermost frame is skipped. This is fine because:
     //  - for import exit calls, the innermost frame is a thunk, so the first
     //    frame that shows up is the function calling the import;
     //  - for Math and other builtin calls as well as interrupts, we note the absence
     //    of an exit reason and inject a fake "builtin" frame; and
     //  - for async interrupts, we just accept that we'll lose the innermost frame.
     switch (codeRange_->kind()) {
-      case CodeRange::Entry:
+      case CodeRange::InterpEntry:
         callerPC_ = nullptr;
         callerFP_ = nullptr;
         break;
       case CodeRange::Function:
         fp = fp->callerFP;
         callerPC_ = fp->returnAddress;
         callerFP_ = fp->callerFP;
         AssertMatchesCallSite(*activation_, callerPC_, callerFP_);
@@ -811,17 +811,17 @@ js::wasm::StartUnwinding(const JitActiva
       case CodeRange::UnalignedExit:
         // These code stubs execute after the prologue/epilogue have completed
         // so pc/fp contains the right values here.
         fixedPC = pc;
         fixedFP = fp;
         *unwoundCaller = false;
         AssertMatchesCallSite(activation, fp->returnAddress, fp->callerFP);
         break;
-      case CodeRange::Entry:
+      case CodeRange::InterpEntry:
         // The entry trampoline is the final frame in an wasm JitActivation. The
         // entry trampoline also doesn't GeneratePrologue/Epilogue so we can't
         // use the general unwinding logic above.
         break;
       case CodeRange::Throw:
         // The throw stub executes a small number of instructions before popping
         // the entire activation. To simplify testing, we simply pretend throw
         // stubs have already popped the entire stack.
@@ -894,17 +894,17 @@ ProfilingFrameIterator::operator++()
         MOZ_ASSERT(!callerFP_);
         codeRange_ = nullptr;
         MOZ_ASSERT(done());
         return;
     }
 
     if (!callerFP_) {
         codeRange_ = code_->lookupRange(callerPC_);
-        MOZ_ASSERT(codeRange_->kind() == CodeRange::Entry);
+        MOZ_ASSERT(codeRange_->kind() == CodeRange::InterpEntry);
         callerPC_ = nullptr;
         MOZ_ASSERT(!done());
         return;
     }
 
     code_ = &callerFP_->tls->instance->code();
     MOZ_ASSERT(code_ == LookupCode(callerPC_));
 
@@ -921,17 +921,17 @@ ProfilingFrameIterator::operator++()
       case CodeRange::OutOfBoundsExit:
       case CodeRange::UnalignedExit:
       case CodeRange::FarJumpIsland:
         stackAddress_ = callerFP_;
         callerPC_ = callerFP_->returnAddress;
         AssertMatchesCallSite(*activation_, callerPC_, callerFP_->callerFP);
         callerFP_ = callerFP_->callerFP;
         break;
-      case CodeRange::Entry:
+      case CodeRange::InterpEntry:
         MOZ_CRASH("should have had null caller fp");
       case CodeRange::Interrupt:
       case CodeRange::Throw:
         MOZ_CRASH("code range doesn't have frame");
     }
 
     MOZ_ASSERT(!done());
 }
@@ -1047,19 +1047,16 @@ ThunkedNativeToDescription(SymbolicAddre
 
 const char*
 ProfilingFrameIterator::label() const
 {
     MOZ_ASSERT(!done());
 
     // Use the same string for both time inside and under so that the two
     // entries will be coalesced by the profiler.
-    //
-    // NB: these labels are parsed for location by
-    //     devtools/client/performance/modules/logic/frame-utils.js
     static const char* importJitDescription = "fast FFI trampoline (in wasm)";
     static const char* importInterpDescription = "slow FFI trampoline (in wasm)";
     static const char* builtinNativeDescription = "fast FFI trampoline to native (in wasm)";
     static const char* trapDescription = "trap handling (in wasm)";
     static const char* debugTrapDescription = "debug trap handling (in wasm)";
 
     if (!exitReason_.isFixed())
         return ThunkedNativeToDescription(exitReason_.symbolic());
@@ -1076,17 +1073,17 @@ ProfilingFrameIterator::label() const
       case ExitReason::Fixed::Trap:
         return trapDescription;
       case ExitReason::Fixed::DebugTrap:
         return debugTrapDescription;
     }
 
     switch (codeRange_->kind()) {
       case CodeRange::Function:          return code_->profilingLabel(codeRange_->funcIndex());
-      case CodeRange::Entry:             return "entry trampoline (in wasm)";
+      case CodeRange::InterpEntry:       return "slow entry trampoline (in wasm)";
       case CodeRange::ImportJitExit:     return importJitDescription;
       case CodeRange::BuiltinThunk:      return builtinNativeDescription;
       case CodeRange::ImportInterpExit:  return importInterpDescription;
       case CodeRange::TrapExit:          return trapDescription;
       case CodeRange::DebugTrap:         return debugTrapDescription;
       case CodeRange::OutOfBoundsExit:   return "out-of-bounds stub (in wasm)";
       case CodeRange::UnalignedExit:     return "unaligned trap stub (in wasm)";
       case CodeRange::FarJumpIsland:     return "interstitial (in wasm)";
--- a/js/src/wasm/WasmGenerator.cpp
+++ b/js/src/wasm/WasmGenerator.cpp
@@ -489,18 +489,18 @@ ModuleGenerator::linkCallSites()
 void
 ModuleGenerator::noteCodeRange(uint32_t codeRangeIndex, const CodeRange& codeRange)
 {
     switch (codeRange.kind()) {
       case CodeRange::Function:
         MOZ_ASSERT(funcToCodeRange_[codeRange.funcIndex()] == BAD_CODE_RANGE);
         funcToCodeRange_[codeRange.funcIndex()] = codeRangeIndex;
         break;
-      case CodeRange::Entry:
-        metadataTier_->lookupFuncExport(codeRange.funcIndex()).initEntryOffset(codeRange.begin());
+      case CodeRange::InterpEntry:
+        metadataTier_->lookupFuncExport(codeRange.funcIndex()).initInterpEntryOffset(codeRange.begin());
         break;
       case CodeRange::ImportJitExit:
         metadataTier_->funcImports[codeRange.funcIndex()].initJitExitOffset(codeRange.begin());
         break;
       case CodeRange::ImportInterpExit:
         metadataTier_->funcImports[codeRange.funcIndex()].initInterpExitOffset(codeRange.begin());
         break;
       case CodeRange::TrapExit:
--- a/js/src/wasm/WasmInstance.cpp
+++ b/js/src/wasm/WasmInstance.cpp
@@ -689,17 +689,17 @@ Instance::callExport(JSContext* cx, uint
           }
         }
     }
 
     {
         JitActivation activation(cx);
 
         // Call the per-exported-function trampoline created by GenerateEntry.
-        auto funcPtr = JS_DATA_TO_FUNC_PTR(ExportFuncPtr, codeBase(tier) + func.entryOffset());
+        auto funcPtr = JS_DATA_TO_FUNC_PTR(ExportFuncPtr, codeBase(tier) + func.interpEntryOffset());
         if (!CALL_GENERATED_2(funcPtr, exportArgs.begin(), tlsData()))
             return false;
     }
 
     if (isAsmJS() && args.isConstructing()) {
         // By spec, when a JS function is called as a constructor and this
         // function returns a primary type, which is the case for all asm.js
         // exported functions, the returned value is discarded and an empty
--- a/js/src/wasm/WasmStubs.cpp
+++ b/js/src/wasm/WasmStubs.cpp
@@ -251,17 +251,17 @@ static const unsigned NonVolatileRegsPus
 #endif
 static const unsigned FramePushedBeforeAlign = NonVolatileRegsPushSize + sizeof(void*);
 
 // Generate a stub that enters wasm from a C++ caller via the native ABI. The
 // signature of the entry point is Module::ExportFuncPtr. The exported wasm
 // function has an ABI derived from its specific signature, so this function
 // must map from the ABI of ExportFuncPtr to the export's signature's ABI.
 static bool
-GenerateEntry(MacroAssembler& masm, const FuncExport& fe, Offsets* offsets)
+GenerateInterpEntry(MacroAssembler& masm, const FuncExport& fe, Offsets* offsets)
 {
     masm.haltingAlign(CodeAlignment);
 
     offsets->begin = masm.currentOffset();
 
     // Save the return address if it wasn't already saved by the call insn.
 #if defined(JS_CODEGEN_ARM)
     masm.push(lr);
@@ -1365,19 +1365,19 @@ wasm::GenerateStubs(const ModuleEnvironm
         if (!GenerateImportJitExit(masm, fi, &throwLabel, &jitOffsets))
             return false;
         if (!code->codeRanges.emplaceBack(funcIndex, jitOffsets))
             return false;
     }
 
     for (const FuncExport& fe : exports) {
         Offsets offsets;
-        if (!GenerateEntry(masm, fe, &offsets))
+        if (!GenerateInterpEntry(masm, fe, &offsets))
             return false;
-        if (!code->codeRanges.emplaceBack(CodeRange::Entry, fe.funcIndex(), offsets))
+        if (!code->codeRanges.emplaceBack(CodeRange::InterpEntry, fe.funcIndex(), offsets))
             return false;
     }
 
     for (Trap trap : MakeEnumeratedRange(Trap::Limit)) {
         CallableOffsets offsets;
         if (!GenerateTrapExit(masm, trap, &throwLabel, &offsets))
             return false;
         if (!code->codeRanges.emplaceBack(trap, offsets))
--- a/js/src/wasm/WasmTypes.cpp
+++ b/js/src/wasm/WasmTypes.cpp
@@ -702,17 +702,17 @@ CodeRange::CodeRange(Kind kind, uint32_t
     ret_(0),
     end_(offsets.end),
     kind_(kind)
 {
     u.funcIndex_ = funcIndex;
     u.func.lineOrBytecode_ = 0;
     u.func.beginToNormalEntry_ = 0;
     u.func.beginToTierEntry_ = 0;
-    MOZ_ASSERT(kind == Entry);
+    MOZ_ASSERT(kind == InterpEntry);
     MOZ_ASSERT(begin_ <= end_);
 }
 
 CodeRange::CodeRange(Kind kind, CallableOffsets offsets)
   : begin_(offsets.begin),
     ret_(offsets.ret),
     end_(offsets.end),
     kind_(kind)
--- a/js/src/wasm/WasmTypes.h
+++ b/js/src/wasm/WasmTypes.h
@@ -988,17 +988,17 @@ typedef Vector<FuncOffsets, 0, SystemAll
 // module's code segment. A CodeRange describes what the code does and, for
 // function bodies, the name and source coordinates of the function.
 
 class CodeRange
 {
   public:
     enum Kind {
         Function,          // function definition
-        Entry,             // calls into wasm from C++
+        InterpEntry,       // calls into wasm from C++
         ImportJitExit,     // fast-path calling from wasm into JIT code
         ImportInterpExit,  // slow-path calling from wasm into C++ interp
         BuiltinThunk,      // fast-path calling from wasm into a C++ native
         TrapExit,          // calls C++ to report and jumps to throw stub
         DebugTrap,         // calls C++ to handle debug event
         FarJumpIsland,     // inserted to connect otherwise out-of-range insns
         OutOfBoundsExit,   // stub jumped to by non-standard asm.js SIMD/Atomics
         UnalignedExit,     // stub jumped to by non-standard ARM unaligned trap
@@ -1092,17 +1092,17 @@ class CodeRange
         MOZ_ASSERT(hasReturn());
         return ret_;
     }
 
     // Functions, export stubs and import stubs all have an associated function
     // index.
 
     bool hasFuncIndex() const {
-        return isFunction() || isImportExit() || kind() == Entry;
+        return isFunction() || isImportExit() || kind() == InterpEntry;
     }
     uint32_t funcIndex() const {
         MOZ_ASSERT(hasFuncIndex());
         return u.funcIndex_;
     }
 
     // TrapExit CodeRanges have a Trap field.