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_IA32 | 5 #if V8_TARGET_ARCH_IA32 |
6 | 6 |
7 #include "src/codegen.h" | 7 #include "src/codegen.h" |
8 #include "src/deoptimizer.h" | 8 #include "src/deoptimizer.h" |
9 #include "src/full-codegen/full-codegen.h" | 9 #include "src/full-codegen/full-codegen.h" |
10 #include "src/ia32/frames-ia32.h" | 10 #include "src/ia32/frames-ia32.h" |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 // Get the address of the location in the code object | 233 // Get the address of the location in the code object |
234 // and compute the fp-to-sp delta in register edx. | 234 // and compute the fp-to-sp delta in register edx. |
235 __ mov(ecx, Operand(esp, kSavedRegistersAreaSize + 1 * kPointerSize)); | 235 __ mov(ecx, Operand(esp, kSavedRegistersAreaSize + 1 * kPointerSize)); |
236 __ lea(edx, Operand(esp, kSavedRegistersAreaSize + 2 * kPointerSize)); | 236 __ lea(edx, Operand(esp, kSavedRegistersAreaSize + 2 * kPointerSize)); |
237 | 237 |
238 __ sub(edx, ebp); | 238 __ sub(edx, ebp); |
239 __ neg(edx); | 239 __ neg(edx); |
240 | 240 |
241 // Allocate a new deoptimizer object. | 241 // Allocate a new deoptimizer object. |
242 __ PrepareCallCFunction(6, eax); | 242 __ PrepareCallCFunction(6, eax); |
| 243 __ mov(eax, Immediate(0)); |
| 244 Label context_check; |
| 245 __ mov(edi, Operand(ebp, StandardFrameConstants::kContextOffset)); |
| 246 __ JumpIfSmi(edi, &context_check); |
243 __ mov(eax, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); | 247 __ mov(eax, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); |
| 248 __ bind(&context_check); |
244 __ mov(Operand(esp, 0 * kPointerSize), eax); // Function. | 249 __ mov(Operand(esp, 0 * kPointerSize), eax); // Function. |
245 __ mov(Operand(esp, 1 * kPointerSize), Immediate(type())); // Bailout type. | 250 __ mov(Operand(esp, 1 * kPointerSize), Immediate(type())); // Bailout type. |
246 __ mov(Operand(esp, 2 * kPointerSize), ebx); // Bailout id. | 251 __ mov(Operand(esp, 2 * kPointerSize), ebx); // Bailout id. |
247 __ mov(Operand(esp, 3 * kPointerSize), ecx); // Code address or 0. | 252 __ mov(Operand(esp, 3 * kPointerSize), ecx); // Code address or 0. |
248 __ mov(Operand(esp, 4 * kPointerSize), edx); // Fp-to-sp delta. | 253 __ mov(Operand(esp, 4 * kPointerSize), edx); // Fp-to-sp delta. |
249 __ mov(Operand(esp, 5 * kPointerSize), | 254 __ mov(Operand(esp, 5 * kPointerSize), |
250 Immediate(ExternalReference::isolate_address(isolate()))); | 255 Immediate(ExternalReference::isolate_address(isolate()))); |
251 { | 256 { |
252 AllowExternalCallThatCantCauseGC scope(masm()); | 257 AllowExternalCallThatCantCauseGC scope(masm()); |
253 __ CallCFunction(ExternalReference::new_deoptimizer_function(isolate()), 6); | 258 __ CallCFunction(ExternalReference::new_deoptimizer_function(isolate()), 6); |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
406 } | 411 } |
407 | 412 |
408 | 413 |
409 #undef __ | 414 #undef __ |
410 | 415 |
411 | 416 |
412 } // namespace internal | 417 } // namespace internal |
413 } // namespace v8 | 418 } // namespace v8 |
414 | 419 |
415 #endif // V8_TARGET_ARCH_IA32 | 420 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |