--- a/js/src/jit/AsmJS.cpp
+++ b/js/src/jit/AsmJS.cpp
@@ -810,52 +810,52 @@ typedef Vector<MBasicBlock*,8> BlockVect
//
// ModuleCompiler is marked as rooted in the rooting analysis. Don't add
// non-JSAtom pointers, or this will break!
class MOZ_STACK_CLASS ModuleCompiler
{
public:
class Func
{
+ Signature sig_;
PropertyName *name_;
+ Label *code_;
+ uint32_t srcBegin_;
+ uint32_t srcEnd_;
+ uint32_t compileTime_;
bool defined_;
- uint32_t srcOffset_;
- uint32_t endOffset_;
- Signature sig_;
- Label *code_;
- unsigned compileTime_;
public:
Func(PropertyName *name, Signature &&sig, Label *code)
- : name_(name), defined_(false), srcOffset_(0), endOffset_(0), sig_(Move(sig)),
- code_(code), compileTime_(0)
+ : sig_(Move(sig)), name_(name), code_(code), srcBegin_(0), srcEnd_(0),
+ compileTime_(0), defined_(false)
{}
PropertyName *name() const { return name_; }
bool defined() const { return defined_; }
void define(ModuleCompiler &m, ParseNode *fn) {
JS_ASSERT(!defined_);
defined_ = true;
// The begin/end char range is relative to the beginning of the module.
// hence the assertions.
- JS_ASSERT(fn->pn_pos.begin > m.moduleStart());
+ JS_ASSERT(fn->pn_pos.begin > m.srcStart());
JS_ASSERT(fn->pn_pos.begin <= fn->pn_pos.end);
- srcOffset_ = fn->pn_pos.begin - m.moduleStart();
- endOffset_ = fn->pn_pos.end - m.moduleStart();
+ srcBegin_ = fn->pn_pos.begin - m.srcStart();
+ srcEnd_ = fn->pn_pos.end - m.srcStart();
}
- uint32_t srcOffset() const { JS_ASSERT(defined_); return srcOffset_; }
- uint32_t endOffset() const { JS_ASSERT(defined_); return endOffset_; }
+ uint32_t srcBegin() const { JS_ASSERT(defined_); return srcBegin_; }
+ uint32_t srcEnd() const { JS_ASSERT(defined_); return srcEnd_; }
Signature &sig() { return sig_; }
const Signature &sig() const { return sig_; }
Label *code() const { return code_; }
- unsigned compileTime() const { return compileTime_; }
- void accumulateCompileTime(unsigned ms) { compileTime_ += ms; }
+ uint32_t compileTime() const { return compileTime_; }
+ void accumulateCompileTime(uint32_t ms) { compileTime_ += ms; }
};
class Global
{
public:
enum Which {
Variable,
ConstantLiteral,
@@ -1132,25 +1132,25 @@ class MOZ_STACK_CLASS ModuleCompiler
!addStandardLibraryMathName("LOG10E", M_LOG10E) ||
!addStandardLibraryMathName("PI", M_PI) ||
!addStandardLibraryMathName("SQRT1_2", M_SQRT1_2) ||
!addStandardLibraryMathName("SQRT2", M_SQRT2))
{
return false;
}
- uint32_t funcStart = parser_.pc->maybeFunction->pn_body->pn_pos.begin;
- uint32_t offsetToEndOfUseAsm = tokenStream().currentToken().pos.end;
+ uint32_t srcStart = parser_.pc->maybeFunction->pn_body->pn_pos.begin;
+ uint32_t srcBodyStart = tokenStream().currentToken().pos.end;
// "use strict" should be added to the source if we are in an implicit
// strict context, see also comment above addUseStrict in
// js::FunctionToString.
bool strict = parser_.pc->sc->strict && !parser_.pc->sc->hasExplicitUseStrict();
- module_ = cx_->new_<AsmJSModule>(parser_.ss, funcStart, offsetToEndOfUseAsm, strict);
+ module_ = cx_->new_<AsmJSModule>(parser_.ss, srcStart, srcBodyStart, strict);
if (!module_)
return false;
return true;
}
bool failOffset(uint32_t offset, const char *str) {
JS_ASSERT(!errorString_);
@@ -1207,31 +1207,31 @@ class MOZ_STACK_CLASS ModuleCompiler
static const unsigned SLOW_FUNCTION_THRESHOLD_MS = 250;
bool maybeReportCompileTime(const Func &func) {
if (func.compileTime() < SLOW_FUNCTION_THRESHOLD_MS)
return true;
SlowFunction sf;
sf.name = func.name();
sf.ms = func.compileTime();
- tokenStream().srcCoords.lineNumAndColumnIndex(func.srcOffset(), &sf.line, &sf.column);
+ tokenStream().srcCoords.lineNumAndColumnIndex(func.srcBegin(), &sf.line, &sf.column);
return slowFunctions_.append(sf);
}
/*************************************************** Read-only interface */
ExclusiveContext *cx() const { return cx_; }
AsmJSParser &parser() const { return parser_; }
TokenStream &tokenStream() const { return parser_.tokenStream; }
MacroAssembler &masm() { return masm_; }
Label &stackOverflowLabel() { return stackOverflowLabel_; }
Label &interruptLabel() { return interruptLabel_; }
bool hasError() const { return errorString_ != nullptr; }
const AsmJSModule &module() const { return *module_.get(); }
- uint32_t moduleStart() const { return module_->funcStart(); }
+ uint32_t srcStart() const { return module_->srcStart(); }
ParseNode *moduleFunctionNode() const { return moduleFunctionNode_; }
PropertyName *moduleFunctionName() const { return moduleFunctionName_; }
const Global *lookupGlobal(PropertyName *name) const {
if (GlobalMap::Ptr p = globals_.lookup(name))
return p->value();
return nullptr;
@@ -1389,17 +1389,17 @@ class MOZ_STACK_CLASS ModuleCompiler
bool addExportedFunction(const Func *func, PropertyName *maybeFieldName) {
AsmJSModule::ArgCoercionVector argCoercions;
const VarTypeVector &args = func->sig().args();
if (!argCoercions.resize(args.length()))
return false;
for (unsigned i = 0; i < args.length(); i++)
argCoercions[i] = args[i].toCoercion();
AsmJSModule::ReturnType retType = func->sig().retType().toModuleReturnType();
- return module_->addExportedFunction(func->name(), func->srcOffset(), func->endOffset(),
+ return module_->addExportedFunction(func->name(), func->srcBegin(), func->srcEnd(),
maybeFieldName, Move(argCoercions), retType);
}
bool addExit(unsigned ffiIndex, PropertyName *name, Signature &&sig, unsigned *exitIndex) {
ExitDescriptor exitDescriptor(name, Move(sig));
ExitMap::AddPtr p = exits_.lookupForAdd(exitDescriptor);
if (p) {
*exitIndex = p->value();
return true;
@@ -1434,45 +1434,42 @@ class MOZ_STACK_CLASS ModuleCompiler
masm_.resetForNewCodeGenerator(mir.alloc());
masm_.align(CodeAlignment);
masm_.bind(func.code());
}
bool finishGeneratingFunction(Func &func, MIRGenerator &mir, CodeGenerator &codegen) {
JS_ASSERT(func.defined() && func.code()->bound());
- uint32_t beginOffset = func.code()->offset();
- uint32_t endOffset = masm_.currentOffset();
- if (!module_->addFunctionCodeRange(func.name(), beginOffset, endOffset))
+ PropertyName *name = func.name();
+ uint32_t codeBegin = func.code()->offset();
+ uint32_t codeEnd = masm_.currentOffset();
+ if (!module_->addFunctionCodeRange(name, codeBegin, codeEnd))
return false;
jit::IonScriptCounts *counts = codegen.extractScriptCounts();
if (counts && !module_->addFunctionCounts(counts)) {
js_delete(counts);
return false;
}
#if defined(MOZ_VTUNE) || defined(JS_ION_PERF)
unsigned line = 0, column = 0;
- tokenStream().srcCoords.lineNumAndColumnIndex(func.srcOffset(), &line, &column);
- unsigned startCodeOffset = func.code()->offset();
- unsigned endCodeOffset = masm_.currentOffset();
- if (!module_->addProfiledFunction(func.name(), startCodeOffset, endCodeOffset, line, column))
+ tokenStream().srcCoords.lineNumAndColumnIndex(func.srcBegin(), &line, &column);
+ if (!module_->addProfiledFunction(name, codeBegin, codeEnd, line, column))
return false;
# ifdef JS_ION_PERF
+ // Per-block profiling info uses significantly more memory so only store
+ // this information if it is actively requested.
if (PerfBlockEnabled()) {
- // Per-block profiling info uses significantly more memory so only
- // store this information if it is actively requested.
- mir.perfSpewer().noteBlocksOffsets();
- unsigned endInlineCodeOffset = mir.perfSpewer().endInlineCode.offset();
- if (!module_->addPerfProfiledBlocks(func.name(), startCodeOffset, endInlineCodeOffset,
- endCodeOffset, mir.perfSpewer().basicBlocks()))
- {
+ AsmJSPerfSpewer &ps = mir.perfSpewer();
+ ps.noteBlocksOffsets();
+ unsigned inlineEnd = ps.endInlineCode.offset();
+ if (!module_->addProfiledBlocks(name, codeBegin, inlineEnd, codeEnd, ps.basicBlocks()))
return false;
- }
}
# endif
#endif
return true;
}
void finishFunctionBodies() {
JS_ASSERT(!finishedFunctionBodies_);
@@ -5418,21 +5415,21 @@ CheckFunctionsSequential(ModuleCompiler
int64_t before = PRMJ_Now();
IonContext icx(m.cx(), &mir->alloc());
IonSpewNewFunction(&mir->graph(), NullPtr());
if (!OptimizeMIR(mir))
- return m.failOffset(func->srcOffset(), "internal compiler failure (probably out of memory)");
+ return m.failOffset(func->srcBegin(), "internal compiler failure (probably out of memory)");
LIRGraph *lir = GenerateLIR(mir);
if (!lir)
- return m.failOffset(func->srcOffset(), "internal compiler failure (probably out of memory)");
+ return m.failOffset(func->srcBegin(), "internal compiler failure (probably out of memory)");
func->accumulateCompileTime((PRMJ_Now() - before) / PRMJ_USEC_PER_MSEC);
if (!GenerateCode(m, *func, *mir, *lir))
return false;
IonSpewEndFunction();
}
@@ -5682,17 +5679,17 @@ CheckFunctionsParallel(ModuleCompiler &m
// With compilation memory in-scope, dispatch helper threads.
ParallelGroupState group(tasks);
if (!CheckFunctionsParallelImpl(m, group)) {
CancelOutstandingJobs(m, group);
// If failure was triggered by a helper thread, report error.
if (void *maybeFunc = HelperThreadState().maybeAsmJSFailedFunction()) {
ModuleCompiler::Func *func = reinterpret_cast<ModuleCompiler::Func *>(maybeFunc);
- return m.failOffset(func->srcOffset(), "allocation failure during compilation");
+ return m.failOffset(func->srcBegin(), "allocation failure during compilation");
}
// Otherwise, the error occurred on the main thread and was already reported.
return false;
}
return true;
}
#endif // JS_THREADSAFE
--- a/js/src/jit/AsmJSLink.cpp
+++ b/js/src/jit/AsmJSLink.cpp
@@ -463,18 +463,18 @@ NewExportedFunction(JSContext *cx, const
}
static bool
HandleDynamicLinkFailure(JSContext *cx, CallArgs args, AsmJSModule &module, HandlePropertyName name)
{
if (cx->isExceptionPending())
return false;
- uint32_t begin = module.offsetToEndOfUseAsm();
- uint32_t end = module.funcEndBeforeCurly();
+ uint32_t begin = module.srcBodyStart(); // starts right after 'use asm'
+ uint32_t end = module.srcEndBeforeCurly();
Rooted<JSFlatString*> src(cx, module.scriptSource()->substring(cx, begin, end));
if (!src)
return false;
RootedFunction fun(cx, NewFunction(cx, NullPtr(), nullptr, 0, JSFunction::INTERPRETED,
cx->global(), name, JSFunction::FinalizeKind,
TenuredObject));
if (!fun)
@@ -813,18 +813,18 @@ AppendUseStrictSource(JSContext *cx, Han
out.appendSubstring(src, bodyStart, src->length() - bodyStart);
}
JSString *
js::AsmJSModuleToString(JSContext *cx, HandleFunction fun, bool addParenToLambda)
{
AsmJSModule &module = ModuleFunctionToModuleObject(fun).module();
- uint32_t begin = module.funcStart();
- uint32_t end = module.funcEndAfterCurly();
+ uint32_t begin = module.srcStart();
+ uint32_t end = module.srcEndAfterCurly();
ScriptSource *source = module.scriptSource();
StringBuffer out(cx);
// Whether the function has been created with a Function ctor
bool funCtor = begin == 0 && end == source->length() && source->argumentsNotIncluded();
if (addParenToLambda && fun->isLambda() && !out.append("("))
return nullptr;
@@ -912,18 +912,18 @@ js::IsAsmJSFunction(HandleFunction fun)
return fun->isNative() && fun->maybeNative() == CallAsmJS;
}
JSString *
js::AsmJSFunctionToString(JSContext *cx, HandleFunction fun)
{
AsmJSModule &module = FunctionToEnclosingModule(fun);
const AsmJSModule::ExportedFunction &f = FunctionToExportedFunction(fun, module);
- uint32_t begin = module.funcStart() + f.startOffsetInModule();
- uint32_t end = module.funcStart() + f.endOffsetInModule();
+ uint32_t begin = module.srcStart() + f.startOffsetInModule();
+ uint32_t end = module.srcStart() + f.endOffsetInModule();
ScriptSource *source = module.scriptSource();
StringBuffer out(cx);
// asm.js functions cannot have been created with a Function constructor
// as they belong within a module.
JS_ASSERT(!(begin == 0 && end == source->length() && source->argumentsNotIncluded()));
--- a/js/src/jit/AsmJSModule.cpp
+++ b/js/src/jit/AsmJSModule.cpp
@@ -70,20 +70,20 @@ DeallocateExecutableMemory(uint8_t *code
{
#ifdef XP_WIN
JS_ALWAYS_TRUE(VirtualFree(code, 0, MEM_RELEASE));
#else
JS_ALWAYS_TRUE(munmap(code, totalBytes) == 0 || errno == ENOMEM);
#endif
}
-AsmJSModule::AsmJSModule(ScriptSource *scriptSource, uint32_t funcStart,
- uint32_t offsetToEndOfUseAsm, bool strict)
- : funcStart_(funcStart),
- offsetToEndOfUseAsm_(offsetToEndOfUseAsm),
+AsmJSModule::AsmJSModule(ScriptSource *scriptSource, uint32_t srcStart, uint32_t srcBodyStart,
+ bool strict)
+ : srcStart_(srcStart),
+ srcBodyStart_(srcBodyStart),
scriptSource_(scriptSource),
globalArgumentName_(nullptr),
importArgumentName_(nullptr),
bufferArgumentName_(nullptr),
code_(nullptr),
interruptExit_(nullptr),
dynamicallyLinked_(false),
loadedFromCache_(false),
@@ -273,20 +273,20 @@ AsmJSModule::lookupHeapAccess(void *pc)
bool
AsmJSModule::finish(ExclusiveContext *cx, TokenStream &tokenStream, MacroAssembler &masm,
const Label &interruptLabel)
{
JS_ASSERT(isFinishedWithFunctionBodies() && !isFinished());
uint32_t endBeforeCurly = tokenStream.currentToken().pos.end;
uint32_t endAfterCurly = tokenStream.peekTokenPos().end;
- JS_ASSERT(endBeforeCurly >= offsetToEndOfUseAsm_);
- JS_ASSERT(endAfterCurly >= offsetToEndOfUseAsm_);
- pod.funcLength_ = endBeforeCurly - funcStart_;
- pod.funcLengthWithRightBrace_ = endAfterCurly - funcStart_;
+ JS_ASSERT(endBeforeCurly >= srcBodyStart_);
+ JS_ASSERT(endAfterCurly >= srcBodyStart_);
+ pod.srcLength_ = endBeforeCurly - srcStart_;
+ pod.srcLengthWithRightBrace_ = endAfterCurly - srcStart_;
// The global data section sits immediately after the executable (and
// other) data allocated by the MacroAssembler, so ensure it is
// double-aligned.
pod.codeBytes_ = AlignBytes(masm.bytesNeeded(), sizeof(double));
// The entire region is allocated via mmap/VirtualAlloc which requires
// units of pages.
@@ -1209,17 +1209,17 @@ class AutoUnprotectCodeForClone
}
};
bool
AsmJSModule::clone(JSContext *cx, ScopedJSDeletePtr<AsmJSModule> *moduleOut) const
{
AutoUnprotectCodeForClone cloneGuard(cx, *this);
- *moduleOut = cx->new_<AsmJSModule>(scriptSource_, funcStart_, offsetToEndOfUseAsm_, pod.strict_);
+ *moduleOut = cx->new_<AsmJSModule>(scriptSource_, srcStart_, srcBodyStart_, pod.strict_);
if (!*moduleOut)
return false;
AsmJSModule &out = **moduleOut;
// Mirror the order of serialize/deserialize in cloning:
out.pod = pod;
@@ -1666,21 +1666,21 @@ js::LookupAsmJSModuleInCache(ExclusiveCo
if (machineId != cachedMachineId)
return true;
ModuleCharsForLookup moduleChars;
cursor = moduleChars.deserialize(cx, cursor);
if (!moduleChars.match(parser))
return true;
- uint32_t funcStart = parser.pc->maybeFunction->pn_body->pn_pos.begin;
- uint32_t offsetToEndOfUseAsm = parser.tokenStream.currentToken().pos.end;
+ uint32_t srcStart = parser.pc->maybeFunction->pn_body->pn_pos.begin;
+ uint32_t srcBodyStart = parser.tokenStream.currentToken().pos.end;
bool strict = parser.pc->sc->strict && !parser.pc->sc->hasExplicitUseStrict();
ScopedJSDeletePtr<AsmJSModule> module(
- cx->new_<AsmJSModule>(parser.ss, funcStart, offsetToEndOfUseAsm, strict));
+ cx->new_<AsmJSModule>(parser.ss, srcStart, srcBodyStart, strict));
if (!module)
return false;
cursor = module->deserialize(cx, cursor);
// No need to flush the instruction cache now, it will be flushed when dynamically linking.
AutoFlushICache afc("LookupAsmJSModuleInCache", /* inhibit= */ true);
// We already know the exact extent of areas that need to be patched, just make sure we
// flush all of them at once.
@@ -1691,16 +1691,16 @@ js::LookupAsmJSModuleInCache(ExclusiveCo
bool atEnd = cursor == entry.memory + entry.serializedSize;
MOZ_ASSERT(atEnd, "Corrupt cache file");
if (!atEnd)
return true;
module->staticallyLink(cx);
- parser.tokenStream.advance(module->funcEndBeforeCurly());
+ parser.tokenStream.advance(module->srcEndBeforeCurly());
int64_t usecAfter = PRMJ_Now();
int ms = (usecAfter - usecBefore) / PRMJ_USEC_PER_MSEC;
*compilationTimeReport = JS_smprintf("loaded from cache in %dms", ms);
*moduleOut = module.forget();
return true;
}
--- a/js/src/jit/AsmJSModule.h
+++ b/js/src/jit/AsmJSModule.h
@@ -485,27 +485,27 @@ class AsmJSModule
struct Pod {
size_t funcPtrTableAndExitBytes_;
size_t functionBytes_; // just the function bodies, no stubs
size_t codeBytes_; // function bodies and stubs
size_t totalBytes_; // function bodies, stubs, and global data
uint32_t minHeapLength_;
uint32_t numGlobalVars_;
uint32_t numFFIs_;
- uint32_t funcLength_;
- uint32_t funcLengthWithRightBrace_;
+ uint32_t srcLength_;
+ uint32_t srcLengthWithRightBrace_;
bool strict_;
bool hasArrayView_;
} pod;
// These two fields need to be kept out pod as they depend on the position
// of the module within the ScriptSource and thus aren't invariant with
// respect to caching.
- const uint32_t funcStart_;
- const uint32_t offsetToEndOfUseAsm_;
+ const uint32_t srcStart_;
+ const uint32_t srcBodyStart_;
Vector<Global, 0, SystemAllocPolicy> globals_;
Vector<Exit, 0, SystemAllocPolicy> exits_;
Vector<ExportedFunction, 0, SystemAllocPolicy> exports_;
Vector<jit::CallSite, 0, SystemAllocPolicy> callSites_;
Vector<CodeRange, 0, SystemAllocPolicy> codeRanges_;
Vector<Name, 0, SystemAllocPolicy> functionNames_;
Vector<jit::AsmJSHeapAccess, 0, SystemAllocPolicy> heapAccesses_;
@@ -528,18 +528,18 @@ class AsmJSModule
bool dynamicallyLinked_;
bool loadedFromCache_;
// This field is accessed concurrently when requesting an interrupt.
// Access must be synchronized via the runtime's interrupt lock.
mutable bool codeIsProtected_;
public:
- explicit AsmJSModule(ScriptSource *scriptSource, uint32_t functStart,
- uint32_t offsetToEndOfUseAsm, bool strict);
+ explicit AsmJSModule(ScriptSource *scriptSource, uint32_t srcStart, uint32_t srcBodyStart,
+ bool strict);
void trace(JSTracer *trc);
~AsmJSModule();
// An AsmJSModule transitions monotonically through these states:
bool isFinishedWithModulePrologue() const { return pod.funcPtrTableAndExitBytes_ != SIZE_MAX; }
bool isFinishedWithFunctionBodies() const { return pod.functionBytes_ != UINT32_MAX; }
bool isFinished() const { return !!code_; }
bool isStaticallyLinked() const { return !!interruptExit_; }
@@ -554,28 +554,29 @@ class AsmJSModule
}
bool strict() const {
return pod.strict_;
}
bool loadedFromCache() const {
return loadedFromCache_;
}
- // funcStart() refers to the offset in the ScriptSource to the beginning
- // of the function. If the function has been created with the Function
- // constructor, this will be the first character in the function source.
- // Otherwise, it will be the opening parenthesis of the arguments list.
- uint32_t funcStart() const {
- return funcStart_;
+ // srcStart() refers to the offset in the ScriptSource to the beginning of
+ // the asm.js module function. If the function has been created with the
+ // Function constructor, this will be the first character in the function
+ // source. Otherwise, it will be the opening parenthesis of the arguments
+ // list.
+ uint32_t srcStart() const {
+ return srcStart_;
}
- // offsetToEndOfUseAsm() refers to the offset in the ScriptSource to the end
+ // srcBodyStart() refers to the offset in the ScriptSource to the end
// of the 'use asm' string-literal token.
- uint32_t offsetToEndOfUseAsm() const {
- return offsetToEndOfUseAsm_;
+ uint32_t srcBodyStart() const {
+ return srcBodyStart_;
}
// While these functions may be accessed at any time, their values will
// change as the module is compiled.
uint32_t minHeapLength() const {
return pod.minHeapLength_;
}
unsigned numFunctionCounts() const {
@@ -738,40 +739,38 @@ class AsmJSModule
pod.funcPtrTableAndExitBytes_ += numElems * sizeof(void*);
return true;
}
bool addFunctionCounts(jit::IonScriptCounts *counts) {
JS_ASSERT(isFinishedWithModulePrologue() && !isFinishedWithFunctionBodies());
return functionCounts_.append(counts);
}
#if defined(MOZ_VTUNE) || defined(JS_ION_PERF)
- bool addProfiledFunction(PropertyName *name, unsigned startCodeOffset, unsigned endCodeOffset,
+ bool addProfiledFunction(PropertyName *name, unsigned codeStart, unsigned codeEnd,
unsigned line, unsigned column)
{
JS_ASSERT(isFinishedWithModulePrologue() && !isFinishedWithFunctionBodies());
- ProfiledFunction func(name, startCodeOffset, endCodeOffset, line, column);
+ ProfiledFunction func(name, codeStart, codeEnd, line, column);
return profiledFunctions_.append(func);
}
unsigned numProfiledFunctions() const {
JS_ASSERT(isFinishedWithModulePrologue());
return profiledFunctions_.length();
}
ProfiledFunction &profiledFunction(unsigned i) {
JS_ASSERT(isFinishedWithModulePrologue());
return profiledFunctions_[i];
}
#endif
#ifdef JS_ION_PERF
- bool addPerfProfiledBlocks(PropertyName *name, unsigned startCodeOffset,
- unsigned endInlineCodeOffset, unsigned endCodeOffset,
- jit::BasicBlocksVector &basicBlocks)
+ bool addProfiledBlocks(PropertyName *name, unsigned codeBegin, unsigned inlineEnd,
+ unsigned codeEnd, jit::BasicBlocksVector &basicBlocks)
{
JS_ASSERT(isFinishedWithModulePrologue() && !isFinishedWithFunctionBodies());
- ProfiledBlocksFunction func(name, startCodeOffset, endInlineCodeOffset, endCodeOffset,
- basicBlocks);
+ ProfiledBlocksFunction func(name, codeBegin, inlineEnd, codeEnd, basicBlocks);
return perfProfiledBlocksFunctions_.append(mozilla::Move(func));
}
unsigned numPerfBlocksFunctions() const {
JS_ASSERT(isFinishedWithModulePrologue());
return perfProfiledBlocksFunctions_.length();
}
ProfiledBlocksFunction &perfProfiledBlocksFunction(unsigned i) {
JS_ASSERT(isFinishedWithModulePrologue());
@@ -838,23 +837,23 @@ class AsmJSModule
bool hasArrayView() const {
JS_ASSERT(isFinished());
return pod.hasArrayView_;
}
unsigned numFFIs() const {
JS_ASSERT(isFinished());
return pod.numFFIs_;
}
- uint32_t funcEndBeforeCurly() const {
+ uint32_t srcEndBeforeCurly() const {
JS_ASSERT(isFinished());
- return funcStart_ + pod.funcLength_;
+ return srcStart_ + pod.srcLength_;
}
- uint32_t funcEndAfterCurly() const {
+ uint32_t srcEndAfterCurly() const {
JS_ASSERT(isFinished());
- return funcStart_ + pod.funcLengthWithRightBrace_;
+ return srcStart_ + pod.srcLengthWithRightBrace_;
}
uint8_t *codeBase() const {
JS_ASSERT(isFinished());
JS_ASSERT(uintptr_t(code_) % AsmJSPageSize == 0);
return code_;
}
size_t functionBytes() const {
JS_ASSERT(isFinished());