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

Unified Diff: src/compiler/code-generator.cc

Issue 573703002: Add handling for deopt and argument adaptor frames. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Minor improvements. Created 6 years, 3 months 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
Index: src/compiler/code-generator.cc
diff --git a/src/compiler/code-generator.cc b/src/compiler/code-generator.cc
index 574d1ae8e939cd3127c8563b90675dbf8d641e6f..f8815fdb2fc5d9abf00a16a26c404c0600da7d24 100644
--- a/src/compiler/code-generator.cc
+++ b/src/compiler/code-generator.cc
@@ -266,7 +266,7 @@ void CodeGenerator::AddSafepointAndDeopt(Instruction* instr) {
// Make sure all the values live in stack slots or they are immediates.
// (The values should not live in register because registers are clobbered
// by calls.)
- for (int i = 0; i < descriptor->size(); i++) {
+ for (size_t i = 0; i < descriptor->size(); i++) {
InstructionOperand* op = instr->InputAt(frame_state_offset + 1 + i);
CHECK(op->IsStackSlot() || op->IsImmediate());
}
@@ -301,26 +301,33 @@ void CodeGenerator::BuildTranslationForFrameStateDescriptor(
OutputFrameStateCombine state_combine) {
// Outer-most state must be added to translation first.
if (descriptor->outer_state() != NULL) {
- BuildTranslationForFrameStateDescriptor(
- descriptor->outer_state(), instr, translation,
- frame_state_offset + descriptor->size(), kIgnoreOutput);
+ BuildTranslationForFrameStateDescriptor(descriptor->outer_state(), instr,
+ translation, frame_state_offset,
+ kIgnoreOutput);
}
- int height = descriptor->size() - descriptor->parameters_count();
- switch (state_combine) {
- case kPushOutput:
- height++;
+ int id = Translation::kSelfLiteralId;
+ if (!descriptor->jsfunction().IsNull()) {
+ id = DefineDeoptimizationLiteral(
+ Handle<Object>::cast(descriptor->jsfunction().handle()));
+ }
+
+ switch (descriptor->type()) {
+ case JS_FRAME:
+ translation->BeginJSFrame(descriptor->bailout_id(), id,
+ descriptor->GetHeight(state_combine));
break;
- case kIgnoreOutput:
+ case ARGUMENTS_ADAPTOR:
+ translation->BeginArgumentsAdaptorFrame(id,
+ descriptor->parameters_count());
break;
}
- translation->BeginJSFrame(descriptor->bailout_id(),
- Translation::kSelfLiteralId, height);
-
- for (int i = 0; i < descriptor->size(); i++) {
- AddTranslationForOperand(translation, instr,
- instr->InputAt(i + frame_state_offset));
+ for (size_t i = 0; i < descriptor->size(); i++) {
+ AddTranslationForOperand(
+ translation, instr,
+ instr->InputAt(frame_state_offset +
+ descriptor->outer_state()->GetTotalSize() + i));
Jarin 2014/09/15 13:37:51 How about adding descriptor->outer_state()->GetTot
sigurds 2014/09/16 08:39:03 Done.
}
switch (state_combine) {
@@ -341,8 +348,8 @@ int CodeGenerator::BuildTranslation(Instruction* instr, int pc_offset,
GetFrameStateDescriptor(instr, frame_state_offset);
frame_state_offset++;
- int frame_count = descriptor->GetFrameCount();
- Translation translation(&translations_, frame_count, frame_count, zone());
+ Translation translation(&translations_, descriptor->GetFrameCount(),
+ descriptor->GetJSFrameCount(), zone());
BuildTranslationForFrameStateDescriptor(descriptor, instr, &translation,
frame_state_offset, state_combine);

Powered by Google App Engine
This is Rietveld 408576698