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

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

Issue 1169103004: [deoptimizer] Basic support inlining based on SharedFunctionInfo. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix Jaros comment. Created 5 years, 6 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
« no previous file with comments | « src/arm64/lithium-codegen-arm64.cc ('k') | src/compiler/js-inlining.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/code-generator.cc
diff --git a/src/compiler/code-generator.cc b/src/compiler/code-generator.cc
index 752b3eaa55fa9419726624b32b98647c526da740..6be3f14f386333b58a58af85e6867cb2d74aa594 100644
--- a/src/compiler/code-generator.cc
+++ b/src/compiler/code-generator.cc
@@ -498,28 +498,27 @@ void CodeGenerator::BuildTranslationForFrameStateDescriptor(
}
frame_state_offset += descriptor->outer_state()->GetTotalSize();
- // TODO(bmeurer): Fix this special case here.
- int id = Translation::kSelfLiteralId;
- if (descriptor->outer_state() != nullptr) {
- InstructionOperandConverter converter(this, instr);
- Handle<HeapObject> function(converter.InputHeapObject(frame_state_offset));
- id = DefineDeoptimizationLiteral(function);
+ Handle<SharedFunctionInfo> shared_info;
+ if (!descriptor->shared_info().ToHandle(&shared_info)) {
+ shared_info = info()->shared_info();
}
+ int shared_info_id = DefineDeoptimizationLiteral(shared_info);
switch (descriptor->type()) {
case JS_FRAME:
translation->BeginJSFrame(
- descriptor->bailout_id(), id,
+ descriptor->bailout_id(), shared_info_id,
static_cast<unsigned int>(descriptor->GetSize(state_combine) -
(1 + descriptor->parameters_count())));
break;
case ARGUMENTS_ADAPTOR:
translation->BeginArgumentsAdaptorFrame(
- id, static_cast<unsigned int>(descriptor->parameters_count()));
+ shared_info_id,
+ static_cast<unsigned int>(descriptor->parameters_count()));
break;
}
- for (size_t i = 1; i < descriptor->GetSize(state_combine); i++) {
+ for (size_t i = 0; i < descriptor->GetSize(state_combine); i++) {
OperandAndType op = TypedOperandForFrameState(
descriptor, instr, frame_state_offset, i, state_combine);
AddTranslationForOperand(translation, instr, op.operand, op.type);
@@ -609,8 +608,12 @@ void CodeGenerator::AddTranslationForOperand(Translation* translation,
default:
CHECK(false);
}
- int literal_id = DefineDeoptimizationLiteral(constant_object);
- translation->StoreLiteral(literal_id);
+ if (constant_object.is_identical_to(info()->closure())) {
+ translation->StoreJSFrameFunction();
+ } else {
+ int literal_id = DefineDeoptimizationLiteral(constant_object);
+ translation->StoreLiteral(literal_id);
+ }
} else {
CHECK(false);
}
« no previous file with comments | « src/arm64/lithium-codegen-arm64.cc ('k') | src/compiler/js-inlining.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698