| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #if V8_TARGET_ARCH_ARM | 5 #if V8_TARGET_ARCH_ARM |
| 6 | 6 |
| 7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
| 8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
| 9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
| 10 #include "src/compiler.h" | 10 #include "src/compiler.h" |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 CompilationInfo* info = info_; | 105 CompilationInfo* info = info_; |
| 106 profiling_counter_ = isolate()->factory()->NewCell( | 106 profiling_counter_ = isolate()->factory()->NewCell( |
| 107 Handle<Smi>(Smi::FromInt(FLAG_interrupt_budget), isolate())); | 107 Handle<Smi>(Smi::FromInt(FLAG_interrupt_budget), isolate())); |
| 108 SetFunctionPosition(function()); | 108 SetFunctionPosition(function()); |
| 109 Comment cmnt(masm_, "[ function compiled by full code generator"); | 109 Comment cmnt(masm_, "[ function compiled by full code generator"); |
| 110 | 110 |
| 111 ProfileEntryHookStub::MaybeCallEntryHook(masm_); | 111 ProfileEntryHookStub::MaybeCallEntryHook(masm_); |
| 112 | 112 |
| 113 #ifdef DEBUG | 113 #ifdef DEBUG |
| 114 if (strlen(FLAG_stop_at) > 0 && | 114 if (strlen(FLAG_stop_at) > 0 && |
| 115 info->function()->name()->IsUtf8EqualTo(CStrVector(FLAG_stop_at))) { | 115 info->literal()->name()->IsUtf8EqualTo(CStrVector(FLAG_stop_at))) { |
| 116 __ stop("stop-at"); | 116 __ stop("stop-at"); |
| 117 } | 117 } |
| 118 #endif | 118 #endif |
| 119 | 119 |
| 120 // Sloppy mode functions and builtins need to replace the receiver with the | 120 // Sloppy mode functions and builtins need to replace the receiver with the |
| 121 // global proxy when called as functions (without an explicit receiver | 121 // global proxy when called as functions (without an explicit receiver |
| 122 // object). | 122 // object). |
| 123 if (is_sloppy(info->language_mode()) && !info->is_native() && | 123 if (is_sloppy(info->language_mode()) && !info->is_native() && |
| 124 info->MayUseThis() && info->scope()->has_this_declaration()) { | 124 info->MayUseThis() && info->scope()->has_this_declaration()) { |
| 125 Label ok; | 125 Label ok; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 141 // the frame (that is done below). | 141 // the frame (that is done below). |
| 142 FrameScope frame_scope(masm_, StackFrame::MANUAL); | 142 FrameScope frame_scope(masm_, StackFrame::MANUAL); |
| 143 | 143 |
| 144 info->set_prologue_offset(masm_->pc_offset()); | 144 info->set_prologue_offset(masm_->pc_offset()); |
| 145 __ Prologue(info->IsCodePreAgingActive()); | 145 __ Prologue(info->IsCodePreAgingActive()); |
| 146 info->AddNoFrameRange(0, masm_->pc_offset()); | 146 info->AddNoFrameRange(0, masm_->pc_offset()); |
| 147 | 147 |
| 148 { Comment cmnt(masm_, "[ Allocate locals"); | 148 { Comment cmnt(masm_, "[ Allocate locals"); |
| 149 int locals_count = info->scope()->num_stack_slots(); | 149 int locals_count = info->scope()->num_stack_slots(); |
| 150 // Generators allocate locals, if any, in context slots. | 150 // Generators allocate locals, if any, in context slots. |
| 151 DCHECK(!IsGeneratorFunction(info->function()->kind()) || locals_count == 0); | 151 DCHECK(!IsGeneratorFunction(info->literal()->kind()) || locals_count == 0); |
| 152 if (locals_count > 0) { | 152 if (locals_count > 0) { |
| 153 if (locals_count >= 128) { | 153 if (locals_count >= 128) { |
| 154 Label ok; | 154 Label ok; |
| 155 __ sub(r9, sp, Operand(locals_count * kPointerSize)); | 155 __ sub(r9, sp, Operand(locals_count * kPointerSize)); |
| 156 __ LoadRoot(r2, Heap::kRealStackLimitRootIndex); | 156 __ LoadRoot(r2, Heap::kRealStackLimitRootIndex); |
| 157 __ cmp(r9, Operand(r2)); | 157 __ cmp(r9, Operand(r2)); |
| 158 __ b(hs, &ok); | 158 __ b(hs, &ok); |
| 159 __ InvokeBuiltin(Builtins::STACK_OVERFLOW, CALL_FUNCTION); | 159 __ InvokeBuiltin(Builtins::STACK_OVERFLOW, CALL_FUNCTION); |
| 160 __ bind(&ok); | 160 __ bind(&ok); |
| 161 } | 161 } |
| (...skipping 1313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1475 // | 1475 // |
| 1476 // The condition on the declaration scopes is a conservative check for | 1476 // The condition on the declaration scopes is a conservative check for |
| 1477 // nested functions that access a binding and are called before the | 1477 // nested functions that access a binding and are called before the |
| 1478 // binding is initialized: | 1478 // binding is initialized: |
| 1479 // function() { f(); let x = 1; function f() { x = 2; } } | 1479 // function() { f(); let x = 1; function f() { x = 2; } } |
| 1480 // | 1480 // |
| 1481 bool skip_init_check; | 1481 bool skip_init_check; |
| 1482 if (var->scope()->DeclarationScope() != scope()->DeclarationScope()) { | 1482 if (var->scope()->DeclarationScope() != scope()->DeclarationScope()) { |
| 1483 skip_init_check = false; | 1483 skip_init_check = false; |
| 1484 } else if (var->is_this()) { | 1484 } else if (var->is_this()) { |
| 1485 CHECK(info_->function() != nullptr && | 1485 CHECK(info_->has_literal() && |
| 1486 (info_->function()->kind() & kSubclassConstructor) != 0); | 1486 (info_->literal()->kind() & kSubclassConstructor) != 0); |
| 1487 // TODO(dslomov): implement 'this' hole check elimination. | 1487 // TODO(dslomov): implement 'this' hole check elimination. |
| 1488 skip_init_check = false; | 1488 skip_init_check = false; |
| 1489 } else { | 1489 } else { |
| 1490 // Check that we always have valid source position. | 1490 // Check that we always have valid source position. |
| 1491 DCHECK(var->initializer_position() != RelocInfo::kNoPosition); | 1491 DCHECK(var->initializer_position() != RelocInfo::kNoPosition); |
| 1492 DCHECK(proxy->position() != RelocInfo::kNoPosition); | 1492 DCHECK(proxy->position() != RelocInfo::kNoPosition); |
| 1493 skip_init_check = var->mode() != CONST_LEGACY && | 1493 skip_init_check = var->mode() != CONST_LEGACY && |
| 1494 var->initializer_position() < proxy->position(); | 1494 var->initializer_position() < proxy->position(); |
| 1495 } | 1495 } |
| 1496 | 1496 |
| (...skipping 3917 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5414 DCHECK(interrupt_address == | 5414 DCHECK(interrupt_address == |
| 5415 isolate->builtins()->OsrAfterStackCheck()->entry()); | 5415 isolate->builtins()->OsrAfterStackCheck()->entry()); |
| 5416 return OSR_AFTER_STACK_CHECK; | 5416 return OSR_AFTER_STACK_CHECK; |
| 5417 } | 5417 } |
| 5418 | 5418 |
| 5419 | 5419 |
| 5420 } // namespace internal | 5420 } // namespace internal |
| 5421 } // namespace v8 | 5421 } // namespace v8 |
| 5422 | 5422 |
| 5423 #endif // V8_TARGET_ARCH_ARM | 5423 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |