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/debug/debug.h" | 10 #include "src/debug/debug.h" |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 // Possibly allocate a local context. | 178 // Possibly allocate a local context. |
179 if (info->scope()->num_heap_slots() > 0) { | 179 if (info->scope()->num_heap_slots() > 0) { |
180 Comment cmnt(masm_, "[ Allocate context"); | 180 Comment cmnt(masm_, "[ Allocate context"); |
181 bool need_write_barrier = true; | 181 bool need_write_barrier = true; |
182 int slots = info->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; | 182 int slots = info->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; |
183 // Argument to NewContext is the function, which is still in edi. | 183 // Argument to NewContext is the function, which is still in edi. |
184 if (info->scope()->is_script_scope()) { | 184 if (info->scope()->is_script_scope()) { |
185 __ push(edi); | 185 __ push(edi); |
186 __ Push(info->scope()->GetScopeInfo(info->isolate())); | 186 __ Push(info->scope()->GetScopeInfo(info->isolate())); |
187 __ CallRuntime(Runtime::kNewScriptContext, 2); | 187 __ CallRuntime(Runtime::kNewScriptContext, 2); |
| 188 PrepareForBailoutForId(BailoutId::ScriptContext(), TOS_REG); |
188 } else if (slots <= FastNewContextStub::kMaximumSlots) { | 189 } else if (slots <= FastNewContextStub::kMaximumSlots) { |
189 FastNewContextStub stub(isolate(), slots); | 190 FastNewContextStub stub(isolate(), slots); |
190 __ CallStub(&stub); | 191 __ CallStub(&stub); |
191 // Result of FastNewContextStub is always in new space. | 192 // Result of FastNewContextStub is always in new space. |
192 need_write_barrier = false; | 193 need_write_barrier = false; |
193 } else { | 194 } else { |
194 __ push(edi); | 195 __ push(edi); |
195 __ CallRuntime(Runtime::kNewFunctionContext, 1); | 196 __ CallRuntime(Runtime::kNewFunctionContext, 1); |
196 } | 197 } |
197 function_in_register = false; | 198 function_in_register = false; |
(...skipping 21 matching lines...) Expand all Loading... |
219 kDontSaveFPRegs); | 220 kDontSaveFPRegs); |
220 } else if (FLAG_debug_code) { | 221 } else if (FLAG_debug_code) { |
221 Label done; | 222 Label done; |
222 __ JumpIfInNewSpace(esi, eax, &done, Label::kNear); | 223 __ JumpIfInNewSpace(esi, eax, &done, Label::kNear); |
223 __ Abort(kExpectedNewSpaceObject); | 224 __ Abort(kExpectedNewSpaceObject); |
224 __ bind(&done); | 225 __ bind(&done); |
225 } | 226 } |
226 } | 227 } |
227 } | 228 } |
228 } | 229 } |
| 230 PrepareForBailoutForId(BailoutId::FunctionContext(), NO_REGISTERS); |
229 | 231 |
230 PrepareForBailoutForId(BailoutId::Prologue(), NO_REGISTERS); | |
231 // Function register is trashed in case we bailout here. But since that | 232 // Function register is trashed in case we bailout here. But since that |
232 // could happen only when we allocate a context the value of | 233 // could happen only when we allocate a context the value of |
233 // |function_in_register| is correct. | 234 // |function_in_register| is correct. |
234 | 235 |
235 // Possibly set up a local binding to the this function which is used in | 236 // Possibly set up a local binding to the this function which is used in |
236 // derived constructors with super calls. | 237 // derived constructors with super calls. |
237 Variable* this_function_var = scope()->this_function_var(); | 238 Variable* this_function_var = scope()->this_function_var(); |
238 if (this_function_var != nullptr) { | 239 if (this_function_var != nullptr) { |
239 Comment cmnt(masm_, "[ This function"); | 240 Comment cmnt(masm_, "[ This function"); |
240 if (!function_in_register) { | 241 if (!function_in_register) { |
(...skipping 4834 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5075 Assembler::target_address_at(call_target_address, | 5076 Assembler::target_address_at(call_target_address, |
5076 unoptimized_code)); | 5077 unoptimized_code)); |
5077 return OSR_AFTER_STACK_CHECK; | 5078 return OSR_AFTER_STACK_CHECK; |
5078 } | 5079 } |
5079 | 5080 |
5080 | 5081 |
5081 } // namespace internal | 5082 } // namespace internal |
5082 } // namespace v8 | 5083 } // namespace v8 |
5083 | 5084 |
5084 #endif // V8_TARGET_ARCH_X87 | 5085 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |