mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 900669 - OdinMonkey: put memcpy-able data in 'pod' fields of AsmJSModule (r=bbouvier)
--HG-- extra : rebase_source : a724fd33913db2f5610771bc97ffb19fa6f9777d
This commit is contained in:
parent
3972d92239
commit
8b89f4878a
@ -81,13 +81,13 @@ AsmJSModule::allocateCodeAndGlobalSegment(ExclusiveContext *cx, size_t bytesNeed
|
||||
// The global data section sits immediately after the executable (and
|
||||
// other) data allocated by the MacroAssembler, so ensure it is
|
||||
// double-aligned.
|
||||
codeBytes_ = AlignBytes(bytesNeeded, sizeof(double));
|
||||
pod.codeBytes_ = AlignBytes(bytesNeeded, sizeof(double));
|
||||
|
||||
// The entire region is allocated via mmap/VirtualAlloc which requires
|
||||
// units of pages.
|
||||
totalBytes_ = AlignBytes(codeBytes_ + globalDataBytes(), AsmJSPageSize);
|
||||
pod.totalBytes_ = AlignBytes(pod.codeBytes_ + globalDataBytes(), AsmJSPageSize);
|
||||
|
||||
code_ = AllocateExecutableMemory(cx, totalBytes_);
|
||||
code_ = AllocateExecutableMemory(cx, pod.totalBytes_);
|
||||
if (!code_)
|
||||
return NULL;
|
||||
|
||||
@ -114,7 +114,7 @@ AsmJSModule::~AsmJSModule()
|
||||
script->ionScript()->removeDependentAsmJSModule(exit);
|
||||
}
|
||||
|
||||
DeallocateExecutableMemory(code_, totalBytes_);
|
||||
DeallocateExecutableMemory(code_, pod.totalBytes_);
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < numFunctionCounts(); i++)
|
||||
@ -125,7 +125,7 @@ void
|
||||
AsmJSModule::sizeOfMisc(mozilla::MallocSizeOf mallocSizeOf, size_t *asmJSModuleCode,
|
||||
size_t *asmJSModuleData)
|
||||
{
|
||||
*asmJSModuleCode = totalBytes_;
|
||||
*asmJSModuleCode = pod.totalBytes_;
|
||||
*asmJSModuleData = mallocSizeOf(this) +
|
||||
globals_.sizeOfExcludingThis(mallocSizeOf) +
|
||||
exits_.sizeOfExcludingThis(mallocSizeOf) +
|
||||
@ -135,7 +135,7 @@ AsmJSModule::sizeOfMisc(mozilla::MallocSizeOf mallocSizeOf, size_t *asmJSModuleC
|
||||
profiledFunctions_.sizeOfExcludingThis(mallocSizeOf) +
|
||||
#endif
|
||||
#if defined(JS_ION_PERF)
|
||||
perfProfiledFunctions_.sizeOfExcludingThis(mallocSizeOf) +
|
||||
profiledFunctions_.sizeOfExcludingThis(mallocSizeOf) +
|
||||
perfProfiledBlocksFunctions_.sizeOfExcludingThis(mallocSizeOf) +
|
||||
#endif
|
||||
functionCounts_.sizeOfExcludingThis(mallocSizeOf);
|
||||
|
@ -9,6 +9,8 @@
|
||||
|
||||
#ifdef JS_ION
|
||||
|
||||
#include "mozilla/PodOperations.h"
|
||||
|
||||
#include "jsscript.h"
|
||||
|
||||
#include "gc/Marking.h"
|
||||
@ -58,95 +60,97 @@ class AsmJSModule
|
||||
enum VarInitKind { InitConstant, InitImport };
|
||||
|
||||
private:
|
||||
Which which_;
|
||||
union {
|
||||
struct {
|
||||
uint32_t index_;
|
||||
VarInitKind initKind_;
|
||||
union {
|
||||
Value constant_; // will only contain int32/double
|
||||
AsmJSCoercion coercion_;
|
||||
} init;
|
||||
} var;
|
||||
uint32_t ffiIndex_;
|
||||
ArrayBufferView::ViewType viewType_;
|
||||
AsmJSMathBuiltin mathBuiltin_;
|
||||
double constantValue_;
|
||||
} u;
|
||||
struct {
|
||||
Which which_;
|
||||
union {
|
||||
struct {
|
||||
uint32_t index_;
|
||||
VarInitKind initKind_;
|
||||
union {
|
||||
Value constant_; // will only contain int32/double
|
||||
AsmJSCoercion coercion_;
|
||||
} init;
|
||||
} var;
|
||||
uint32_t ffiIndex_;
|
||||
ArrayBufferView::ViewType viewType_;
|
||||
AsmJSMathBuiltin mathBuiltin_;
|
||||
double constantValue_;
|
||||
} u;
|
||||
} pod;
|
||||
PropertyName *name_;
|
||||
|
||||
friend class AsmJSModule;
|
||||
Global(Which which, PropertyName *name)
|
||||
: which_(which), name_(name)
|
||||
{
|
||||
Global(Which which, PropertyName *name) {
|
||||
pod.which_ = which;
|
||||
name_ = name;
|
||||
JS_ASSERT_IF(name_, name_->isTenured());
|
||||
}
|
||||
|
||||
void trace(JSTracer *trc) {
|
||||
if (name_)
|
||||
MarkStringUnbarriered(trc, &name_, "asm.js global name");
|
||||
JS_ASSERT_IF(which_ == Variable && u.var.initKind_ == InitConstant,
|
||||
!u.var.init.constant_.isMarkable());
|
||||
JS_ASSERT_IF(pod.which_ == Variable && pod.u.var.initKind_ == InitConstant,
|
||||
!pod.u.var.init.constant_.isMarkable());
|
||||
}
|
||||
|
||||
public:
|
||||
Which which() const {
|
||||
return which_;
|
||||
return pod.which_;
|
||||
}
|
||||
uint32_t varIndex() const {
|
||||
JS_ASSERT(which_ == Variable);
|
||||
return u.var.index_;
|
||||
JS_ASSERT(pod.which_ == Variable);
|
||||
return pod.u.var.index_;
|
||||
}
|
||||
VarInitKind varInitKind() const {
|
||||
JS_ASSERT(which_ == Variable);
|
||||
return u.var.initKind_;
|
||||
JS_ASSERT(pod.which_ == Variable);
|
||||
return pod.u.var.initKind_;
|
||||
}
|
||||
const Value &varInitConstant() const {
|
||||
JS_ASSERT(which_ == Variable);
|
||||
JS_ASSERT(u.var.initKind_ == InitConstant);
|
||||
return u.var.init.constant_;
|
||||
JS_ASSERT(pod.which_ == Variable);
|
||||
JS_ASSERT(pod.u.var.initKind_ == InitConstant);
|
||||
return pod.u.var.init.constant_;
|
||||
}
|
||||
AsmJSCoercion varImportCoercion() const {
|
||||
JS_ASSERT(which_ == Variable);
|
||||
JS_ASSERT(u.var.initKind_ == InitImport);
|
||||
return u.var.init.coercion_;
|
||||
JS_ASSERT(pod.which_ == Variable);
|
||||
JS_ASSERT(pod.u.var.initKind_ == InitImport);
|
||||
return pod.u.var.init.coercion_;
|
||||
}
|
||||
PropertyName *varImportField() const {
|
||||
JS_ASSERT(which_ == Variable);
|
||||
JS_ASSERT(u.var.initKind_ == InitImport);
|
||||
JS_ASSERT(pod.which_ == Variable);
|
||||
JS_ASSERT(pod.u.var.initKind_ == InitImport);
|
||||
return name_;
|
||||
}
|
||||
PropertyName *ffiField() const {
|
||||
JS_ASSERT(which_ == FFI);
|
||||
JS_ASSERT(pod.which_ == FFI);
|
||||
return name_;
|
||||
}
|
||||
uint32_t ffiIndex() const {
|
||||
JS_ASSERT(which_ == FFI);
|
||||
return u.ffiIndex_;
|
||||
JS_ASSERT(pod.which_ == FFI);
|
||||
return pod.u.ffiIndex_;
|
||||
}
|
||||
PropertyName *viewName() const {
|
||||
JS_ASSERT(which_ == ArrayView);
|
||||
JS_ASSERT(pod.which_ == ArrayView);
|
||||
return name_;
|
||||
}
|
||||
ArrayBufferView::ViewType viewType() const {
|
||||
JS_ASSERT(which_ == ArrayView);
|
||||
return u.viewType_;
|
||||
JS_ASSERT(pod.which_ == ArrayView);
|
||||
return pod.u.viewType_;
|
||||
}
|
||||
PropertyName *mathName() const {
|
||||
JS_ASSERT(which_ == MathBuiltin);
|
||||
JS_ASSERT(pod.which_ == MathBuiltin);
|
||||
return name_;
|
||||
}
|
||||
AsmJSMathBuiltin mathBuiltin() const {
|
||||
JS_ASSERT(which_ == MathBuiltin);
|
||||
return u.mathBuiltin_;
|
||||
JS_ASSERT(pod.which_ == MathBuiltin);
|
||||
return pod.u.mathBuiltin_;
|
||||
}
|
||||
PropertyName *constantName() const {
|
||||
JS_ASSERT(which_ == Constant);
|
||||
JS_ASSERT(pod.which_ == Constant);
|
||||
return name_;
|
||||
}
|
||||
double constantValue() const {
|
||||
JS_ASSERT(which_ == Constant);
|
||||
return u.constantValue_;
|
||||
JS_ASSERT(pod.which_ == Constant);
|
||||
return pod.u.constantValue_;
|
||||
}
|
||||
};
|
||||
|
||||
@ -212,12 +216,14 @@ class AsmJSModule
|
||||
PropertyName *name_;
|
||||
PropertyName *maybeFieldName_;
|
||||
ArgCoercionVector argCoercions_;
|
||||
ReturnType returnType_;
|
||||
bool hasCodePtr_;
|
||||
union {
|
||||
unsigned codeOffset_;
|
||||
CodePtr code_;
|
||||
} u;
|
||||
struct {
|
||||
ReturnType returnType_;
|
||||
bool hasCodePtr_;
|
||||
union {
|
||||
unsigned codeOffset_;
|
||||
CodePtr code_;
|
||||
} u;
|
||||
} pod;
|
||||
|
||||
friend class AsmJSModule;
|
||||
|
||||
@ -225,13 +231,13 @@ class AsmJSModule
|
||||
PropertyName *maybeFieldName,
|
||||
mozilla::MoveRef<ArgCoercionVector> argCoercions,
|
||||
ReturnType returnType)
|
||||
: name_(name),
|
||||
maybeFieldName_(maybeFieldName),
|
||||
argCoercions_(argCoercions),
|
||||
returnType_(returnType),
|
||||
hasCodePtr_(false)
|
||||
{
|
||||
u.codeOffset_ = 0;
|
||||
name_ = name;
|
||||
maybeFieldName_ = maybeFieldName;
|
||||
argCoercions_ = argCoercions;
|
||||
pod.returnType_ = returnType;
|
||||
pod.hasCodePtr_ = false;
|
||||
pod.u.codeOffset_ = 0;
|
||||
JS_ASSERT_IF(maybeFieldName_, name_->isTenured());
|
||||
}
|
||||
|
||||
@ -242,25 +248,23 @@ class AsmJSModule
|
||||
}
|
||||
|
||||
public:
|
||||
ExportedFunction(mozilla::MoveRef<ExportedFunction> rhs)
|
||||
: name_(rhs->name_),
|
||||
maybeFieldName_(rhs->maybeFieldName_),
|
||||
argCoercions_(mozilla::Move(rhs->argCoercions_)),
|
||||
returnType_(rhs->returnType_),
|
||||
hasCodePtr_(rhs->hasCodePtr_),
|
||||
u(rhs->u)
|
||||
{}
|
||||
ExportedFunction(mozilla::MoveRef<ExportedFunction> rhs) {
|
||||
name_ = rhs->name_;
|
||||
maybeFieldName_ = rhs->maybeFieldName_;
|
||||
argCoercions_ = mozilla::Move(rhs->argCoercions_);
|
||||
pod = rhs->pod;
|
||||
}
|
||||
|
||||
void initCodeOffset(unsigned off) {
|
||||
JS_ASSERT(!hasCodePtr_);
|
||||
JS_ASSERT(!u.codeOffset_);
|
||||
u.codeOffset_ = off;
|
||||
JS_ASSERT(!pod.hasCodePtr_);
|
||||
JS_ASSERT(!pod.u.codeOffset_);
|
||||
pod.u.codeOffset_ = off;
|
||||
}
|
||||
void patch(uint8_t *baseAddress) {
|
||||
JS_ASSERT(!hasCodePtr_);
|
||||
JS_ASSERT(u.codeOffset_);
|
||||
hasCodePtr_ = true;
|
||||
u.code_ = JS_DATA_TO_FUNC_PTR(CodePtr, baseAddress + u.codeOffset_);
|
||||
JS_ASSERT(!pod.hasCodePtr_);
|
||||
JS_ASSERT(pod.u.codeOffset_);
|
||||
pod.hasCodePtr_ = true;
|
||||
pod.u.code_ = JS_DATA_TO_FUNC_PTR(CodePtr, baseAddress + pod.u.codeOffset_);
|
||||
}
|
||||
|
||||
PropertyName *name() const {
|
||||
@ -276,11 +280,11 @@ class AsmJSModule
|
||||
return argCoercions_[i];
|
||||
}
|
||||
ReturnType returnType() const {
|
||||
return returnType_;
|
||||
return pod.returnType_;
|
||||
}
|
||||
CodePtr code() const {
|
||||
JS_ASSERT(hasCodePtr_);
|
||||
return u.code_;
|
||||
JS_ASSERT(pod.hasCodePtr_);
|
||||
return pod.u.code_;
|
||||
}
|
||||
};
|
||||
|
||||
@ -316,12 +320,14 @@ class AsmJSModule
|
||||
{
|
||||
jit::PerfSpewer::BasicBlocksVector blocks;
|
||||
|
||||
ProfiledBlocksFunction(JSAtom *name, unsigned start, unsigned end, jit::PerfSpewer::BasicBlocksVector &blocksVector)
|
||||
ProfiledBlocksFunction(JSAtom *name, unsigned start, unsigned end,
|
||||
jit::PerfSpewer::BasicBlocksVector &blocksVector)
|
||||
: ProfiledFunction(name, start, end), blocks(mozilla::Move(blocksVector))
|
||||
{ }
|
||||
|
||||
ProfiledBlocksFunction(const ProfiledBlocksFunction ©)
|
||||
: ProfiledFunction(copy.name, copy.startCodeOffset, copy.endCodeOffset), blocks(mozilla::Move(copy.blocks))
|
||||
: ProfiledFunction(copy.name, copy.startCodeOffset, copy.endCodeOffset),
|
||||
blocks(mozilla::Move(copy.blocks))
|
||||
{ }
|
||||
};
|
||||
#endif
|
||||
@ -335,55 +341,51 @@ class AsmJSModule
|
||||
#if defined(MOZ_VTUNE) or defined(JS_ION_PERF)
|
||||
typedef Vector<ProfiledFunction, 0, SystemAllocPolicy> ProfiledFunctionVector;
|
||||
#endif
|
||||
|
||||
GlobalVector globals_;
|
||||
ExitVector exits_;
|
||||
ExportedFunctionVector exports_;
|
||||
HeapAccessVector heapAccesses_;
|
||||
#if defined(MOZ_VTUNE)
|
||||
ProfiledFunctionVector profiledFunctions_;
|
||||
#endif
|
||||
#if defined(JS_ION_PERF)
|
||||
ProfiledFunctionVector perfProfiledFunctions_;
|
||||
Vector<ProfiledBlocksFunction, 0, SystemAllocPolicy> perfProfiledBlocksFunctions_;
|
||||
typedef Vector<ProfiledBlocksFunction, 0, SystemAllocPolicy> ProfiledBlocksFunctionVector;
|
||||
#endif
|
||||
|
||||
uint32_t numGlobalVars_;
|
||||
uint32_t numFFIs_;
|
||||
size_t funcPtrTableAndExitBytes_;
|
||||
bool hasArrayView_;
|
||||
|
||||
uint8_t * code_;
|
||||
uint8_t * operationCallbackExit_;
|
||||
size_t functionBytes_;
|
||||
size_t codeBytes_;
|
||||
size_t totalBytes_;
|
||||
|
||||
bool linked_;
|
||||
HeapPtr<ArrayBufferObject> maybeHeap_;
|
||||
|
||||
HeapPtrPropertyName globalArgumentName_;
|
||||
HeapPtrPropertyName importArgumentName_;
|
||||
HeapPtrPropertyName bufferArgumentName_;
|
||||
|
||||
GlobalVector globals_;
|
||||
ExitVector exits_;
|
||||
ExportedFunctionVector exports_;
|
||||
HeapAccessVector heapAccesses_;
|
||||
#if defined(MOZ_VTUNE) or defined(JS_ION_PERF)
|
||||
ProfiledFunctionVector profiledFunctions_;
|
||||
#endif
|
||||
#if defined(JS_ION_PERF)
|
||||
ProfiledBlocksFunctionVector perfProfiledBlocksFunctions_;
|
||||
#endif
|
||||
|
||||
struct {
|
||||
uint32_t numGlobalVars_;
|
||||
uint32_t numFFIs_;
|
||||
size_t funcPtrTableAndExitBytes_;
|
||||
bool hasArrayView_;
|
||||
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
|
||||
} pod;
|
||||
|
||||
uint8_t * code_;
|
||||
uint8_t * operationCallbackExit_;
|
||||
|
||||
bool linked_;
|
||||
HeapPtr<ArrayBufferObject> maybeHeap_;
|
||||
|
||||
AsmJSModuleSourceDesc sourceDesc_;
|
||||
FunctionCountsVector functionCounts_;
|
||||
|
||||
public:
|
||||
explicit AsmJSModule()
|
||||
: numGlobalVars_(0),
|
||||
numFFIs_(0),
|
||||
funcPtrTableAndExitBytes_(0),
|
||||
hasArrayView_(false),
|
||||
code_(NULL),
|
||||
operationCallbackExit_(NULL),
|
||||
functionBytes_(0),
|
||||
codeBytes_(0),
|
||||
totalBytes_(0),
|
||||
linked_(false),
|
||||
maybeHeap_(),
|
||||
sourceDesc_()
|
||||
{}
|
||||
explicit AsmJSModule() {
|
||||
code_ = NULL;
|
||||
operationCallbackExit_ = NULL;
|
||||
mozilla::PodZero(&pod);
|
||||
linked_ = false;
|
||||
}
|
||||
|
||||
~AsmJSModule();
|
||||
|
||||
@ -401,8 +403,8 @@ class AsmJSModule
|
||||
profiledFunctions_[i].trace(trc);
|
||||
#endif
|
||||
#if defined(JS_ION_PERF)
|
||||
for (unsigned i = 0; i < perfProfiledFunctions_.length(); i++)
|
||||
perfProfiledFunctions_[i].trace(trc);
|
||||
for (unsigned i = 0; i < profiledFunctions_.length(); i++)
|
||||
profiledFunctions_[i].trace(trc);
|
||||
for (unsigned i = 0; i < perfProfiledBlocksFunctions_.length(); i++)
|
||||
perfProfiledBlocksFunctions_[i].trace(trc);
|
||||
#endif
|
||||
@ -418,61 +420,60 @@ class AsmJSModule
|
||||
}
|
||||
|
||||
bool addGlobalVarInitConstant(const Value &v, uint32_t *globalIndex) {
|
||||
JS_ASSERT(!v.isMarkable());
|
||||
JS_ASSERT(funcPtrTableAndExitBytes_ == 0);
|
||||
if (numGlobalVars_ == UINT32_MAX)
|
||||
JS_ASSERT(pod.funcPtrTableAndExitBytes_ == 0);
|
||||
if (pod.numGlobalVars_ == UINT32_MAX)
|
||||
return false;
|
||||
Global g(Global::Variable, NULL);
|
||||
g.u.var.initKind_ = Global::InitConstant;
|
||||
g.u.var.init.constant_ = v;
|
||||
g.u.var.index_ = *globalIndex = numGlobalVars_++;
|
||||
g.pod.u.var.initKind_ = Global::InitConstant;
|
||||
g.pod.u.var.init.constant_ = v;
|
||||
g.pod.u.var.index_ = *globalIndex = pod.numGlobalVars_++;
|
||||
return globals_.append(g);
|
||||
}
|
||||
bool addGlobalVarImport(PropertyName *name, AsmJSCoercion coercion, uint32_t *globalIndex) {
|
||||
JS_ASSERT(funcPtrTableAndExitBytes_ == 0);
|
||||
JS_ASSERT(pod.funcPtrTableAndExitBytes_ == 0);
|
||||
Global g(Global::Variable, name);
|
||||
g.u.var.initKind_ = Global::InitImport;
|
||||
g.u.var.init.coercion_ = coercion;
|
||||
g.u.var.index_ = *globalIndex = numGlobalVars_++;
|
||||
g.pod.u.var.initKind_ = Global::InitImport;
|
||||
g.pod.u.var.init.coercion_ = coercion;
|
||||
g.pod.u.var.index_ = *globalIndex = pod.numGlobalVars_++;
|
||||
return globals_.append(g);
|
||||
}
|
||||
bool addFFI(PropertyName *field, uint32_t *ffiIndex) {
|
||||
if (numFFIs_ == UINT32_MAX)
|
||||
if (pod.numFFIs_ == UINT32_MAX)
|
||||
return false;
|
||||
Global g(Global::FFI, field);
|
||||
g.u.ffiIndex_ = *ffiIndex = numFFIs_++;
|
||||
g.pod.u.ffiIndex_ = *ffiIndex = pod.numFFIs_++;
|
||||
return globals_.append(g);
|
||||
}
|
||||
bool addArrayView(ArrayBufferView::ViewType vt, PropertyName *field) {
|
||||
hasArrayView_ = true;
|
||||
pod.hasArrayView_ = true;
|
||||
Global g(Global::ArrayView, field);
|
||||
g.u.viewType_ = vt;
|
||||
g.pod.u.viewType_ = vt;
|
||||
return globals_.append(g);
|
||||
}
|
||||
bool addMathBuiltin(AsmJSMathBuiltin mathBuiltin, PropertyName *field) {
|
||||
Global g(Global::MathBuiltin, field);
|
||||
g.u.mathBuiltin_ = mathBuiltin;
|
||||
g.pod.u.mathBuiltin_ = mathBuiltin;
|
||||
return globals_.append(g);
|
||||
}
|
||||
bool addGlobalConstant(double value, PropertyName *name) {
|
||||
Global g(Global::Constant, name);
|
||||
g.u.constantValue_ = value;
|
||||
g.pod.u.constantValue_ = value;
|
||||
return globals_.append(g);
|
||||
}
|
||||
bool addFuncPtrTable(unsigned numElems, uint32_t *globalDataOffset) {
|
||||
JS_ASSERT(IsPowerOfTwo(numElems));
|
||||
if (SIZE_MAX - funcPtrTableAndExitBytes_ < numElems * sizeof(void*))
|
||||
if (SIZE_MAX - pod.funcPtrTableAndExitBytes_ < numElems * sizeof(void*))
|
||||
return false;
|
||||
*globalDataOffset = globalDataBytes();
|
||||
funcPtrTableAndExitBytes_ += numElems * sizeof(void*);
|
||||
pod.funcPtrTableAndExitBytes_ += numElems * sizeof(void*);
|
||||
return true;
|
||||
}
|
||||
bool addExit(unsigned ffiIndex, unsigned *exitIndex) {
|
||||
if (SIZE_MAX - funcPtrTableAndExitBytes_ < sizeof(ExitDatum))
|
||||
if (SIZE_MAX - pod.funcPtrTableAndExitBytes_ < sizeof(ExitDatum))
|
||||
return false;
|
||||
uint32_t globalDataOffset = globalDataBytes();
|
||||
JS_STATIC_ASSERT(sizeof(ExitDatum) % sizeof(void*) == 0);
|
||||
funcPtrTableAndExitBytes_ += sizeof(ExitDatum);
|
||||
pod.funcPtrTableAndExitBytes_ += sizeof(ExitDatum);
|
||||
*exitIndex = unsigned(exits_.length());
|
||||
return exits_.append(Exit(ffiIndex, globalDataOffset));
|
||||
}
|
||||
@ -513,13 +514,13 @@ class AsmJSModule
|
||||
unsigned line, unsigned column)
|
||||
{
|
||||
ProfiledFunction func(name, startCodeOffset, endCodeOffset, line, column);
|
||||
return perfProfiledFunctions_.append(func);
|
||||
return profiledFunctions_.append(func);
|
||||
}
|
||||
unsigned numPerfFunctions() const {
|
||||
return perfProfiledFunctions_.length();
|
||||
return profiledFunctions_.length();
|
||||
}
|
||||
const ProfiledFunction &perfProfiledFunction(unsigned i) const {
|
||||
return perfProfiledFunctions_[i];
|
||||
return profiledFunctions_[i];
|
||||
}
|
||||
|
||||
bool trackPerfProfiledBlocks(JSAtom *name, unsigned startCodeOffset, unsigned endCodeOffset, jit::PerfSpewer::BasicBlocksVector &basicBlocks) {
|
||||
@ -534,13 +535,13 @@ class AsmJSModule
|
||||
}
|
||||
#endif
|
||||
bool hasArrayView() const {
|
||||
return hasArrayView_;
|
||||
return pod.hasArrayView_;
|
||||
}
|
||||
unsigned numFFIs() const {
|
||||
return numFFIs_;
|
||||
return pod.numFFIs_;
|
||||
}
|
||||
unsigned numGlobalVars() const {
|
||||
return numGlobalVars_;
|
||||
return pod.numGlobalVars_;
|
||||
}
|
||||
unsigned numGlobals() const {
|
||||
return globals_.length();
|
||||
@ -585,13 +586,13 @@ class AsmJSModule
|
||||
// function-pointer tables are encountered).
|
||||
uint8_t *globalData() const {
|
||||
JS_ASSERT(code_);
|
||||
return code_ + codeBytes_;
|
||||
return code_ + pod.codeBytes_;
|
||||
}
|
||||
|
||||
size_t globalDataBytes() const {
|
||||
return sizeof(void*) +
|
||||
numGlobalVars_ * sizeof(uint64_t) +
|
||||
funcPtrTableAndExitBytes_;
|
||||
pod.numGlobalVars_ * sizeof(uint64_t) +
|
||||
pod.funcPtrTableAndExitBytes_;
|
||||
}
|
||||
unsigned heapOffset() const {
|
||||
return 0;
|
||||
@ -600,7 +601,7 @@ class AsmJSModule
|
||||
return *(uint8_t**)(globalData() + heapOffset());
|
||||
}
|
||||
unsigned globalVarIndexToGlobalDataOffset(unsigned i) const {
|
||||
JS_ASSERT(i < numGlobalVars_);
|
||||
JS_ASSERT(i < pod.numGlobalVars_);
|
||||
return sizeof(void*) +
|
||||
i * sizeof(uint64_t);
|
||||
}
|
||||
@ -619,14 +620,14 @@ class AsmJSModule
|
||||
}
|
||||
|
||||
void initFunctionBytes(size_t functionBytes) {
|
||||
JS_ASSERT(functionBytes_ == 0);
|
||||
JS_ASSERT(pod.functionBytes_ == 0);
|
||||
JS_ASSERT(functionBytes % AsmJSPageSize == 0);
|
||||
functionBytes_ = functionBytes;
|
||||
pod.functionBytes_ = functionBytes;
|
||||
}
|
||||
size_t functionBytes() const {
|
||||
JS_ASSERT(functionBytes_);
|
||||
JS_ASSERT(functionBytes_ % AsmJSPageSize == 0);
|
||||
return functionBytes_;
|
||||
JS_ASSERT(pod.functionBytes_);
|
||||
JS_ASSERT(pod.functionBytes_ % AsmJSPageSize == 0);
|
||||
return pod.functionBytes_;
|
||||
}
|
||||
bool containsPC(void *pc) const {
|
||||
uint8_t *code = functionCode();
|
||||
|
Loading…
Reference in New Issue
Block a user