| Index: src/compiler/code-generator.cc
|
| diff --git a/src/compiler/code-generator.cc b/src/compiler/code-generator.cc
|
| index 574d1ae8e939cd3127c8563b90675dbf8d641e6f..9c955a9ee1d4426b712d76355277fcb48bc62780 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,32 @@ 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++) {
|
| + frame_state_offset += descriptor->outer_state()->GetTotalSize();
|
| + for (size_t i = 0; i < descriptor->size(); i++) {
|
| AddTranslationForOperand(translation, instr,
|
| - instr->InputAt(i + frame_state_offset));
|
| + instr->InputAt(frame_state_offset + i));
|
| }
|
|
|
| switch (state_combine) {
|
| @@ -341,8 +347,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);
|
|
|
|
|