OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 for (int i = 0; i < jump_table_.length(); i++) { | 349 for (int i = 0; i < jump_table_.length(); i++) { |
350 __ bind(&jump_table_[i].label); | 350 __ bind(&jump_table_[i].label); |
351 Address entry = jump_table_[i].address; | 351 Address entry = jump_table_[i].address; |
352 if (jump_table_[i].needs_frame) { | 352 if (jump_table_[i].needs_frame) { |
353 __ push(Immediate(ExternalReference::ForDeoptEntry(entry))); | 353 __ push(Immediate(ExternalReference::ForDeoptEntry(entry))); |
354 if (jump_table_[i].is_lazy_deopt) { | 354 if (jump_table_[i].is_lazy_deopt) { |
355 if (needs_frame_is_call.is_bound()) { | 355 if (needs_frame_is_call.is_bound()) { |
356 __ jmp(&needs_frame_is_call); | 356 __ jmp(&needs_frame_is_call); |
357 } else { | 357 } else { |
358 __ bind(&needs_frame_is_call); | 358 __ bind(&needs_frame_is_call); |
359 __ push(esi); | 359 __ push(MemOperand(ebp, StandardFrameConstants::kContextOffset)); |
360 // This variant of deopt can only be used with stubs. Since we don't | 360 // This variant of deopt can only be used with stubs. Since we don't |
361 // have a function pointer to install in the stack frame that we're | 361 // have a function pointer to install in the stack frame that we're |
362 // building, install a special marker there instead. | 362 // building, install a special marker there instead. |
363 ASSERT(info()->IsStub()); | 363 ASSERT(info()->IsStub()); |
364 __ push(Immediate(Smi::FromInt(StackFrame::STUB))); | 364 __ push(Immediate(Smi::FromInt(StackFrame::STUB))); |
365 // Push a PC inside the function so that the deopt code can find where | 365 // Push a PC inside the function so that the deopt code can find where |
366 // the deopt comes from. It doesn't have to be the precise return | 366 // the deopt comes from. It doesn't have to be the precise return |
367 // address of a "calling" LAZY deopt, it only has to be somewhere | 367 // address of a "calling" LAZY deopt, it only has to be somewhere |
368 // inside the code body. | 368 // inside the code body. |
369 Label push_approx_pc; | 369 Label push_approx_pc; |
370 __ call(&push_approx_pc); | 370 __ call(&push_approx_pc); |
371 __ bind(&push_approx_pc); | 371 __ bind(&push_approx_pc); |
372 // Push the continuation which was stashed were the ebp should | 372 // Push the continuation which was stashed were the ebp should |
373 // be. Replace it with the saved ebp. | 373 // be. Replace it with the saved ebp. |
374 __ push(MemOperand(esp, 3 * kPointerSize)); | 374 __ push(MemOperand(esp, 3 * kPointerSize)); |
375 __ mov(MemOperand(esp, 4 * kPointerSize), ebp); | 375 __ mov(MemOperand(esp, 4 * kPointerSize), ebp); |
376 __ lea(ebp, MemOperand(esp, 4 * kPointerSize)); | 376 __ lea(ebp, MemOperand(esp, 4 * kPointerSize)); |
377 __ ret(0); // Call the continuation without clobbering registers. | 377 __ ret(0); // Call the continuation without clobbering registers. |
378 } | 378 } |
379 } else { | 379 } else { |
380 if (needs_frame_not_call.is_bound()) { | 380 if (needs_frame_not_call.is_bound()) { |
381 __ jmp(&needs_frame_not_call); | 381 __ jmp(&needs_frame_not_call); |
382 } else { | 382 } else { |
383 __ bind(&needs_frame_not_call); | 383 __ bind(&needs_frame_not_call); |
384 __ push(esi); | 384 __ push(MemOperand(ebp, StandardFrameConstants::kContextOffset)); |
385 // This variant of deopt can only be used with stubs. Since we don't | 385 // This variant of deopt can only be used with stubs. Since we don't |
386 // have a function pointer to install in the stack frame that we're | 386 // have a function pointer to install in the stack frame that we're |
387 // building, install a special marker there instead. | 387 // building, install a special marker there instead. |
388 ASSERT(info()->IsStub()); | 388 ASSERT(info()->IsStub()); |
389 __ push(Immediate(Smi::FromInt(StackFrame::STUB))); | 389 __ push(Immediate(Smi::FromInt(StackFrame::STUB))); |
390 // Push the continuation which was stashed were the ebp should | 390 // Push the continuation which was stashed were the ebp should |
391 // be. Replace it with the saved ebp. | 391 // be. Replace it with the saved ebp. |
392 __ push(MemOperand(esp, 2 * kPointerSize)); | 392 __ push(MemOperand(esp, 2 * kPointerSize)); |
393 __ mov(MemOperand(esp, 3 * kPointerSize), ebp); | 393 __ mov(MemOperand(esp, 3 * kPointerSize), ebp); |
394 __ lea(ebp, MemOperand(esp, 3 * kPointerSize)); | 394 __ lea(ebp, MemOperand(esp, 3 * kPointerSize)); |
(...skipping 5535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5930 FixedArray::kHeaderSize - kPointerSize)); | 5930 FixedArray::kHeaderSize - kPointerSize)); |
5931 __ bind(&done); | 5931 __ bind(&done); |
5932 } | 5932 } |
5933 | 5933 |
5934 | 5934 |
5935 #undef __ | 5935 #undef __ |
5936 | 5936 |
5937 } } // namespace v8::internal | 5937 } } // namespace v8::internal |
5938 | 5938 |
5939 #endif // V8_TARGET_ARCH_IA32 | 5939 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |