| Index: src/arm/full-codegen-arm.cc
|
| diff --git a/src/arm/full-codegen-arm.cc b/src/arm/full-codegen-arm.cc
|
| index 2eb5ccf974be3810a51f89c244bd661ff3e83ada..bad1003eea687a33725cb734c1c5fb0cc0c07f9e 100644
|
| --- a/src/arm/full-codegen-arm.cc
|
| +++ b/src/arm/full-codegen-arm.cc
|
| @@ -131,8 +131,6 @@ void FullCodeGenerator::Generate() {
|
| handler_table_ =
|
| isolate()->factory()->NewFixedArray(function()->handler_count(), TENURED);
|
|
|
| - InitializeFeedbackVector();
|
| -
|
| profiling_counter_ = isolate()->factory()->NewCell(
|
| Handle<Smi>(Smi::FromInt(FLAG_interrupt_budget), isolate()));
|
| SetFunctionPosition(function());
|
| @@ -147,10 +145,10 @@ void FullCodeGenerator::Generate() {
|
| }
|
| #endif
|
|
|
| - // Classic mode functions and builtins need to replace the receiver with the
|
| + // 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_classic_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));
|
| @@ -173,7 +171,6 @@ void FullCodeGenerator::Generate() {
|
| info->set_prologue_offset(masm_->pc_offset());
|
| __ Prologue(BUILD_FUNCTION_FRAME);
|
| info->AddNoFrameRange(0, masm_->pc_offset());
|
| - __ LoadConstantPoolPointerRegister();
|
|
|
| { Comment cmnt(masm_, "[ Allocate locals");
|
| int locals_count = info->scope()->num_stack_slots();
|
| @@ -264,12 +261,12 @@ 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_classic_mode()) {
|
| + if (strict_mode() == STRICT) {
|
| type = ArgumentsAccessStub::NEW_STRICT;
|
| } else if (function()->has_duplicate_parameters()) {
|
| - type = ArgumentsAccessStub::NEW_NON_STRICT_SLOW;
|
| + type = ArgumentsAccessStub::NEW_SLOPPY_SLOW;
|
| } else {
|
| - type = ArgumentsAccessStub::NEW_NON_STRICT_FAST;
|
| + type = ArgumentsAccessStub::NEW_SLOPPY_FAST;
|
| }
|
| ArgumentsAccessStub stub(type);
|
| __ CallStub(&stub);
|
| @@ -295,7 +292,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 +789,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());
|
| @@ -1167,12 +1164,8 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) {
|
| Label non_proxy;
|
| __ bind(&fixed_array);
|
|
|
| - Handle<Object> feedback = Handle<Object>(
|
| - Smi::FromInt(TypeFeedbackInfo::kForInFastCaseMarker),
|
| - isolate());
|
| - StoreFeedbackVectorSlot(slot, feedback);
|
| __ Move(r1, FeedbackVector());
|
| - __ mov(r2, Operand(Smi::FromInt(TypeFeedbackInfo::kForInSlowCaseMarker)));
|
| + __ mov(r2, Operand(TypeFeedbackInfo::MegamorphicSentinel(isolate())));
|
| __ str(r2, FieldMemOperand(r1, FixedArray::OffsetOfElementAt(slot)));
|
|
|
| __ mov(r1, Operand(Smi::FromInt(1))); // Smi indicates slow check
|
| @@ -1331,7 +1324,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 {
|
| @@ -1361,7 +1354,7 @@ void FullCodeGenerator::EmitLoadGlobalCheckExtensions(Variable* var,
|
| Scope* s = scope();
|
| while (s != NULL) {
|
| if (s->num_heap_slots() > 0) {
|
| - if (s->calls_non_strict_eval()) {
|
| + if (s->calls_sloppy_eval()) {
|
| // Check that extension is NULL.
|
| __ ldr(temp, ContextOperand(current, Context::EXTENSION_INDEX));
|
| __ tst(temp, temp);
|
| @@ -1374,7 +1367,7 @@ void FullCodeGenerator::EmitLoadGlobalCheckExtensions(Variable* var,
|
| }
|
| // If no outer scope calls eval, we do not need to check more
|
| // context extensions.
|
| - if (!s->outer_scope_calls_non_strict_eval() || s->is_eval_scope()) break;
|
| + if (!s->outer_scope_calls_sloppy_eval() || s->is_eval_scope()) break;
|
| s = s->outer_scope();
|
| }
|
|
|
| @@ -1417,7 +1410,7 @@ MemOperand FullCodeGenerator::ContextSlotOperandCheckExtensions(Variable* var,
|
|
|
| for (Scope* s = scope(); s != var->scope(); s = s->outer_scope()) {
|
| if (s->num_heap_slots() > 0) {
|
| - if (s->calls_non_strict_eval()) {
|
| + if (s->calls_sloppy_eval()) {
|
| // Check that extension is NULL.
|
| __ ldr(temp, ContextOperand(context, Context::EXTENSION_INDEX));
|
| __ tst(temp, temp);
|
| @@ -1455,13 +1448,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 +1520,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 +1528,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 +1539,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);
|
| @@ -1652,8 +1644,7 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
|
| : ObjectLiteral::kNoFlags;
|
| __ mov(r0, Operand(Smi::FromInt(flags)));
|
| int properties_count = constant_properties->length() / 2;
|
| - if ((FLAG_track_double_fields && expr->may_store_doubles()) ||
|
| - expr->depth() > 1 || Serializer::enabled() ||
|
| + if (expr->may_store_doubles() || expr->depth() > 1 || Serializer::enabled() ||
|
| flags != ObjectLiteral::kFastElements ||
|
| properties_count > FastCloneShallowObjectStub::kMaximumClonedProperties) {
|
| __ Push(r3, r2, r1, r0);
|
| @@ -2445,7 +2436,7 @@ void FullCodeGenerator::EmitAssignment(Expression* expr) {
|
| VisitForAccumulatorValue(prop->key());
|
| __ mov(r1, r0);
|
| __ Pop(r0, r2); // r0 = restored value.
|
| - Handle<Code> ic = is_classic_mode()
|
| + Handle<Code> ic = strict_mode() == SLOPPY
|
| ? isolate()->builtins()->KeyedStoreIC_Initialize()
|
| : isolate()->builtins()->KeyedStoreIC_Initialize_Strict();
|
| CallIC(ic);
|
| @@ -2470,24 +2461,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 +2499,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 +2515,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 +2561,7 @@ void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) {
|
| SetSourcePosition(expr->position());
|
| __ Pop(r2, r1); // r1 = key.
|
|
|
| - Handle<Code> ic = is_classic_mode()
|
| + Handle<Code> ic = strict_mode() == SLOPPY
|
| ? isolate()->builtins()->KeyedStoreIC_Initialize()
|
| : isolate()->builtins()->KeyedStoreIC_Initialize_Strict();
|
| CallIC(ic, expr->AssignmentFeedbackId());
|
| @@ -2624,7 +2614,7 @@ void FullCodeGenerator::EmitCallWithIC(Call* expr) {
|
| PrepareForBailout(callee, NO_REGISTERS);
|
| }
|
| // Push undefined as receiver. This is patched in the method prologue if it
|
| - // is a classic mode method.
|
| + // is a sloppy mode method.
|
| __ Push(isolate()->factory()->undefined_value());
|
| flags = NO_CALL_FUNCTION_FLAGS;
|
| } else {
|
| @@ -2715,9 +2705,6 @@ void FullCodeGenerator::EmitCallWithStub(Call* expr) {
|
| // Record source position for debugger.
|
| SetSourcePosition(expr->position());
|
|
|
| - Handle<Object> uninitialized =
|
| - TypeFeedbackInfo::UninitializedSentinel(isolate());
|
| - StoreFeedbackVectorSlot(expr->CallFeedbackSlot(), uninitialized);
|
| __ Move(r2, FeedbackVector());
|
| __ mov(r3, Operand(Smi::FromInt(expr->CallFeedbackSlot())));
|
|
|
| @@ -2744,8 +2731,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())));
|
| @@ -2904,9 +2891,6 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) {
|
| __ ldr(r1, MemOperand(sp, arg_count * kPointerSize));
|
|
|
| // Record call targets in unoptimized code.
|
| - Handle<Object> uninitialized =
|
| - TypeFeedbackInfo::UninitializedSentinel(isolate());
|
| - StoreFeedbackVectorSlot(expr->CallNewFeedbackSlot(), uninitialized);
|
| __ Move(r2, FeedbackVector());
|
| __ mov(r3, Operand(Smi::FromInt(expr->CallNewFeedbackSlot())));
|
|
|
| @@ -4185,9 +4169,7 @@ void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) {
|
| if (property != NULL) {
|
| VisitForStackValue(property->obj());
|
| VisitForStackValue(property->key());
|
| - StrictModeFlag strict_mode_flag = (language_mode() == CLASSIC_MODE)
|
| - ? kNonStrictMode : 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 +4177,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() == CLASSIC_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(kNonStrictMode)));
|
| + __ mov(r0, Operand(Smi::FromInt(SLOPPY)));
|
| __ Push(r2, r1, r0);
|
| __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION);
|
| context()->Plug(r0);
|
| @@ -4453,7 +4435,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
|
| }
|
| case KEYED_PROPERTY: {
|
| __ Pop(r2, r1); // r1 = key. r2 = receiver.
|
| - Handle<Code> ic = is_classic_mode()
|
| + Handle<Code> ic = strict_mode() == SLOPPY
|
| ? isolate()->builtins()->KeyedStoreIC_Initialize()
|
| : isolate()->builtins()->KeyedStoreIC_Initialize_Strict();
|
| CallIC(ic, expr->CountStoreFeedbackId());
|
|
|