Index: src/ia32/full-codegen-ia32.cc |
diff --git a/src/ia32/full-codegen-ia32.cc b/src/ia32/full-codegen-ia32.cc |
index f3125666f829fb291e371059118041518446656f..b9e4d4bbb591b71efd37e7a05b312fc5258b94af 100644 |
--- a/src/ia32/full-codegen-ia32.cc |
+++ b/src/ia32/full-codegen-ia32.cc |
@@ -118,6 +118,9 @@ void FullCodeGenerator::Generate() { |
CompilationInfo* info = info_; |
handler_table_ = |
isolate()->factory()->NewFixedArray(function()->handler_count(), TENURED); |
+ |
+ InitializeFeedbackVector(); |
+ |
profiling_counter_ = isolate()->factory()->NewCell( |
Handle<Smi>(Smi::FromInt(FLAG_interrupt_budget), isolate())); |
SetFunctionPosition(function()); |
@@ -1021,6 +1024,8 @@ void FullCodeGenerator::VisitSwitchStatement(SwitchStatement* stmt) { |
void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) { |
Comment cmnt(masm_, "[ ForInStatement"); |
+ int slot = stmt->ForInFeedbackSlot(); |
+ |
SetStatementPosition(stmt); |
Label loop, exit; |
@@ -1099,13 +1104,15 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) { |
Label non_proxy; |
__ bind(&fixed_array); |
- Handle<Cell> cell = isolate()->factory()->NewCell( |
- Handle<Object>(Smi::FromInt(TypeFeedbackCells::kForInFastCaseMarker), |
- isolate())); |
- RecordTypeFeedbackCell(stmt->ForInFeedbackId(), cell); |
- __ LoadHeapObject(ebx, cell); |
- __ mov(FieldOperand(ebx, Cell::kValueOffset), |
- Immediate(Smi::FromInt(TypeFeedbackCells::kForInSlowCaseMarker))); |
+ Handle<Object> feedback = Handle<Object>( |
+ Smi::FromInt(TypeFeedbackInfo::kForInFastCaseMarker), |
+ isolate()); |
+ StoreFeedbackVectorSlot(slot, feedback); |
+ |
+ // No need for a write barrier, we are storing a Smi in the feedback vector. |
+ __ LoadHeapObject(ebx, FeedbackVector()); |
+ __ mov(FieldOperand(ebx, FixedArray::OffsetOfElementAt(slot)), |
+ Immediate(Smi::FromInt(TypeFeedbackInfo::kForInSlowCaseMarker))); |
__ mov(ebx, Immediate(Smi::FromInt(1))); // Smi indicates slow check |
__ mov(ecx, Operand(esp, 0 * kPointerSize)); // Get enumerated object |
@@ -2668,15 +2675,15 @@ void FullCodeGenerator::EmitCallWithStub(Call* expr) { |
SetSourcePosition(expr->position()); |
Handle<Object> uninitialized = |
- TypeFeedbackCells::UninitializedSentinel(isolate()); |
- Handle<Cell> cell = isolate()->factory()->NewCell(uninitialized); |
- RecordTypeFeedbackCell(expr->CallFeedbackId(), cell); |
- __ mov(ebx, cell); |
+ TypeFeedbackInfo::UninitializedSentinel(isolate()); |
+ StoreFeedbackVectorSlot(expr->CallFeedbackSlot(), uninitialized); |
+ __ LoadHeapObject(ebx, FeedbackVector()); |
+ __ mov(edx, Immediate(Smi::FromInt(expr->CallFeedbackSlot()))); |
// Record call targets in unoptimized code. |
CallFunctionStub stub(arg_count, RECORD_CALL_TARGET); |
__ mov(edi, Operand(esp, (arg_count + 1) * kPointerSize)); |
- __ CallStub(&stub, expr->CallFeedbackId()); |
+ __ CallStub(&stub); |
RecordJSReturnSite(expr); |
// Restore context register. |
@@ -2848,10 +2855,10 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) { |
// Record call targets in unoptimized code. |
Handle<Object> uninitialized = |
- TypeFeedbackCells::UninitializedSentinel(isolate()); |
- Handle<Cell> cell = isolate()->factory()->NewCell(uninitialized); |
- RecordTypeFeedbackCell(expr->CallNewFeedbackId(), cell); |
- __ mov(ebx, cell); |
+ TypeFeedbackInfo::UninitializedSentinel(isolate()); |
+ StoreFeedbackVectorSlot(expr->CallNewFeedbackSlot(), uninitialized); |
+ __ LoadHeapObject(ebx, FeedbackVector()); |
+ __ mov(edx, Immediate(Smi::FromInt(expr->CallNewFeedbackSlot()))); |
CallConstructStub stub(RECORD_CALL_TARGET); |
__ call(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL); |