| Index: src/ia32/full-codegen-ia32.cc
|
| diff --git a/src/ia32/full-codegen-ia32.cc b/src/ia32/full-codegen-ia32.cc
|
| index ec6ad32dc0eb11128755db7c333094611f985dfe..17fef564badea41c2377a6b07d15a06786762bdc 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
|
| @@ -2628,10 +2635,10 @@ 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);
|
| @@ -2812,10 +2819,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);
|
|
|