Index: src/x64/full-codegen-x64.cc |
diff --git a/src/x64/full-codegen-x64.cc b/src/x64/full-codegen-x64.cc |
index 1bd1c1425db1e56abc382412e60296663f73b053..1bcbdfe59999528f1693f2395f0edec2906ea7b4 100644 |
--- a/src/x64/full-codegen-x64.cc |
+++ b/src/x64/full-codegen-x64.cc |
@@ -1333,7 +1333,7 @@ void FullCodeGenerator::EmitSetHomeObjectIfNeeded(Expression* initializer, |
void FullCodeGenerator::EmitLoadGlobalCheckExtensions(VariableProxy* proxy, |
- TypeofState typeof_state, |
+ TypeofMode typeof_mode, |
Label* slow) { |
Register context = rsi; |
Register temp = rdx; |
@@ -1383,7 +1383,7 @@ void FullCodeGenerator::EmitLoadGlobalCheckExtensions(VariableProxy* proxy, |
// All extension objects were empty and it is safe to use a normal global |
// load machinery. |
- EmitGlobalVariableLoad(proxy, typeof_state); |
+ EmitGlobalVariableLoad(proxy, typeof_mode); |
} |
@@ -1418,9 +1418,8 @@ MemOperand FullCodeGenerator::ContextSlotOperandCheckExtensions(Variable* var, |
void FullCodeGenerator::EmitDynamicLookupFastCase(VariableProxy* proxy, |
- TypeofState typeof_state, |
- Label* slow, |
- Label* done) { |
+ TypeofMode typeof_mode, |
+ Label* slow, Label* done) { |
// Generate fast-case code for variables that might be shadowed by |
// eval-introduced variables. Eval is used a lot without |
// introducing variables. In those cases, we do not want to |
@@ -1428,7 +1427,7 @@ void FullCodeGenerator::EmitDynamicLookupFastCase(VariableProxy* proxy, |
// containing the eval. |
Variable* var = proxy->var(); |
if (var->mode() == DYNAMIC_GLOBAL) { |
- EmitLoadGlobalCheckExtensions(proxy, typeof_state, slow); |
+ EmitLoadGlobalCheckExtensions(proxy, typeof_mode, slow); |
__ jmp(done); |
} else if (var->mode() == DYNAMIC_LOCAL) { |
Variable* local = var->local_if_not_shadowed(); |
@@ -1450,7 +1449,7 @@ void FullCodeGenerator::EmitDynamicLookupFastCase(VariableProxy* proxy, |
void FullCodeGenerator::EmitGlobalVariableLoad(VariableProxy* proxy, |
- TypeofState typeof_state) { |
+ TypeofMode typeof_mode) { |
Variable* var = proxy->var(); |
DCHECK(var->IsUnallocatedOrGlobalSlot() || |
(var->IsLookupSlot() && var->mode() == DYNAMIC_GLOBAL)); |
@@ -1473,15 +1472,13 @@ void FullCodeGenerator::EmitGlobalVariableLoad(VariableProxy* proxy, |
__ movp(LoadDescriptor::ReceiverRegister(), GlobalObjectOperand()); |
__ Move(LoadDescriptor::SlotRegister(), |
SmiFromSlot(proxy->VariableFeedbackSlot())); |
- // Inside typeof use a regular load, not a contextual load, to avoid |
- // a reference error. |
- CallLoadIC(typeof_state == NOT_INSIDE_TYPEOF ? CONTEXTUAL : NOT_CONTEXTUAL); |
+ CallLoadIC(typeof_mode); |
} |
} |
void FullCodeGenerator::EmitVariableLoad(VariableProxy* proxy, |
- TypeofState typeof_state) { |
+ TypeofMode typeof_mode) { |
// Record position before possible IC call. |
SetExpressionPosition(proxy); |
PrepareForBailoutForId(proxy->BeforeId(), NO_REGISTERS); |
@@ -1493,7 +1490,7 @@ void FullCodeGenerator::EmitVariableLoad(VariableProxy* proxy, |
case VariableLocation::GLOBAL: |
case VariableLocation::UNALLOCATED: { |
Comment cmnt(masm_, "[ Global variable"); |
- EmitGlobalVariableLoad(proxy, typeof_state); |
+ EmitGlobalVariableLoad(proxy, typeof_mode); |
context()->Plug(rax); |
break; |
} |
@@ -1501,7 +1498,7 @@ void FullCodeGenerator::EmitVariableLoad(VariableProxy* proxy, |
case VariableLocation::PARAMETER: |
case VariableLocation::LOCAL: |
case VariableLocation::CONTEXT: { |
- DCHECK_EQ(NOT_INSIDE_TYPEOF, typeof_state); |
+ DCHECK_EQ(NOT_INSIDE_TYPEOF, typeof_mode); |
Comment cmnt(masm_, var->IsContextSlot() ? "[ Context slot" |
: "[ Stack slot"); |
if (var->binding_needs_init()) { |
@@ -1574,12 +1571,12 @@ void FullCodeGenerator::EmitVariableLoad(VariableProxy* proxy, |
Label done, slow; |
// Generate code for loading from variables potentially shadowed |
// by eval-introduced variables. |
- EmitDynamicLookupFastCase(proxy, typeof_state, &slow, &done); |
+ EmitDynamicLookupFastCase(proxy, typeof_mode, &slow, &done); |
__ bind(&slow); |
__ Push(rsi); // Context. |
__ Push(var->name()); |
Runtime::FunctionId function_id = |
- typeof_state == NOT_INSIDE_TYPEOF |
+ typeof_mode == NOT_INSIDE_TYPEOF |
? Runtime::kLoadLookupSlot |
: Runtime::kLoadLookupSlotNoReferenceError; |
__ CallRuntime(function_id, 2); |
@@ -2259,7 +2256,7 @@ void FullCodeGenerator::VisitYield(Yield* expr) { |
__ LoadRoot(load_name, Heap::kdone_stringRootIndex); // "done" |
__ Move(LoadDescriptor::SlotRegister(), |
SmiFromSlot(expr->DoneFeedbackSlot())); |
- CallLoadIC(NOT_CONTEXTUAL); // rax=result.done |
+ CallLoadIC(NOT_INSIDE_TYPEOF); // rax=result.done |
Handle<Code> bool_ic = ToBooleanStub::GetUninitialized(isolate()); |
CallIC(bool_ic); |
__ testp(result_register(), result_register()); |
@@ -2270,7 +2267,7 @@ void FullCodeGenerator::VisitYield(Yield* expr) { |
__ LoadRoot(load_name, Heap::kvalue_stringRootIndex); // "value" |
__ Move(LoadDescriptor::SlotRegister(), |
SmiFromSlot(expr->ValueFeedbackSlot())); |
- CallLoadIC(NOT_CONTEXTUAL); // result.value in rax |
+ CallLoadIC(NOT_INSIDE_TYPEOF); // result.value in rax |
context()->DropAndPlug(2, rax); // drop iter and g |
break; |
} |
@@ -2410,7 +2407,7 @@ void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) { |
__ Move(LoadDescriptor::NameRegister(), key->value()); |
__ Move(LoadDescriptor::SlotRegister(), |
SmiFromSlot(prop->PropertyFeedbackSlot())); |
- CallLoadIC(NOT_CONTEXTUAL, language_mode()); |
+ CallLoadIC(NOT_INSIDE_TYPEOF, language_mode()); |
} |
@@ -4714,7 +4711,7 @@ void FullCodeGenerator::EmitLoadJSRuntimeFunction(CallRuntime* expr) { |
__ Move(LoadDescriptor::NameRegister(), expr->name()); |
__ Move(LoadDescriptor::SlotRegister(), |
SmiFromSlot(expr->CallRuntimeFeedbackSlot())); |
- CallLoadIC(NOT_CONTEXTUAL); |
+ CallLoadIC(NOT_INSIDE_TYPEOF); |
} |