Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(158)

Unified Diff: src/x87/full-codegen-x87.cc

Issue 1227893005: TypeofMode replaces TypeofState and ContextualMode. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comments Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/x64/lithium-x64.h ('k') | src/x87/lithium-codegen-x87.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x87/full-codegen-x87.cc
diff --git a/src/x87/full-codegen-x87.cc b/src/x87/full-codegen-x87.cc
index 29616e877c431962372739f4146794b9f44c396c..cc4644c04429dde0be588582d441eb59481b012f 100644
--- a/src/x87/full-codegen-x87.cc
+++ b/src/x87/full-codegen-x87.cc
@@ -1290,7 +1290,7 @@ void FullCodeGenerator::EmitSetHomeObjectIfNeeded(Expression* initializer,
void FullCodeGenerator::EmitLoadGlobalCheckExtensions(VariableProxy* proxy,
- TypeofState typeof_state,
+ TypeofMode typeof_mode,
Label* slow) {
Register context = esi;
Register temp = edx;
@@ -1339,7 +1339,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);
}
@@ -1374,9 +1374,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
@@ -1384,7 +1383,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();
@@ -1406,7 +1405,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));
@@ -1429,15 +1428,13 @@ void FullCodeGenerator::EmitGlobalVariableLoad(VariableProxy* proxy,
__ mov(LoadDescriptor::NameRegister(), var->name());
__ mov(LoadDescriptor::SlotRegister(),
Immediate(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) {
SetExpressionPosition(proxy);
PrepareForBailoutForId(proxy->BeforeId(), NO_REGISTERS);
Variable* var = proxy->var();
@@ -1448,7 +1445,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(eax);
break;
}
@@ -1456,7 +1453,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 variable"
: "[ Stack variable");
if (var->binding_needs_init()) {
@@ -1529,12 +1526,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(esi); // Context.
__ push(Immediate(var->name()));
Runtime::FunctionId function_id =
- typeof_state == NOT_INSIDE_TYPEOF
+ typeof_mode == NOT_INSIDE_TYPEOF
? Runtime::kLoadLookupSlot
: Runtime::kLoadLookupSlotNoReferenceError;
__ CallRuntime(function_id, 2);
@@ -2215,7 +2212,7 @@ void FullCodeGenerator::VisitYield(Yield* expr) {
isolate()->factory()->done_string()); // "done"
__ mov(LoadDescriptor::SlotRegister(),
Immediate(SmiFromSlot(expr->DoneFeedbackSlot())));
- CallLoadIC(NOT_CONTEXTUAL); // result.done in eax
+ CallLoadIC(NOT_INSIDE_TYPEOF); // result.done in eax
Handle<Code> bool_ic = ToBooleanStub::GetUninitialized(isolate());
CallIC(bool_ic);
__ test(eax, eax);
@@ -2227,7 +2224,7 @@ void FullCodeGenerator::VisitYield(Yield* expr) {
isolate()->factory()->value_string()); // "value"
__ mov(LoadDescriptor::SlotRegister(),
Immediate(SmiFromSlot(expr->ValueFeedbackSlot())));
- CallLoadIC(NOT_CONTEXTUAL); // result.value in eax
+ CallLoadIC(NOT_INSIDE_TYPEOF); // result.value in eax
context()->DropAndPlug(2, eax); // drop iter and g
break;
}
@@ -2366,7 +2363,7 @@ void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) {
__ mov(LoadDescriptor::NameRegister(), Immediate(key->value()));
__ mov(LoadDescriptor::SlotRegister(),
Immediate(SmiFromSlot(prop->PropertyFeedbackSlot())));
- CallLoadIC(NOT_CONTEXTUAL, language_mode());
+ CallLoadIC(NOT_INSIDE_TYPEOF, language_mode());
}
@@ -4677,7 +4674,7 @@ void FullCodeGenerator::EmitLoadJSRuntimeFunction(CallRuntime* expr) {
__ mov(LoadDescriptor::NameRegister(), Immediate(expr->name()));
__ mov(LoadDescriptor::SlotRegister(),
Immediate(SmiFromSlot(expr->CallRuntimeFeedbackSlot())));
- CallLoadIC(NOT_CONTEXTUAL);
+ CallLoadIC(NOT_INSIDE_TYPEOF);
}
« no previous file with comments | « src/x64/lithium-x64.h ('k') | src/x87/lithium-codegen-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698