Bug 1290337 - Part 5: Replace Value parameter to const Value& in JIT. r=nbp

This commit is contained in:
Tooru Fujisawa 2016-09-11 18:15:22 +09:00
parent 98f4254871
commit 0f1a2439c5
6 changed files with 12 additions and 11 deletions

View File

@ -312,7 +312,7 @@ class FunctionCompiler
return constant;
}
MDefinition* constant(Value v, MIRType type)
MDefinition* constant(const Value& v, MIRType type)
{
if (inDeadCode())
return nullptr;

View File

@ -232,7 +232,7 @@ struct BaselineStackBuilder
return true;
}
bool writeValue(Value val, const char* info) {
bool writeValue(const Value& val, const char* info) {
if (!write<Value>(val))
return false;
if (info) {

View File

@ -5613,7 +5613,7 @@ GetTemplateObjectForClassHook(JSContext* cx, JSNative hook, CallArgs& args,
}
static bool
IsOptimizableCallStringSplit(Value callee, int argc, Value* args)
IsOptimizableCallStringSplit(const Value& callee, int argc, Value* args)
{
if (argc != 2 || !args[0].isString() || !args[1].isString())
return false;

View File

@ -532,7 +532,7 @@ IsOptimizableArgumentsObjectForLength(JSObject* obj)
}
static bool
IsOptimizableArgumentsObjectForGetElem(JSObject* obj, Value idval)
IsOptimizableArgumentsObjectForGetElem(JSObject* obj, const Value& idval)
{
if (!IsOptimizableArgumentsObjectForLength(obj))
return false;

View File

@ -378,7 +378,7 @@ struct MaybeReadFallback
return UndefinedValue();
}
NoGCValue noGCPlaceholder(Value v) const {
NoGCValue noGCPlaceholder(const Value& v) const {
if (v.isMagic(JS_OPTIMIZED_OUT))
return NoGC_MagicOptimizedOut;
return NoGC_UndefinedValue;
@ -445,7 +445,7 @@ class SnapshotIterator
Value allocationValue(const RValueAllocation& a, ReadMethod rm = RM_Normal);
MOZ_MUST_USE bool allocationReadable(const RValueAllocation& a, ReadMethod rm = RM_Normal);
void writeAllocationValuePayload(const RValueAllocation& a, Value v);
void writeAllocationValuePayload(const RValueAllocation& a, const Value& v);
void warnUnreadableAllocation();
private:
@ -477,7 +477,7 @@ class SnapshotIterator
// Used by recover instruction to store the value back into the instruction
// results array.
void storeInstructionResult(Value v);
void storeInstructionResult(const Value& v);
public:
// Exhibits frame properties contained in the snapshot.
@ -651,7 +651,7 @@ class InlineFrameIterator
private:
void findNextFrame();
JSObject* computeEnvironmentChain(Value envChainValue, MaybeReadFallback& fallback,
JSObject* computeEnvironmentChain(const Value& envChainValue, MaybeReadFallback& fallback,
bool* hasInitialEnv = nullptr) const;
public:

View File

@ -1926,7 +1926,7 @@ SnapshotIterator::maybeRead(const RValueAllocation& a, MaybeReadFallback& fallba
}
void
SnapshotIterator::writeAllocationValuePayload(const RValueAllocation& alloc, Value v)
SnapshotIterator::writeAllocationValuePayload(const RValueAllocation& alloc, const Value& v)
{
uintptr_t payload = *v.payloadUIntPtr();
#if defined(JS_PUNBOX64)
@ -2144,7 +2144,7 @@ SnapshotIterator::computeInstructionResults(JSContext* cx, RInstructionResults*
}
void
SnapshotIterator::storeInstructionResult(Value v)
SnapshotIterator::storeInstructionResult(const Value& v)
{
uint32_t currIns = recover_.numInstructionsRead() - 1;
MOZ_ASSERT((*instructionResults_)[currIns].isMagic(JS_ION_BAILOUT));
@ -2405,7 +2405,8 @@ InlineFrameIterator::callee(MaybeReadFallback& fallback) const
}
JSObject*
InlineFrameIterator::computeEnvironmentChain(Value envChainValue, MaybeReadFallback& fallback,
InlineFrameIterator::computeEnvironmentChain(const Value& envChainValue,
MaybeReadFallback& fallback,
bool* hasInitialEnv) const
{
if (envChainValue.isObject()) {