Chromium Code Reviews| Index: src/arm/full-codegen-arm.cc |
| diff --git a/src/arm/full-codegen-arm.cc b/src/arm/full-codegen-arm.cc |
| index fcc0bd581363acc1be90a746c0af3492b7114f13..555691c7992205bffae80e4b0d8db778ad97aa87 100644 |
| --- a/src/arm/full-codegen-arm.cc |
| +++ b/src/arm/full-codegen-arm.cc |
| @@ -143,7 +143,7 @@ void FullCodeGenerator::Generate(CompilationInfo* info) { |
| // with undefined when called as functions (without an explicit |
| // receiver object). r5 is zero for method calls and non-zero for |
| // function calls. |
| - if (info->is_strict_mode() || info->is_native()) { |
| + if (!info->is_classic_mode() || info->is_native()) { |
| Label ok; |
| __ cmp(r5, Operand(0)); |
| __ b(eq, &ok); |
| @@ -236,7 +236,7 @@ void FullCodeGenerator::Generate(CompilationInfo* info) { |
| // The stub will rewrite receiever and parameter count if the previous |
| // stack frame was an arguments adapter frame. |
| ArgumentsAccessStub::Type type; |
| - if (is_strict_mode()) { |
| + if (!is_classic_mode()) { |
| type = ArgumentsAccessStub::NEW_STRICT; |
| } else if (function()->has_duplicate_parameters()) { |
| type = ArgumentsAccessStub::NEW_NON_STRICT_SLOW; |
| @@ -1115,7 +1115,7 @@ void FullCodeGenerator::EmitNewClosure(Handle<SharedFunctionInfo> info, |
| !pretenure && |
| scope()->is_function_scope() && |
| info->num_literals() == 0) { |
| - FastNewClosureStub stub(info->strict_mode_flag()); |
| + FastNewClosureStub stub(info->language_mode()); |
| __ mov(r0, Operand(info)); |
| __ push(r0); |
| __ CallStub(&stub); |
| @@ -1465,9 +1465,9 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { |
| VisitForAccumulatorValue(value); |
| __ mov(r2, Operand(key->handle())); |
| __ ldr(r1, MemOperand(sp)); |
| - Handle<Code> ic = is_strict_mode() |
| - ? isolate()->builtins()->StoreIC_Initialize_Strict() |
| - : isolate()->builtins()->StoreIC_Initialize(); |
| + Handle<Code> ic = is_classic_mode() |
| + ? isolate()->builtins()->StoreIC_Initialize() |
| + : isolate()->builtins()->StoreIC_Initialize_Strict(); |
| __ Call(ic, RelocInfo::CODE_TARGET, key->id()); |
| PrepareForBailoutForId(key->id(), NO_REGISTERS); |
| } else { |
| @@ -1873,9 +1873,9 @@ void FullCodeGenerator::EmitAssignment(Expression* expr, int bailout_ast_id) { |
| __ mov(r1, r0); |
| __ pop(r0); // Restore value. |
| __ mov(r2, Operand(prop->key()->AsLiteral()->handle())); |
| - Handle<Code> ic = is_strict_mode() |
| - ? isolate()->builtins()->StoreIC_Initialize_Strict() |
| - : isolate()->builtins()->StoreIC_Initialize(); |
| + Handle<Code> ic = is_classic_mode() |
| + ? isolate()->builtins()->StoreIC_Initialize() |
| + : isolate()->builtins()->StoreIC_Initialize_Strict(); |
| __ Call(ic); |
| break; |
| } |
| @@ -1886,9 +1886,9 @@ void FullCodeGenerator::EmitAssignment(Expression* expr, int bailout_ast_id) { |
| __ mov(r1, r0); |
| __ pop(r2); |
| __ pop(r0); // Restore value. |
| - Handle<Code> ic = is_strict_mode() |
| - ? isolate()->builtins()->KeyedStoreIC_Initialize_Strict() |
| - : isolate()->builtins()->KeyedStoreIC_Initialize(); |
| + Handle<Code> ic = is_classic_mode() |
| + ? isolate()->builtins()->KeyedStoreIC_Initialize() |
| + : isolate()->builtins()->KeyedStoreIC_Initialize_Strict(); |
| __ Call(ic); |
| break; |
| } |
| @@ -1904,9 +1904,9 @@ void FullCodeGenerator::EmitVariableAssignment(Variable* var, |
| // Global var, const, or let. |
| __ mov(r2, Operand(var->name())); |
| __ ldr(r1, GlobalObjectOperand()); |
| - Handle<Code> ic = is_strict_mode() |
| - ? isolate()->builtins()->StoreIC_Initialize_Strict() |
| - : isolate()->builtins()->StoreIC_Initialize(); |
| + Handle<Code> ic = is_classic_mode() |
| + ? isolate()->builtins()->StoreIC_Initialize() |
| + : isolate()->builtins()->StoreIC_Initialize_Strict(); |
| __ Call(ic, RelocInfo::CODE_TARGET_CONTEXT); |
| } else if (op == Token::INIT_CONST) { |
| @@ -1937,7 +1937,7 @@ void FullCodeGenerator::EmitVariableAssignment(Variable* var, |
| if (var->IsLookupSlot()) { |
| __ push(r0); // Value. |
| __ mov(r1, Operand(var->name())); |
| - __ mov(r0, Operand(Smi::FromInt(strict_mode_flag()))); |
| + __ mov(r0, Operand(Smi::FromInt(language_mode()))); |
| __ Push(cp, r1, r0); // Context, name, strict mode. |
| __ CallRuntime(Runtime::kStoreContextSlot, 4); |
| } else { |
| @@ -1985,7 +1985,7 @@ void FullCodeGenerator::EmitVariableAssignment(Variable* var, |
| ASSERT(var->IsLookupSlot()); |
| __ push(r0); // Value. |
| __ mov(r1, Operand(var->name())); |
| - __ mov(r0, Operand(Smi::FromInt(strict_mode_flag()))); |
| + __ mov(r0, Operand(Smi::FromInt(language_mode()))); |
| __ Push(cp, r1, r0); // Context, name, strict mode. |
| __ CallRuntime(Runtime::kStoreContextSlot, 4); |
| } |
| @@ -2022,9 +2022,9 @@ void FullCodeGenerator::EmitNamedPropertyAssignment(Assignment* expr) { |
| __ pop(r1); |
| } |
| - Handle<Code> ic = is_strict_mode() |
| - ? isolate()->builtins()->StoreIC_Initialize_Strict() |
| - : isolate()->builtins()->StoreIC_Initialize(); |
| + Handle<Code> ic = is_classic_mode() |
| + ? isolate()->builtins()->StoreIC_Initialize() |
| + : isolate()->builtins()->StoreIC_Initialize_Strict(); |
| __ Call(ic, RelocInfo::CODE_TARGET, expr->id()); |
| // If the assignment ends an initialization block, revert to fast case. |
| @@ -2068,9 +2068,9 @@ void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) { |
| __ pop(r2); |
| } |
| - Handle<Code> ic = is_strict_mode() |
| - ? isolate()->builtins()->KeyedStoreIC_Initialize_Strict() |
| - : isolate()->builtins()->KeyedStoreIC_Initialize(); |
| + Handle<Code> ic = is_classic_mode() |
| + ? isolate()->builtins()->KeyedStoreIC_Initialize() |
| + : isolate()->builtins()->KeyedStoreIC_Initialize_Strict(); |
| __ Call(ic, RelocInfo::CODE_TARGET, expr->id()); |
| // If the assignment ends an initialization block, revert to fast case. |
| @@ -2193,15 +2193,12 @@ void FullCodeGenerator::EmitResolvePossiblyDirectEval(int arg_count) { |
| } |
| __ push(r1); |
| - // Push the receiver of the enclosing function and do runtime call. |
| + // Push the receiver of the enclosing function. |
|
Rico
2011/11/14 14:58:52
we still call runtime!
Steven
2011/11/15 13:33:30
Done.
|
| int receiver_offset = 2 + info_->scope()->num_parameters(); |
| __ ldr(r1, MemOperand(fp, receiver_offset * kPointerSize)); |
| __ push(r1); |
| - // Push the strict mode flag. In harmony mode every eval call |
| - // is a strict mode eval call. |
| - StrictModeFlag strict_mode = |
| - FLAG_harmony_scoping ? kStrictMode : strict_mode_flag(); |
| - __ mov(r1, Operand(Smi::FromInt(strict_mode))); |
| + // Push the language mode. |
|
Rico
2011/11/14 14:58:52
Actually, I also sort of like the existing comment
Steven
2011/11/15 13:33:30
The previously implemented behavior does not corre
|
| + __ mov(r1, Operand(Smi::FromInt(language_mode()))); |
| __ push(r1); |
| // Push the start position of the scope the calls resides in. |
| @@ -3701,7 +3698,9 @@ void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) { |
| if (property != NULL) { |
| VisitForStackValue(property->obj()); |
| VisitForStackValue(property->key()); |
| - __ mov(r1, Operand(Smi::FromInt(strict_mode_flag()))); |
| + StrictModeFlag strict_mode_flag = (language_mode() == CLASSIC_MODE) |
| + ? kNonStrictMode : kStrictMode; |
| + __ mov(r1, Operand(Smi::FromInt(strict_mode_flag))); |
| __ push(r1); |
| __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION); |
| context()->Plug(r0); |
| @@ -3709,7 +3708,7 @@ 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(strict_mode_flag() == kNonStrictMode || var->is_this()); |
| + ASSERT(language_mode() == CLASSIC_MODE || var->is_this()); |
| if (var->IsUnallocated()) { |
| __ ldr(r2, GlobalObjectOperand()); |
| __ mov(r1, Operand(var->name())); |
| @@ -3973,9 +3972,9 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { |
| case NAMED_PROPERTY: { |
| __ mov(r2, Operand(prop->key()->AsLiteral()->handle())); |
| __ pop(r1); |
| - Handle<Code> ic = is_strict_mode() |
| - ? isolate()->builtins()->StoreIC_Initialize_Strict() |
| - : isolate()->builtins()->StoreIC_Initialize(); |
| + Handle<Code> ic = is_classic_mode() |
| + ? isolate()->builtins()->StoreIC_Initialize() |
| + : isolate()->builtins()->StoreIC_Initialize_Strict(); |
| __ Call(ic, RelocInfo::CODE_TARGET, expr->id()); |
| PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); |
| if (expr->is_postfix()) { |
| @@ -3990,9 +3989,9 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { |
| case KEYED_PROPERTY: { |
| __ pop(r1); // Key. |
| __ pop(r2); // Receiver. |
| - Handle<Code> ic = is_strict_mode() |
| - ? isolate()->builtins()->KeyedStoreIC_Initialize_Strict() |
| - : isolate()->builtins()->KeyedStoreIC_Initialize(); |
| + Handle<Code> ic = is_classic_mode() |
| + ? isolate()->builtins()->KeyedStoreIC_Initialize() |
| + : isolate()->builtins()->KeyedStoreIC_Initialize_Strict(); |
| __ Call(ic, RelocInfo::CODE_TARGET, expr->id()); |
| PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); |
| if (expr->is_postfix()) { |