Index: src/arm/full-codegen-arm.cc |
diff --git a/src/arm/full-codegen-arm.cc b/src/arm/full-codegen-arm.cc |
index 9c5a690c7d895edcb9bfd7390979c8adce7af5aa..b2741f291ad6f5622e332e97df42cfc1b87e6b5c 100644 |
--- a/src/arm/full-codegen-arm.cc |
+++ b/src/arm/full-codegen-arm.cc |
@@ -150,7 +150,7 @@ void FullCodeGenerator::Generate() { |
// Sloppy mode functions and builtins need to replace the receiver with the |
// global proxy when called as functions (without an explicit receiver |
// object). |
- if (info->is_sloppy_mode() && !info->is_native()) { |
+ if (info->strict_mode() == SLOPPY && !info->is_native()) { |
Label ok; |
int receiver_offset = info->scope()->num_parameters() * kPointerSize; |
__ ldr(r2, MemOperand(sp, receiver_offset)); |
@@ -264,7 +264,7 @@ void FullCodeGenerator::Generate() { |
// The stub will rewrite receiever and parameter count if the previous |
// stack frame was an arguments adapter frame. |
ArgumentsAccessStub::Type type; |
- if (!is_sloppy_mode()) { |
+ if (strict_mode() == STRICT) { |
type = ArgumentsAccessStub::NEW_STRICT; |
} else if (function()->has_duplicate_parameters()) { |
type = ArgumentsAccessStub::NEW_SLOPPY_SLOW; |
@@ -295,7 +295,7 @@ void FullCodeGenerator::Generate() { |
if (scope()->is_function_scope() && scope()->function() != NULL) { |
VariableDeclaration* function = scope()->function(); |
ASSERT(function->proxy()->var()->mode() == CONST || |
- function->proxy()->var()->mode() == CONST_HARMONY); |
+ function->proxy()->var()->mode() == CONST_LEGACY); |
ASSERT(function->proxy()->var()->location() != Variable::UNALLOCATED); |
VisitVariableDeclaration(function); |
} |
@@ -792,7 +792,7 @@ void FullCodeGenerator::VisitVariableDeclaration( |
VariableProxy* proxy = declaration->proxy(); |
VariableMode mode = declaration->mode(); |
Variable* variable = proxy->var(); |
- bool hole_init = mode == CONST || mode == CONST_HARMONY || mode == LET; |
+ bool hole_init = mode == LET || mode == CONST || mode == CONST_LEGACY; |
switch (variable->location()) { |
case Variable::UNALLOCATED: |
globals_->Add(variable->name(), zone()); |
@@ -1331,7 +1331,7 @@ void FullCodeGenerator::EmitNewClosure(Handle<SharedFunctionInfo> info, |
!pretenure && |
scope()->is_function_scope() && |
info->num_literals() == 0) { |
- FastNewClosureStub stub(info->language_mode(), info->is_generator()); |
+ FastNewClosureStub stub(info->strict_mode(), info->is_generator()); |
__ mov(r2, Operand(info)); |
__ CallStub(&stub); |
} else { |
@@ -1455,13 +1455,12 @@ void FullCodeGenerator::EmitDynamicLookupFastCase(Variable* var, |
} else if (var->mode() == DYNAMIC_LOCAL) { |
Variable* local = var->local_if_not_shadowed(); |
__ ldr(r0, ContextSlotOperandCheckExtensions(local, slow)); |
- if (local->mode() == LET || |
- local->mode() == CONST || |
- local->mode() == CONST_HARMONY) { |
+ if (local->mode() == LET || local->mode() == CONST || |
+ local->mode() == CONST_LEGACY) { |
__ CompareRoot(r0, Heap::kTheHoleValueRootIndex); |
- if (local->mode() == CONST) { |
+ if (local->mode() == CONST_LEGACY) { |
__ LoadRoot(r0, Heap::kUndefinedValueRootIndex, eq); |
- } else { // LET || CONST_HARMONY |
+ } else { // LET || CONST |
__ b(ne, done); |
__ mov(r0, Operand(var->name())); |
__ push(r0); |
@@ -1528,7 +1527,7 @@ void FullCodeGenerator::EmitVariableLoad(VariableProxy* proxy) { |
// Check that we always have valid source position. |
ASSERT(var->initializer_position() != RelocInfo::kNoPosition); |
ASSERT(proxy->position() != RelocInfo::kNoPosition); |
- skip_init_check = var->mode() != CONST && |
+ skip_init_check = var->mode() != CONST_LEGACY && |
var->initializer_position() < proxy->position(); |
} |
@@ -1536,7 +1535,7 @@ void FullCodeGenerator::EmitVariableLoad(VariableProxy* proxy) { |
// Let and const need a read barrier. |
GetVar(r0, var); |
__ CompareRoot(r0, Heap::kTheHoleValueRootIndex); |
- if (var->mode() == LET || var->mode() == CONST_HARMONY) { |
+ if (var->mode() == LET || var->mode() == CONST) { |
// Throw a reference error when using an uninitialized let/const |
// binding in harmony mode. |
Label done; |
@@ -1547,7 +1546,7 @@ void FullCodeGenerator::EmitVariableLoad(VariableProxy* proxy) { |
__ bind(&done); |
} else { |
// Uninitalized const bindings outside of harmony mode are unholed. |
- ASSERT(var->mode() == CONST); |
+ ASSERT(var->mode() == CONST_LEGACY); |
__ LoadRoot(r0, Heap::kUndefinedValueRootIndex, eq); |
} |
context()->Plug(r0); |
@@ -2445,7 +2444,7 @@ void FullCodeGenerator::EmitAssignment(Expression* expr) { |
VisitForAccumulatorValue(prop->key()); |
__ mov(r1, r0); |
__ Pop(r0, r2); // r0 = restored value. |
- Handle<Code> ic = is_sloppy_mode() |
+ Handle<Code> ic = strict_mode() == SLOPPY |
? isolate()->builtins()->KeyedStoreIC_Initialize() |
: isolate()->builtins()->KeyedStoreIC_Initialize_Strict(); |
CallIC(ic); |
@@ -2470,24 +2469,23 @@ void FullCodeGenerator::EmitStoreToStackLocalOrContextSlot( |
void FullCodeGenerator::EmitCallStoreContextSlot( |
- Handle<String> name, LanguageMode mode) { |
+ Handle<String> name, StrictMode strict_mode) { |
__ push(r0); // Value. |
__ mov(r1, Operand(name)); |
- __ mov(r0, Operand(Smi::FromInt(mode))); |
+ __ mov(r0, Operand(Smi::FromInt(strict_mode))); |
__ Push(cp, r1, r0); // Context, name, strict mode. |
__ CallRuntime(Runtime::kStoreContextSlot, 4); |
} |
-void FullCodeGenerator::EmitVariableAssignment(Variable* var, |
- Token::Value op) { |
+void FullCodeGenerator::EmitVariableAssignment(Variable* var, Token::Value op) { |
if (var->IsUnallocated()) { |
// Global var, const, or let. |
__ mov(r2, Operand(var->name())); |
__ ldr(r1, GlobalObjectOperand()); |
CallStoreIC(); |
- } else if (op == Token::INIT_CONST) { |
+ } else if (op == Token::INIT_CONST_LEGACY) { |
// Const initializers need a write barrier. |
ASSERT(!var->IsParameter()); // No const parameters. |
if (var->IsLookupSlot()) { |
@@ -2509,7 +2507,7 @@ void FullCodeGenerator::EmitVariableAssignment(Variable* var, |
} else if (var->mode() == LET && op != Token::INIT_LET) { |
// Non-initializing assignment to let variable needs a write barrier. |
if (var->IsLookupSlot()) { |
- EmitCallStoreContextSlot(var->name(), language_mode()); |
+ EmitCallStoreContextSlot(var->name(), strict_mode()); |
} else { |
ASSERT(var->IsStackAllocated() || var->IsContextSlot()); |
Label assign; |
@@ -2525,11 +2523,11 @@ void FullCodeGenerator::EmitVariableAssignment(Variable* var, |
EmitStoreToStackLocalOrContextSlot(var, location); |
} |
- } else if (!var->is_const_mode() || op == Token::INIT_CONST_HARMONY) { |
+ } else if (!var->is_const_mode() || op == Token::INIT_CONST) { |
// Assignment to var or initializing assignment to let/const |
// in harmony mode. |
if (var->IsLookupSlot()) { |
- EmitCallStoreContextSlot(var->name(), language_mode()); |
+ EmitCallStoreContextSlot(var->name(), strict_mode()); |
} else { |
ASSERT((var->IsStackAllocated() || var->IsContextSlot())); |
MemOperand location = VarOperand(var, r1); |
@@ -2571,7 +2569,7 @@ void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) { |
SetSourcePosition(expr->position()); |
__ Pop(r2, r1); // r1 = key. |
- Handle<Code> ic = is_sloppy_mode() |
+ Handle<Code> ic = strict_mode() == SLOPPY |
? isolate()->builtins()->KeyedStoreIC_Initialize() |
: isolate()->builtins()->KeyedStoreIC_Initialize_Strict(); |
CallIC(ic, expr->AssignmentFeedbackId()); |
@@ -2744,8 +2742,8 @@ void FullCodeGenerator::EmitResolvePossiblyDirectEval(int arg_count) { |
int receiver_offset = 2 + info_->scope()->num_parameters(); |
__ ldr(r3, MemOperand(fp, receiver_offset * kPointerSize)); |
- // r2: the language mode. |
- __ mov(r2, Operand(Smi::FromInt(language_mode()))); |
+ // r2: strict mode. |
+ __ mov(r2, Operand(Smi::FromInt(strict_mode()))); |
// r1: the start position of the scope the calls resides in. |
__ mov(r1, Operand(Smi::FromInt(scope()->start_position()))); |
@@ -4185,9 +4183,7 @@ void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) { |
if (property != NULL) { |
VisitForStackValue(property->obj()); |
VisitForStackValue(property->key()); |
- StrictModeFlag strict_mode_flag = (language_mode() == SLOPPY_MODE) |
- ? kSloppyMode : kStrictMode; |
- __ mov(r1, Operand(Smi::FromInt(strict_mode_flag))); |
+ __ mov(r1, Operand(Smi::FromInt(strict_mode()))); |
__ push(r1); |
__ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION); |
context()->Plug(r0); |
@@ -4195,11 +4191,11 @@ void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) { |
Variable* var = proxy->var(); |
// Delete of an unqualified identifier is disallowed in strict mode |
// but "delete this" is allowed. |
- ASSERT(language_mode() == SLOPPY_MODE || var->is_this()); |
+ ASSERT(strict_mode() == SLOPPY || var->is_this()); |
if (var->IsUnallocated()) { |
__ ldr(r2, GlobalObjectOperand()); |
__ mov(r1, Operand(var->name())); |
- __ mov(r0, Operand(Smi::FromInt(kSloppyMode))); |
+ __ mov(r0, Operand(Smi::FromInt(SLOPPY))); |
__ Push(r2, r1, r0); |
__ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION); |
context()->Plug(r0); |
@@ -4453,7 +4449,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { |
} |
case KEYED_PROPERTY: { |
__ Pop(r2, r1); // r1 = key. r2 = receiver. |
- Handle<Code> ic = is_sloppy_mode() |
+ Handle<Code> ic = strict_mode() == SLOPPY |
? isolate()->builtins()->KeyedStoreIC_Initialize() |
: isolate()->builtins()->KeyedStoreIC_Initialize_Strict(); |
CallIC(ic, expr->CountStoreFeedbackId()); |