| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 function->ReplaceCode(function->shared()->code()); | 106 function->ReplaceCode(function->shared()->code()); |
| 107 | 107 |
| 108 if (FLAG_trace_deopt) { | 108 if (FLAG_trace_deopt) { |
| 109 PrintF("[forced deoptimization: "); | 109 PrintF("[forced deoptimization: "); |
| 110 function->PrintName(); | 110 function->PrintName(); |
| 111 PrintF(" / %x]\n", reinterpret_cast<uint32_t>(function)); | 111 PrintF(" / %x]\n", reinterpret_cast<uint32_t>(function)); |
| 112 } | 112 } |
| 113 } | 113 } |
| 114 | 114 |
| 115 | 115 |
| 116 void Deoptimizer::PatchStackCheckCode(RelocInfo* rinfo, | 116 void Deoptimizer::PatchStackCheckCode(Code* unoptimized_code, |
| 117 Code* check_code, |
| 117 Code* replacement_code) { | 118 Code* replacement_code) { |
| 118 UNIMPLEMENTED(); | 119 UNIMPLEMENTED(); |
| 119 } | 120 } |
| 120 | 121 |
| 121 | 122 |
| 122 void Deoptimizer::RevertStackCheckCode(RelocInfo* rinfo, Code* check_code) { | 123 void Deoptimizer::RevertStackCheckCode(Code* unoptimized_code, |
| 124 Code* check_code, |
| 125 Code* replacement_code) { |
| 123 UNIMPLEMENTED(); | 126 UNIMPLEMENTED(); |
| 124 } | 127 } |
| 125 | 128 |
| 126 | 129 |
| 127 void Deoptimizer::DoComputeOsrOutputFrame() { | 130 void Deoptimizer::DoComputeOsrOutputFrame() { |
| 128 UNIMPLEMENTED(); | 131 UNIMPLEMENTED(); |
| 129 } | 132 } |
| 130 | 133 |
| 131 | 134 |
| 132 // This code is very similar to ia32 code, but relies on register names (fp, sp) | 135 // This code is very similar to ia32 code, but relies on register names (fp, sp) |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 __ CallCFunction(ExternalReference::new_deoptimizer_function(), 5); | 366 __ CallCFunction(ExternalReference::new_deoptimizer_function(), 5); |
| 364 | 367 |
| 365 // Preserve "deoptimizer" object in register r0 and get the input | 368 // Preserve "deoptimizer" object in register r0 and get the input |
| 366 // frame descriptor pointer to r1 (deoptimizer->input_); | 369 // frame descriptor pointer to r1 (deoptimizer->input_); |
| 367 __ ldr(r1, MemOperand(r0, Deoptimizer::input_offset())); | 370 __ ldr(r1, MemOperand(r0, Deoptimizer::input_offset())); |
| 368 | 371 |
| 369 | 372 |
| 370 // Copy core registers into FrameDescription::registers_[kNumRegisters]. | 373 // Copy core registers into FrameDescription::registers_[kNumRegisters]. |
| 371 ASSERT(Register::kNumRegisters == kNumberOfRegisters); | 374 ASSERT(Register::kNumRegisters == kNumberOfRegisters); |
| 372 for (int i = 0; i < kNumberOfRegisters; i++) { | 375 for (int i = 0; i < kNumberOfRegisters; i++) { |
| 373 int offset = (i * kIntSize) + FrameDescription::registers_offset(); | 376 int offset = (i * kPointerSize) + FrameDescription::registers_offset(); |
| 374 __ ldr(r2, MemOperand(sp, i * kPointerSize)); | 377 __ ldr(r2, MemOperand(sp, i * kPointerSize)); |
| 375 __ str(r2, MemOperand(r1, offset)); | 378 __ str(r2, MemOperand(r1, offset)); |
| 376 } | 379 } |
| 377 | 380 |
| 378 // Copy VFP registers to | 381 // Copy VFP registers to |
| 379 // double_registers_[DoubleRegister::kNumAllocatableRegisters] | 382 // double_registers_[DoubleRegister::kNumAllocatableRegisters] |
| 380 int double_regs_offset = FrameDescription::double_registers_offset(); | 383 int double_regs_offset = FrameDescription::double_registers_offset(); |
| 381 for (int i = 0; i < DwVfpRegister::kNumAllocatableRegisters; ++i) { | 384 for (int i = 0; i < DwVfpRegister::kNumAllocatableRegisters; ++i) { |
| 382 int dst_offset = i * kDoubleSize + double_regs_offset; | 385 int dst_offset = i * kDoubleSize + double_regs_offset; |
| 383 int src_offset = i * kDoubleSize + kNumberOfRegisters * kPointerSize; | 386 int src_offset = i * kDoubleSize + kNumberOfRegisters * kPointerSize; |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 452 __ push(r6); | 455 __ push(r6); |
| 453 } | 456 } |
| 454 | 457 |
| 455 __ ldr(r6, MemOperand(r2, FrameDescription::pc_offset())); | 458 __ ldr(r6, MemOperand(r2, FrameDescription::pc_offset())); |
| 456 __ push(r6); | 459 __ push(r6); |
| 457 __ ldr(r6, MemOperand(r2, FrameDescription::continuation_offset())); | 460 __ ldr(r6, MemOperand(r2, FrameDescription::continuation_offset())); |
| 458 __ push(r6); | 461 __ push(r6); |
| 459 | 462 |
| 460 // Push the registers from the last output frame. | 463 // Push the registers from the last output frame. |
| 461 for (int i = kNumberOfRegisters - 1; i >= 0; i--) { | 464 for (int i = kNumberOfRegisters - 1; i >= 0; i--) { |
| 462 int offset = (i * kIntSize) + FrameDescription::registers_offset(); | 465 int offset = (i * kPointerSize) + FrameDescription::registers_offset(); |
| 463 __ ldr(r6, MemOperand(r2, offset)); | 466 __ ldr(r6, MemOperand(r2, offset)); |
| 464 __ push(r6); | 467 __ push(r6); |
| 465 } | 468 } |
| 466 | 469 |
| 467 // Restore the registers from the stack. | 470 // Restore the registers from the stack. |
| 468 __ ldm(ia_w, sp, restored_regs); // all but pc registers. | 471 __ ldm(ia_w, sp, restored_regs); // all but pc registers. |
| 469 __ pop(ip); // remove sp | 472 __ pop(ip); // remove sp |
| 470 __ pop(ip); // remove lr | 473 __ pop(ip); // remove lr |
| 471 | 474 |
| 472 // Set up the roots register. | 475 // Set up the roots register. |
| (...skipping 25 matching lines...) Expand all Loading... |
| 498 __ push(ip); | 501 __ push(ip); |
| 499 __ b(&done); | 502 __ b(&done); |
| 500 ASSERT(masm()->pc_offset() - start == table_entry_size_); | 503 ASSERT(masm()->pc_offset() - start == table_entry_size_); |
| 501 } | 504 } |
| 502 __ bind(&done); | 505 __ bind(&done); |
| 503 } | 506 } |
| 504 | 507 |
| 505 #undef __ | 508 #undef __ |
| 506 | 509 |
| 507 } } // namespace v8::internal | 510 } } // namespace v8::internal |
| OLD | NEW |