Index: src/full-codegen.cc |
diff --git a/src/full-codegen.cc b/src/full-codegen.cc |
index e14afefda4547a722d4185f496173ccd9e684e1a..0f1536f456bdf3d2306614cfadc6eb4fbcd98a1e 100644 |
--- a/src/full-codegen.cc |
+++ b/src/full-codegen.cc |
@@ -345,7 +345,6 @@ bool FullCodeGenerator::MakeCode(CompilationInfo* info) { |
info->function()->scope()->AllowsLazyCompilation()); |
cgen.PopulateDeoptimizationData(code); |
cgen.PopulateTypeFeedbackInfo(code); |
- cgen.PopulateTypeFeedbackCells(code); |
code->set_has_deoptimization_support(info->HasDeoptimizationSupport()); |
code->set_handler_table(*cgen.handler_table()); |
#ifdef ENABLE_DEBUGGER_SUPPORT |
@@ -387,6 +386,15 @@ unsigned FullCodeGenerator::EmitBackEdgeTable() { |
} |
+void FullCodeGenerator::InitializeFeedbackVector() { |
+ int length = info_->function()->slot_count(); |
+ ASSERT_EQ(isolate()->heap()->the_hole_value(), |
+ *TypeFeedbackInfo::UninitializedSentinel(isolate())); |
+ feedback_vector_ = isolate()->factory()->NewFixedArrayWithHoles(length, |
+ TENURED); |
+} |
+ |
+ |
void FullCodeGenerator::PopulateDeoptimizationData(Handle<Code> code) { |
// Fill in the deoptimization information. |
ASSERT(info_->HasDeoptimizationSupport() || bailout_entries_.is_empty()); |
@@ -405,6 +413,7 @@ void FullCodeGenerator::PopulateDeoptimizationData(Handle<Code> code) { |
void FullCodeGenerator::PopulateTypeFeedbackInfo(Handle<Code> code) { |
Handle<TypeFeedbackInfo> info = isolate()->factory()->NewTypeFeedbackInfo(); |
info->set_ic_total_count(ic_total_count_); |
+ info->set_feedback_vector(*FeedbackVector()); |
ASSERT(!isolate()->heap()->InNewSpace(*info)); |
code->set_type_feedback_info(*info); |
} |
@@ -425,21 +434,6 @@ void FullCodeGenerator::Initialize() { |
} |
-void FullCodeGenerator::PopulateTypeFeedbackCells(Handle<Code> code) { |
- if (type_feedback_cells_.is_empty()) return; |
- int length = type_feedback_cells_.length(); |
- int array_size = TypeFeedbackCells::LengthOfFixedArray(length); |
- Handle<TypeFeedbackCells> cache = Handle<TypeFeedbackCells>::cast( |
- isolate()->factory()->NewFixedArray(array_size, TENURED)); |
- for (int i = 0; i < length; i++) { |
- cache->SetAstId(i, type_feedback_cells_[i].ast_id); |
- cache->SetCell(i, *type_feedback_cells_[i].cell); |
- } |
- TypeFeedbackInfo::cast(code->type_feedback_info())->set_type_feedback_cells( |
- *cache); |
-} |
- |
- |
void FullCodeGenerator::PrepareForBailout(Expression* node, State state) { |
PrepareForBailoutForId(node->id(), state); |
} |
@@ -490,13 +484,6 @@ void FullCodeGenerator::PrepareForBailoutForId(BailoutId id, State state) { |
} |
-void FullCodeGenerator::RecordTypeFeedbackCell( |
- TypeFeedbackId id, Handle<Cell> cell) { |
- TypeFeedbackCellEntry entry = { id, cell }; |
- type_feedback_cells_.Add(entry, zone()); |
-} |
- |
- |
void FullCodeGenerator::RecordBackEdge(BailoutId ast_id) { |
// The pc offset does not need to be encoded and packed together with a state. |
ASSERT(masm_->pc_offset() > 0); |