| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 #include "src/codegen.h" | 5 #include "src/codegen.h" |
| 6 #include "src/deoptimizer.h" | 6 #include "src/deoptimizer.h" |
| 7 #include "src/full-codegen/full-codegen.h" | 7 #include "src/full-codegen/full-codegen.h" |
| 8 #include "src/register-configuration.h" | 8 #include "src/register-configuration.h" |
| 9 #include "src/safepoint-table.h" | 9 #include "src/safepoint-table.h" |
| 10 | 10 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 call_address >= prev_call_address + patch_size()); | 73 call_address >= prev_call_address + patch_size()); |
| 74 DCHECK(call_address + patch_size() <= code->instruction_end()); | 74 DCHECK(call_address + patch_size() <= code->instruction_end()); |
| 75 | 75 |
| 76 #ifdef DEBUG | 76 #ifdef DEBUG |
| 77 prev_call_address = call_address; | 77 prev_call_address = call_address; |
| 78 #endif | 78 #endif |
| 79 } | 79 } |
| 80 } | 80 } |
| 81 | 81 |
| 82 | 82 |
| 83 void Deoptimizer::FillInputFrame(Address tos, JavaScriptFrame* frame) { | |
| 84 // Set the register values. The values are not important as there are no | |
| 85 // callee saved registers in JavaScript frames, so all registers are | |
| 86 // spilled. Registers fp and sp are set to the correct values though. | |
| 87 | |
| 88 for (int i = 0; i < Register::kNumRegisters; i++) { | |
| 89 input_->SetRegister(i, i * 4); | |
| 90 } | |
| 91 input_->SetRegister(sp.code(), reinterpret_cast<intptr_t>(frame->sp())); | |
| 92 input_->SetRegister(fp.code(), reinterpret_cast<intptr_t>(frame->fp())); | |
| 93 for (int i = 0; i < DoubleRegister::kMaxNumRegisters; i++) { | |
| 94 input_->SetDoubleRegister(i, 0.0); | |
| 95 } | |
| 96 | |
| 97 // Fill the frame content from the actual data on the frame. | |
| 98 for (unsigned i = 0; i < input_->GetFrameSize(); i += kPointerSize) { | |
| 99 input_->SetFrameSlot(i, Memory::uint32_at(tos + i)); | |
| 100 } | |
| 101 } | |
| 102 | |
| 103 | |
| 104 void Deoptimizer::SetPlatformCompiledStubRegisters( | 83 void Deoptimizer::SetPlatformCompiledStubRegisters( |
| 105 FrameDescription* output_frame, CodeStubDescriptor* descriptor) { | 84 FrameDescription* output_frame, CodeStubDescriptor* descriptor) { |
| 106 ApiFunction function(descriptor->deoptimization_handler()); | 85 ApiFunction function(descriptor->deoptimization_handler()); |
| 107 ExternalReference xref(&function, ExternalReference::BUILTIN_CALL, isolate_); | 86 ExternalReference xref(&function, ExternalReference::BUILTIN_CALL, isolate_); |
| 108 intptr_t handler = reinterpret_cast<intptr_t>(xref.address()); | 87 intptr_t handler = reinterpret_cast<intptr_t>(xref.address()); |
| 109 int params = descriptor->GetHandlerParameterCount(); | 88 int params = descriptor->GetHandlerParameterCount(); |
| 110 output_frame->SetRegister(a0.code(), params); | 89 output_frame->SetRegister(a0.code(), params); |
| 111 output_frame->SetRegister(a1.code(), handler); | 90 output_frame->SetRegister(a1.code(), handler); |
| 112 } | 91 } |
| 113 | 92 |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 403 // No embedded constant pool support. | 382 // No embedded constant pool support. |
| 404 UNREACHABLE(); | 383 UNREACHABLE(); |
| 405 } | 384 } |
| 406 | 385 |
| 407 | 386 |
| 408 #undef __ | 387 #undef __ |
| 409 | 388 |
| 410 | 389 |
| 411 } // namespace internal | 390 } // namespace internal |
| 412 } // namespace v8 | 391 } // namespace v8 |
| OLD | NEW |