Chromium Code Reviews

Unified Diff: src/full-codegen.cc

Issue 650073002: vector-based ICs did not update type feedback counts correctly. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Ports. Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Index: src/full-codegen.cc
diff --git a/src/full-codegen.cc b/src/full-codegen.cc
index 61a6eac6349a73896b88b5676b8660552affb151..bf41935dc8e3e8bd90ea591e304acbcd3458b322 100644
--- a/src/full-codegen.cc
+++ b/src/full-codegen.cc
@@ -333,7 +333,7 @@ bool FullCodeGenerator::MakeCode(CompilationInfo* info) {
!info->function()->dont_optimize() &&
info->function()->scope()->AllowsLazyCompilation());
cgen.PopulateDeoptimizationData(code);
- cgen.PopulateTypeFeedbackInfo(code);
+ cgen.PopulateTypeFeedbackInfo(code, info->feedback_vector());
code->set_has_deoptimization_support(info->HasDeoptimizationSupport());
code->set_handler_table(*cgen.handler_table());
code->set_compiled_optimizable(info->IsOptimizable());
@@ -367,11 +367,22 @@ unsigned FullCodeGenerator::EmitBackEdgeTable() {
void FullCodeGenerator::EnsureSlotContainsAllocationSite(
FeedbackVectorSlot slot) {
- Handle<FixedArray> vector = FeedbackVector();
- if (!vector->get(slot.ToInt())->IsAllocationSite()) {
+ Handle<TypeFeedbackVector> vector = FeedbackVector();
+ if (!vector->Get(slot)->IsAllocationSite()) {
Handle<AllocationSite> allocation_site =
isolate()->factory()->NewAllocationSite();
- vector->set(slot.ToInt(), *allocation_site);
+ vector->Set(slot, *allocation_site);
+ }
+}
+
+
+void FullCodeGenerator::EnsureSlotContainsAllocationSite(
+ FeedbackVectorICSlot slot) {
+ Handle<TypeFeedbackVector> vector = FeedbackVector();
+ if (!vector->Get(slot)->IsAllocationSite()) {
+ Handle<AllocationSite> allocation_site =
+ isolate()->factory()->NewAllocationSite();
+ vector->Set(slot, *allocation_site);
}
}
@@ -391,8 +402,10 @@ void FullCodeGenerator::PopulateDeoptimizationData(Handle<Code> code) {
}
-void FullCodeGenerator::PopulateTypeFeedbackInfo(Handle<Code> code) {
- Handle<TypeFeedbackInfo> info = isolate()->factory()->NewTypeFeedbackInfo();
+void FullCodeGenerator::PopulateTypeFeedbackInfo(
+ Handle<Code> code, Handle<TypeFeedbackVector> vector) {
+ Handle<TypeFeedbackInfo> info =
+ isolate()->factory()->NewTypeFeedbackInfo(vector);
info->set_ic_total_count(ic_total_count_);
DCHECK(!isolate()->heap()->InNewSpace(*info));
code->set_type_feedback_info(*info);
« no previous file with comments | « src/full-codegen.h ('k') | src/heap/objects-visiting-inl.h » ('j') | src/ic/ic.cc » ('J')

Powered by Google App Engine