Bug 1319203: Rename Entry -> InterpEntry in wasm code; r=luke

MozReview-Commit-ID: 5tRRsS0McFp

--HG--
extra : rebase_source : adb48af573431826c1703287dcc011e3d4014fb4
extra : histedit_source : 853d349a4c23c6bf3e0c1656c53bb20fa80cc33c
This commit is contained in:
Benjamin Bouvier 2017-10-20 17:20:57 +02:00
Родитель 89fce65edf
Коммит 419eb8dbc8
7 изменённых файлов: 23 добавлений и 26 удалений

Просмотреть файл

@ -167,7 +167,7 @@ class FuncExport
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:
@ -177,11 +177,11 @@ class FuncExport
{
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);
@ -198,9 +198,9 @@ class FuncExport
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)

Просмотреть файл

@ -592,7 +592,7 @@ AssertMatchesCallSite(const JitActivation& activation, void* callerPC, Frame* ca
const CodeRange* callerCodeRange = code->lookupRange(callerPC);
MOZ_ASSERT(callerCodeRange);
if (callerCodeRange->kind() == CodeRange::Entry) {
if (callerCodeRange->kind() == CodeRange::InterpEntry) {
MOZ_ASSERT(callerFP == nullptr);
return;
}
@ -624,7 +624,7 @@ ProfilingFrameIterator::initFromExitFP(const Frame* fp)
// 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;
@ -816,7 +816,7 @@ js::wasm::StartUnwinding(const JitActivation& activation, const RegisterState& r
*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.
@ -899,7 +899,7 @@ ProfilingFrameIterator::operator++()
if (!callerFP_) {
codeRange_ = code_->lookupRange(callerPC_);
MOZ_ASSERT(codeRange_->kind() == CodeRange::Entry);
MOZ_ASSERT(codeRange_->kind() == CodeRange::InterpEntry);
callerPC_ = nullptr;
MOZ_ASSERT(!done());
return;
@ -926,7 +926,7 @@ ProfilingFrameIterator::operator++()
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:
@ -1052,9 +1052,6 @@ ProfilingFrameIterator::label() const
// 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)";
@ -1081,7 +1078,7 @@ ProfilingFrameIterator::label() const
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;

Просмотреть файл

@ -494,8 +494,8 @@ ModuleGenerator::noteCodeRange(uint32_t codeRangeIndex, const CodeRange& codeRan
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());

Просмотреть файл

@ -694,7 +694,7 @@ Instance::callExport(JSContext* cx, uint32_t funcIndex, CallArgs args)
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;
}

Просмотреть файл

@ -256,7 +256,7 @@ static const unsigned FramePushedBeforeAlign = NonVolatileRegsPushSize + sizeof(
// 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);
@ -1370,9 +1370,9 @@ wasm::GenerateStubs(const ModuleEnvironment& env, const FuncImportVector& import
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;
}

Просмотреть файл

@ -707,7 +707,7 @@ CodeRange::CodeRange(Kind kind, uint32_t funcIndex, Offsets offsets)
u.func.lineOrBytecode_ = 0;
u.func.beginToNormalEntry_ = 0;
u.func.beginToTierEntry_ = 0;
MOZ_ASSERT(kind == Entry);
MOZ_ASSERT(kind == InterpEntry);
MOZ_ASSERT(begin_ <= end_);
}

Просмотреть файл

@ -993,7 +993,7 @@ 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
@ -1097,7 +1097,7 @@ class CodeRange
// index.
bool hasFuncIndex() const {
return isFunction() || isImportExit() || kind() == Entry;
return isFunction() || isImportExit() || kind() == InterpEntry;
}
uint32_t funcIndex() const {
MOZ_ASSERT(hasFuncIndex());