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

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

Issue 1156403002: [turbofan] Record SharedFunctionInfo of inlined functions. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 7 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/compiler/code-generator.h ('k') | src/compiler/common-operator.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 16bf92c3639a45c8f9593dfe5affcfd58d0cbd4c..fd7b061e2c87d4cec09495b22b5610dce14b8771 100644
--- a/src/compiler/code-generator.cc
+++ b/src/compiler/code-generator.cc
@@ -45,6 +45,7 @@ CodeGenerator::CodeGenerator(Frame* frame, Linkage* linkage,
handlers_(code->zone()),
deoptimization_states_(code->zone()),
deoptimization_literals_(code->zone()),
+ inlined_function_count_(0),
translations_(code->zone()),
last_lazy_deopt_pc_(0),
jump_tables_(nullptr),
@@ -73,6 +74,17 @@ Handle<Code> CodeGenerator::GenerateCode() {
info->set_prologue_offset(masm()->pc_offset());
AssemblePrologue();
+ // Define deoptimization literals for all inlined functions.
+ DCHECK_EQ(0u, deoptimization_literals_.size());
+ for (auto frame_state_descriptor : code()->frame_state_descriptors()) {
+ Handle<SharedFunctionInfo> shared_info;
+ if (frame_state_descriptor->shared_info().ToHandle(&shared_info) &&
+ !shared_info.is_identical_to(info->shared_info())) {
+ DefineDeoptimizationLiteral(shared_info);
+ }
+ }
+ inlined_function_count_ = deoptimization_literals_.size();
+
// Assemble all non-deferred blocks, followed by deferred ones.
for (int deferred = 0; deferred < 2; ++deferred) {
for (auto const block : code()->instruction_blocks()) {
@@ -302,7 +314,8 @@ void CodeGenerator::PopulateDeoptimizationData(Handle<Code> code_object) {
translations_.CreateByteArray(isolate()->factory());
data->SetTranslationByteArray(*translation_array);
- data->SetInlinedFunctionCount(Smi::FromInt(0));
+ data->SetInlinedFunctionCount(
+ Smi::FromInt(static_cast<int>(inlined_function_count_)));
data->SetOptimizationId(Smi::FromInt(info->optimization_id()));
// TODO(jarin) The following code was copied over from Lithium, not sure
// whether the scope or the IsOptimizing condition are really needed.
« no previous file with comments | « src/compiler/code-generator.h ('k') | src/compiler/common-operator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698