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_X87 | 5 #if V8_TARGET_ARCH_X87 |
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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 CompilationInfo* info = info_; | 94 CompilationInfo* info = info_; |
95 profiling_counter_ = isolate()->factory()->NewCell( | 95 profiling_counter_ = isolate()->factory()->NewCell( |
96 Handle<Smi>(Smi::FromInt(FLAG_interrupt_budget), isolate())); | 96 Handle<Smi>(Smi::FromInt(FLAG_interrupt_budget), isolate())); |
97 SetFunctionPosition(function()); | 97 SetFunctionPosition(function()); |
98 Comment cmnt(masm_, "[ function compiled by full code generator"); | 98 Comment cmnt(masm_, "[ function compiled by full code generator"); |
99 | 99 |
100 ProfileEntryHookStub::MaybeCallEntryHook(masm_); | 100 ProfileEntryHookStub::MaybeCallEntryHook(masm_); |
101 | 101 |
102 #ifdef DEBUG | 102 #ifdef DEBUG |
103 if (strlen(FLAG_stop_at) > 0 && | 103 if (strlen(FLAG_stop_at) > 0 && |
104 info->function()->name()->IsUtf8EqualTo(CStrVector(FLAG_stop_at))) { | 104 function()->name()->IsUtf8EqualTo(CStrVector(FLAG_stop_at))) { |
105 __ int3(); | 105 __ int3(); |
106 } | 106 } |
107 #endif | 107 #endif |
108 | 108 |
109 // Sloppy mode functions and builtins need to replace the receiver with the | 109 // Sloppy mode functions and builtins need to replace the receiver with the |
110 // global proxy when called as functions (without an explicit receiver | 110 // global proxy when called as functions (without an explicit receiver |
111 // object). | 111 // object). |
112 if (is_sloppy(info->language_mode()) && !info->is_native() && | 112 if (is_sloppy(info->language_mode()) && !info->is_native() && |
113 info->MayUseThis()) { | 113 info->MayUseThis()) { |
114 Label ok; | 114 Label ok; |
(...skipping 17 matching lines...) Expand all Loading... |
132 // the frame (that is done below). | 132 // the frame (that is done below). |
133 FrameScope frame_scope(masm_, StackFrame::MANUAL); | 133 FrameScope frame_scope(masm_, StackFrame::MANUAL); |
134 | 134 |
135 info->set_prologue_offset(masm_->pc_offset()); | 135 info->set_prologue_offset(masm_->pc_offset()); |
136 __ Prologue(info->IsCodePreAgingActive()); | 136 __ Prologue(info->IsCodePreAgingActive()); |
137 info->AddNoFrameRange(0, masm_->pc_offset()); | 137 info->AddNoFrameRange(0, masm_->pc_offset()); |
138 | 138 |
139 { Comment cmnt(masm_, "[ Allocate locals"); | 139 { Comment cmnt(masm_, "[ Allocate locals"); |
140 int locals_count = info->scope()->num_stack_slots(); | 140 int locals_count = info->scope()->num_stack_slots(); |
141 // Generators allocate locals, if any, in context slots. | 141 // Generators allocate locals, if any, in context slots. |
142 DCHECK(!IsGeneratorFunction(info->function()->kind()) || locals_count == 0); | 142 DCHECK(!IsGeneratorFunction(function()->kind()) || locals_count == 0); |
143 if (locals_count == 1) { | 143 if (locals_count == 1) { |
144 __ push(Immediate(isolate()->factory()->undefined_value())); | 144 __ push(Immediate(isolate()->factory()->undefined_value())); |
145 } else if (locals_count > 1) { | 145 } else if (locals_count > 1) { |
146 if (locals_count >= 128) { | 146 if (locals_count >= 128) { |
147 Label ok; | 147 Label ok; |
148 __ mov(ecx, esp); | 148 __ mov(ecx, esp); |
149 __ sub(ecx, Immediate(locals_count * kPointerSize)); | 149 __ sub(ecx, Immediate(locals_count * kPointerSize)); |
150 ExternalReference stack_limit = | 150 ExternalReference stack_limit = |
151 ExternalReference::address_of_real_stack_limit(isolate()); | 151 ExternalReference::address_of_real_stack_limit(isolate()); |
152 __ cmp(ecx, Operand::StaticVariable(stack_limit)); | 152 __ cmp(ecx, Operand::StaticVariable(stack_limit)); |
(...skipping 1245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1398 // | 1398 // |
1399 // The condition on the declaration scopes is a conservative check for | 1399 // The condition on the declaration scopes is a conservative check for |
1400 // nested functions that access a binding and are called before the | 1400 // nested functions that access a binding and are called before the |
1401 // binding is initialized: | 1401 // binding is initialized: |
1402 // function() { f(); let x = 1; function f() { x = 2; } } | 1402 // function() { f(); let x = 1; function f() { x = 2; } } |
1403 // | 1403 // |
1404 bool skip_init_check; | 1404 bool skip_init_check; |
1405 if (var->scope()->DeclarationScope() != scope()->DeclarationScope()) { | 1405 if (var->scope()->DeclarationScope() != scope()->DeclarationScope()) { |
1406 skip_init_check = false; | 1406 skip_init_check = false; |
1407 } else if (var->is_this()) { | 1407 } else if (var->is_this()) { |
1408 CHECK(info_->function() != nullptr && | 1408 CHECK(info_->has_literal() && |
1409 (info_->function()->kind() & kSubclassConstructor) != 0); | 1409 (info_->literal()->kind() & kSubclassConstructor) != 0); |
1410 // TODO(dslomov): implement 'this' hole check elimination. | 1410 // TODO(dslomov): implement 'this' hole check elimination. |
1411 skip_init_check = false; | 1411 skip_init_check = false; |
1412 } else { | 1412 } else { |
1413 // Check that we always have valid source position. | 1413 // Check that we always have valid source position. |
1414 DCHECK(var->initializer_position() != RelocInfo::kNoPosition); | 1414 DCHECK(var->initializer_position() != RelocInfo::kNoPosition); |
1415 DCHECK(proxy->position() != RelocInfo::kNoPosition); | 1415 DCHECK(proxy->position() != RelocInfo::kNoPosition); |
1416 skip_init_check = var->mode() != CONST_LEGACY && | 1416 skip_init_check = var->mode() != CONST_LEGACY && |
1417 var->initializer_position() < proxy->position(); | 1417 var->initializer_position() < proxy->position(); |
1418 } | 1418 } |
1419 | 1419 |
(...skipping 3862 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5282 Assembler::target_address_at(call_target_address, | 5282 Assembler::target_address_at(call_target_address, |
5283 unoptimized_code)); | 5283 unoptimized_code)); |
5284 return OSR_AFTER_STACK_CHECK; | 5284 return OSR_AFTER_STACK_CHECK; |
5285 } | 5285 } |
5286 | 5286 |
5287 | 5287 |
5288 } // namespace internal | 5288 } // namespace internal |
5289 } // namespace v8 | 5289 } // namespace v8 |
5290 | 5290 |
5291 #endif // V8_TARGET_ARCH_X87 | 5291 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |