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 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_X87 | 7 #if V8_TARGET_ARCH_X87 |
8 | 8 |
9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 // the frame (that is done below). | 136 // the frame (that is done below). |
137 FrameScope frame_scope(masm_, StackFrame::MANUAL); | 137 FrameScope frame_scope(masm_, StackFrame::MANUAL); |
138 | 138 |
139 info->set_prologue_offset(masm_->pc_offset()); | 139 info->set_prologue_offset(masm_->pc_offset()); |
140 __ Prologue(info->IsCodePreAgingActive()); | 140 __ Prologue(info->IsCodePreAgingActive()); |
141 info->AddNoFrameRange(0, masm_->pc_offset()); | 141 info->AddNoFrameRange(0, masm_->pc_offset()); |
142 | 142 |
143 { Comment cmnt(masm_, "[ Allocate locals"); | 143 { Comment cmnt(masm_, "[ Allocate locals"); |
144 int locals_count = info->scope()->num_stack_slots(); | 144 int locals_count = info->scope()->num_stack_slots(); |
145 // Generators allocate locals, if any, in context slots. | 145 // Generators allocate locals, if any, in context slots. |
146 DCHECK(!info->function()->is_generator() || locals_count == 0); | 146 DCHECK(!IsGeneratorFunction(info->function()->kind()) || locals_count == 0); |
147 if (locals_count == 1) { | 147 if (locals_count == 1) { |
148 __ push(Immediate(isolate()->factory()->undefined_value())); | 148 __ push(Immediate(isolate()->factory()->undefined_value())); |
149 } else if (locals_count > 1) { | 149 } else if (locals_count > 1) { |
150 if (locals_count >= 128) { | 150 if (locals_count >= 128) { |
151 Label ok; | 151 Label ok; |
152 __ mov(ecx, esp); | 152 __ mov(ecx, esp); |
153 __ sub(ecx, Immediate(locals_count * kPointerSize)); | 153 __ sub(ecx, Immediate(locals_count * kPointerSize)); |
154 ExternalReference stack_limit = | 154 ExternalReference stack_limit = |
155 ExternalReference::address_of_real_stack_limit(isolate()); | 155 ExternalReference::address_of_real_stack_limit(isolate()); |
156 __ cmp(ecx, Operand::StaticVariable(stack_limit)); | 156 __ cmp(ecx, Operand::StaticVariable(stack_limit)); |
(...skipping 5066 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5223 DCHECK_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), | 5223 DCHECK_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), |
5224 Assembler::target_address_at(call_target_address, | 5224 Assembler::target_address_at(call_target_address, |
5225 unoptimized_code)); | 5225 unoptimized_code)); |
5226 return OSR_AFTER_STACK_CHECK; | 5226 return OSR_AFTER_STACK_CHECK; |
5227 } | 5227 } |
5228 | 5228 |
5229 | 5229 |
5230 } } // namespace v8::internal | 5230 } } // namespace v8::internal |
5231 | 5231 |
5232 #endif // V8_TARGET_ARCH_X87 | 5232 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |