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

Side by Side Diff: src/x64/full-codegen-x64.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_X64 7 #if V8_TARGET_ARCH_X64
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 1131 matching lines...) Expand 10 before | Expand all | Expand 10 after
1142 __ bind(&no_descriptors); 1142 __ bind(&no_descriptors);
1143 __ addp(rsp, Immediate(kPointerSize)); 1143 __ addp(rsp, Immediate(kPointerSize));
1144 __ jmp(&exit); 1144 __ jmp(&exit);
1145 1145
1146 // We got a fixed array in register rax. Iterate through that. 1146 // We got a fixed array in register rax. Iterate through that.
1147 Label non_proxy; 1147 Label non_proxy;
1148 __ bind(&fixed_array); 1148 __ bind(&fixed_array);
1149 1149
1150 // No need for a write barrier, we are storing a Smi in the feedback vector. 1150 // No need for a write barrier, we are storing a Smi in the feedback vector.
1151 __ Move(rbx, FeedbackVector()); 1151 __ Move(rbx, FeedbackVector());
1152 __ Move(FieldOperand(rbx, FixedArray::OffsetOfElementAt(slot.ToInt())), 1152 int vector_index = FeedbackVector()->GetIndex(slot);
1153 __ Move(FieldOperand(rbx, FixedArray::OffsetOfElementAt(vector_index)),
1153 TypeFeedbackVector::MegamorphicSentinel(isolate())); 1154 TypeFeedbackVector::MegamorphicSentinel(isolate()));
1154 __ Move(rbx, Smi::FromInt(1)); // Smi indicates slow check 1155 __ Move(rbx, Smi::FromInt(1)); // Smi indicates slow check
1155 __ movp(rcx, Operand(rsp, 0 * kPointerSize)); // Get enumerated object 1156 __ movp(rcx, Operand(rsp, 0 * kPointerSize)); // Get enumerated object
1156 STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_SPEC_OBJECT_TYPE); 1157 STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_SPEC_OBJECT_TYPE);
1157 __ CmpObjectType(rcx, LAST_JS_PROXY_TYPE, rcx); 1158 __ CmpObjectType(rcx, LAST_JS_PROXY_TYPE, rcx);
1158 __ j(above, &non_proxy); 1159 __ j(above, &non_proxy);
1159 __ Move(rbx, Smi::FromInt(0)); // Zero indicates proxy 1160 __ Move(rbx, Smi::FromInt(0)); // Zero indicates proxy
1160 __ bind(&non_proxy); 1161 __ bind(&non_proxy);
1161 __ Push(rbx); // Smi 1162 __ Push(rbx); // Smi
1162 __ Push(rax); // Array 1163 __ Push(rax); // Array
(...skipping 1630 matching lines...) Expand 10 before | Expand all | Expand 10 after
2793 VisitForStackValue(args->at(i)); 2794 VisitForStackValue(args->at(i));
2794 } 2795 }
2795 } 2796 }
2796 2797
2797 // Record source position of the IC call. 2798 // Record source position of the IC call.
2798 SetSourcePosition(expr->position()); 2799 SetSourcePosition(expr->position());
2799 Handle<Code> ic = CallIC::initialize_stub( 2800 Handle<Code> ic = CallIC::initialize_stub(
2800 isolate(), arg_count, call_type); 2801 isolate(), arg_count, call_type);
2801 __ Move(rdx, SmiFromSlot(expr->CallFeedbackSlot())); 2802 __ Move(rdx, SmiFromSlot(expr->CallFeedbackSlot()));
2802 __ movp(rdi, Operand(rsp, (arg_count + 1) * kPointerSize)); 2803 __ movp(rdi, Operand(rsp, (arg_count + 1) * kPointerSize));
2803 // Don't assign a type feedback id to the IC, since type feedback is provided 2804 CallIC(ic, TypeFeedbackId(expr->CallFeedbackSlot().ToInt()));
2804 // by the vector above.
2805 CallIC(ic);
2806 2805
2807 RecordJSReturnSite(expr); 2806 RecordJSReturnSite(expr);
2808 2807
2809 // Restore context register. 2808 // Restore context register.
2810 __ movp(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); 2809 __ movp(rsi, Operand(rbp, StandardFrameConstants::kContextOffset));
2811 // Discard the function left on TOS. 2810 // Discard the function left on TOS.
2812 context()->DropAndPlug(1, rax); 2811 context()->DropAndPlug(1, rax);
2813 } 2812 }
2814 2813
2815 2814
(...skipping 2281 matching lines...) Expand 10 before | Expand all | Expand 10 after
5097 DCHECK_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), 5096 DCHECK_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(),
5098 Assembler::target_address_at(call_target_address, 5097 Assembler::target_address_at(call_target_address,
5099 unoptimized_code)); 5098 unoptimized_code));
5100 return OSR_AFTER_STACK_CHECK; 5099 return OSR_AFTER_STACK_CHECK;
5101 } 5100 }
5102 5101
5103 5102
5104 } } // namespace v8::internal 5103 } } // namespace v8::internal
5105 5104
5106 #endif // V8_TARGET_ARCH_X64 5105 #endif // V8_TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698