Chromium Code Reviews| 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 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 458 // TODO(1588) Note that using pc with stm is deprecated, so we should perhaps | 458 // TODO(1588) Note that using pc with stm is deprecated, so we should perhaps |
| 459 // handle this a bit differently. | 459 // handle this a bit differently. |
| 460 __ stm(db_w, sp, restored_regs | sp.bit() | lr.bit() | pc.bit()); | 460 __ stm(db_w, sp, restored_regs | sp.bit() | lr.bit() | pc.bit()); |
| 461 | 461 |
| 462 const int kSavedRegistersAreaSize = | 462 const int kSavedRegistersAreaSize = |
| 463 (kNumberOfRegisters * kPointerSize) + kDoubleRegsSize; | 463 (kNumberOfRegisters * kPointerSize) + kDoubleRegsSize; |
| 464 | 464 |
| 465 // Get the bailout id from the stack. | 465 // Get the bailout id from the stack. |
| 466 __ ldr(r2, MemOperand(sp, kSavedRegistersAreaSize)); | 466 __ ldr(r2, MemOperand(sp, kSavedRegistersAreaSize)); |
| 467 | 467 |
| 468 // Get the address of the location in the code object if possible (r3) (return | 468 // Get the address of the location in the code object (r3) (return |
| 469 // address for lazy deoptimization) and compute the fp-to-sp delta in | 469 // address for lazy deoptimization) and compute the fp-to-sp delta in |
| 470 // register r4. | 470 // register r4. |
| 471 if (type() == EAGER || type() == SOFT) { | 471 if (type() == EAGER || type() == SOFT || type() == OSR) { |
| 472 __ mov(r3, Operand::Zero()); | |
| 473 // Correct one word for bailout id. | |
| 474 __ add(r4, sp, Operand(kSavedRegistersAreaSize + (1 * kPointerSize))); | |
| 475 } else if (type() == OSR) { | |
| 476 __ mov(r3, lr); | 472 __ mov(r3, lr); |
| 477 // Correct one word for bailout id. | 473 // Correct one word for bailout id. |
| 478 __ add(r4, sp, Operand(kSavedRegistersAreaSize + (1 * kPointerSize))); | 474 __ add(r4, sp, Operand(kSavedRegistersAreaSize + (1 * kPointerSize))); |
| 479 } else { | 475 } else { |
| 480 __ mov(r3, lr); | 476 __ mov(r3, lr); |
| 481 // Correct two words for bailout id and return address. | 477 // Correct two words for bailout id and return address. |
| 482 __ add(r4, sp, Operand(kSavedRegistersAreaSize + (2 * kPointerSize))); | 478 __ add(r4, sp, Operand(kSavedRegistersAreaSize + (2 * kPointerSize))); |
|
danno
2013/07/10 10:04:30
Why is LAZY handled differently? Shouldn't all fou
titzer
2013/07/11 09:43:43
There was one remaining case, in the deoptimizatio
| |
| 483 } | 479 } |
| 484 __ sub(r4, fp, r4); | 480 __ sub(r4, fp, r4); |
| 485 | 481 |
| 486 // Allocate a new deoptimizer object. | 482 // Allocate a new deoptimizer object. |
| 487 // Pass four arguments in r0 to r3 and fifth argument on stack. | 483 // Pass four arguments in r0 to r3 and fifth argument on stack. |
| 488 __ PrepareCallCFunction(6, r5); | 484 __ PrepareCallCFunction(6, r5); |
| 489 __ ldr(r0, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | 485 __ ldr(r0, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
| 490 __ mov(r1, Operand(type())); // bailout type, | 486 __ mov(r1, Operand(type())); // bailout type, |
| 491 // r2: bailout id already loaded. | 487 // r2: bailout id already loaded. |
| 492 // r3: code address or 0 already loaded. | 488 // r3: code address or 0 already loaded. |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 652 __ push(ip); | 648 __ push(ip); |
| 653 __ b(&done); | 649 __ b(&done); |
| 654 ASSERT(masm()->pc_offset() - start == table_entry_size_); | 650 ASSERT(masm()->pc_offset() - start == table_entry_size_); |
| 655 } | 651 } |
| 656 __ bind(&done); | 652 __ bind(&done); |
| 657 } | 653 } |
| 658 | 654 |
| 659 #undef __ | 655 #undef __ |
| 660 | 656 |
| 661 } } // namespace v8::internal | 657 } } // namespace v8::internal |
| OLD | NEW |