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

Side by Side Diff: src/ia32/full-codegen-ia32.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. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_IA32 7 #if V8_TARGET_ARCH_IA32
8 8
9 #include "src/code-factory.h" 9 #include "src/code-factory.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 1099 matching lines...) Expand 10 before | Expand all | Expand 10 after
1110 __ bind(&no_descriptors); 1110 __ bind(&no_descriptors);
1111 __ add(esp, Immediate(kPointerSize)); 1111 __ add(esp, Immediate(kPointerSize));
1112 __ jmp(&exit); 1112 __ jmp(&exit);
1113 1113
1114 // We got a fixed array in register eax. Iterate through that. 1114 // We got a fixed array in register eax. Iterate through that.
1115 Label non_proxy; 1115 Label non_proxy;
1116 __ bind(&fixed_array); 1116 __ bind(&fixed_array);
1117 1117
1118 // No need for a write barrier, we are storing a Smi in the feedback vector. 1118 // No need for a write barrier, we are storing a Smi in the feedback vector.
1119 __ LoadHeapObject(ebx, FeedbackVector()); 1119 __ LoadHeapObject(ebx, FeedbackVector());
1120 __ mov(FieldOperand(ebx, FixedArray::OffsetOfElementAt(slot.ToInt())), 1120 int vector_index = FeedbackVector()->GetIndex(slot);
1121 __ mov(FieldOperand(ebx, FixedArray::OffsetOfElementAt(vector_index)),
1121 Immediate(TypeFeedbackVector::MegamorphicSentinel(isolate()))); 1122 Immediate(TypeFeedbackVector::MegamorphicSentinel(isolate())));
1122 1123
1123 __ mov(ebx, Immediate(Smi::FromInt(1))); // Smi indicates slow check 1124 __ mov(ebx, Immediate(Smi::FromInt(1))); // Smi indicates slow check
1124 __ mov(ecx, Operand(esp, 0 * kPointerSize)); // Get enumerated object 1125 __ mov(ecx, Operand(esp, 0 * kPointerSize)); // Get enumerated object
1125 STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_SPEC_OBJECT_TYPE); 1126 STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_SPEC_OBJECT_TYPE);
1126 __ CmpObjectType(ecx, LAST_JS_PROXY_TYPE, ecx); 1127 __ CmpObjectType(ecx, LAST_JS_PROXY_TYPE, ecx);
1127 __ j(above, &non_proxy); 1128 __ j(above, &non_proxy);
1128 __ Move(ebx, Immediate(Smi::FromInt(0))); // Zero indicates proxy 1129 __ Move(ebx, Immediate(Smi::FromInt(0))); // Zero indicates proxy
1129 __ bind(&non_proxy); 1130 __ bind(&non_proxy);
1130 __ push(ebx); // Smi 1131 __ push(ebx); // Smi
(...skipping 1664 matching lines...) Expand 10 before | Expand all | Expand 10 after
2795 VisitForStackValue(args->at(i)); 2796 VisitForStackValue(args->at(i));
2796 } 2797 }
2797 } 2798 }
2798 2799
2799 // Record source position of the IC call. 2800 // Record source position of the IC call.
2800 SetSourcePosition(expr->position()); 2801 SetSourcePosition(expr->position());
2801 Handle<Code> ic = CallIC::initialize_stub( 2802 Handle<Code> ic = CallIC::initialize_stub(
2802 isolate(), arg_count, call_type); 2803 isolate(), arg_count, call_type);
2803 __ Move(edx, Immediate(SmiFromSlot(expr->CallFeedbackSlot()))); 2804 __ Move(edx, Immediate(SmiFromSlot(expr->CallFeedbackSlot())));
2804 __ mov(edi, Operand(esp, (arg_count + 1) * kPointerSize)); 2805 __ mov(edi, Operand(esp, (arg_count + 1) * kPointerSize));
2805 // Don't assign a type feedback id to the IC, since type feedback is provided 2806 CallIC(ic, TypeFeedbackId(expr->CallFeedbackSlot().ToInt()));
2806 // by the vector above.
2807 CallIC(ic);
2808 2807
2809 RecordJSReturnSite(expr); 2808 RecordJSReturnSite(expr);
2810 2809
2811 // Restore context register. 2810 // Restore context register.
2812 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); 2811 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset));
2813 2812
2814 context()->DropAndPlug(1, eax); 2813 context()->DropAndPlug(1, eax);
2815 } 2814 }
2816 2815
2817 2816
(...skipping 2264 matching lines...) Expand 10 before | Expand all | Expand 10 after
5082 DCHECK_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), 5081 DCHECK_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(),
5083 Assembler::target_address_at(call_target_address, 5082 Assembler::target_address_at(call_target_address,
5084 unoptimized_code)); 5083 unoptimized_code));
5085 return OSR_AFTER_STACK_CHECK; 5084 return OSR_AFTER_STACK_CHECK;
5086 } 5085 }
5087 5086
5088 5087
5089 } } // namespace v8::internal 5088 } } // namespace v8::internal
5090 5089
5091 #endif // V8_TARGET_ARCH_IA32 5090 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/code-stubs-ia32.cc ('k') | src/ia32/lithium-codegen-ia32.cc » ('j') | src/ic/ic.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698