Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(466)

Unified Diff: src/ia32/deoptimizer-ia32.cc

Issue 11635015: Generalize calling to C++ on stub deopt (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fixes Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ia32/code-stubs-ia32.cc ('k') | src/ic.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ia32/deoptimizer-ia32.cc
diff --git a/src/ia32/deoptimizer-ia32.cc b/src/ia32/deoptimizer-ia32.cc
index 3233c27c3ac02dd22ac434609ac0fafd6e3e9b91..2d7e4d8576d1c61106795ee39566acb64883609d 100644
--- a/src/ia32/deoptimizer-ia32.cc
+++ b/src/ia32/deoptimizer-ia32.cc
@@ -565,35 +565,39 @@ void Deoptimizer::DoCompiledStubFrame(TranslationIterator* iterator,
// FROM TO <-ebp
// | .... | | .... |
// +-------------------------+ +-------------------------+
- // | JSFunction continuation | | JSFunction continuation |
+ // | JSFunction continuation | | parameter 1 |
+ // +-------------------------+ +-------------------------+
+ // | | saved frame (ebp) | | .... |
+ // | +=========================+<-ebp +-------------------------+
+ // | | JSFunction context | | parameter n |
+ // v +-------------------------+ +-------------------------|
+ // | COMPILED_STUB marker | | JSFunction continuation |
// +-------------------------+ +-------------------------+<-esp
- // | | saved frame (ebp) |
- // | +=========================+<-ebp
- // | | JSFunction context |
- // v +-------------------------+
- // | COMPILED_STUB marker | ebp = saved frame
- // +-------------------------+ esi = JSFunction context
- // | |
- // | ... |
- // | |
- // +-------------------------+<-esp
+ // | | eax = number of parameters
+ // | ... | ebx = failure handler address
+ // | | ebp = saved frame
+ // +-------------------------+<-esp esi = JSFunction context
//
//
- int output_frame_size = 1 * kPointerSize;
- FrameDescription* output_frame =
- new(output_frame_size) FrameDescription(output_frame_size, 0);
- Code* notify_miss =
- isolate_->builtins()->builtin(Builtins::kNotifyICMiss);
- output_frame->SetState(Smi::FromInt(FullCodeGenerator::NO_REGISTERS));
- output_frame->SetContinuation(
- reinterpret_cast<uint32_t>(notify_miss->entry()));
ASSERT(compiled_code_->kind() == Code::COMPILED_STUB);
int major_key = compiled_code_->major_key();
CodeStubInterfaceDescriptor* descriptor =
isolate_->code_stub_interface_descriptor(major_key);
- Handle<Code> miss_ic(descriptor->deoptimization_handler_);
- output_frame->SetPc(reinterpret_cast<intptr_t>(miss_ic->instruction_start()));
+
+ int output_frame_size =
+ (1 + descriptor->register_param_count_) * kPointerSize;
+ FrameDescription* output_frame =
+ new(output_frame_size) FrameDescription(output_frame_size, 0);
+ Code* notify_failure =
+ isolate_->builtins()->builtin(Builtins::kNotifyStubFailure);
+ output_frame->SetState(Smi::FromInt(FullCodeGenerator::NO_REGISTERS));
+ output_frame->SetContinuation(
+ reinterpret_cast<uint32_t>(notify_failure->entry()));
+
+ Code* code;
+ CEntryStub(1, kSaveFPRegs).FindCodeInCache(&code, isolate_);
+ output_frame->SetPc(reinterpret_cast<intptr_t>(code->instruction_start()));
unsigned input_frame_size = input_->GetFrameSize();
intptr_t value = input_->GetFrameSlot(input_frame_size - kPointerSize);
output_frame->SetFrameSlot(0, value);
@@ -603,20 +607,22 @@ void Deoptimizer::DoCompiledStubFrame(TranslationIterator* iterator,
value = input_->GetFrameSlot(input_frame_size - 3 * kPointerSize);
output_frame->SetRegister(esi.code(), value);
- Translation::Opcode opcode =
- static_cast<Translation::Opcode>(iterator->Next());
- ASSERT(opcode == Translation::REGISTER);
- USE(opcode);
- int input_reg = iterator->Next();
- intptr_t input_value = input_->GetRegister(input_reg);
- output_frame->SetRegister(edx.code(), input_value);
-
- int32_t next = iterator->Next();
- opcode = static_cast<Translation::Opcode>(next);
- ASSERT(opcode == Translation::REGISTER);
- input_reg = iterator->Next();
- input_value = input_->GetRegister(input_reg);
- output_frame->SetRegister(ecx.code(), input_value);
+ int parameter_offset = kPointerSize * descriptor->register_param_count_;
+ for (int i = 0; i < descriptor->register_param_count_; ++i) {
+ Translation::Opcode opcode =
+ static_cast<Translation::Opcode>(iterator->Next());
+ ASSERT(opcode == Translation::REGISTER);
+ USE(opcode);
+ int input_reg = iterator->Next();
+ intptr_t reg_value = input_->GetRegister(input_reg);
+ output_frame->SetFrameSlot(parameter_offset, reg_value);
+ parameter_offset -= kPointerSize;
+ }
+
+ intptr_t handler =
+ reinterpret_cast<intptr_t>(descriptor->deoptimization_handler_);
+ output_frame->SetRegister(eax.code(), descriptor->register_param_count_);
+ output_frame->SetRegister(ebx.code(), handler);
ASSERT(frame_index == 0);
output_[frame_index] = output_frame;
« no previous file with comments | « src/ia32/code-stubs-ia32.cc ('k') | src/ic.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698