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

Side by Side Diff: src/ia32/full-codegen-ia32.cc

Issue 254623002: Simplify feedback vector creation and store in SharedFunctionInfo. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Code comments Created 6 years, 7 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
« no previous file with comments | « src/hydrogen.cc ('k') | src/objects.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 // o ebp: our caller's frame pointer 133 // o ebp: our caller's frame pointer
134 // o esp: stack pointer (pointing to return address) 134 // o esp: stack pointer (pointing to return address)
135 // 135 //
136 // The function builds a JS frame. Please see JavaScriptFrameConstants in 136 // The function builds a JS frame. Please see JavaScriptFrameConstants in
137 // frames-ia32.h for its layout. 137 // frames-ia32.h for its layout.
138 void FullCodeGenerator::Generate() { 138 void FullCodeGenerator::Generate() {
139 CompilationInfo* info = info_; 139 CompilationInfo* info = info_;
140 handler_table_ = 140 handler_table_ =
141 isolate()->factory()->NewFixedArray(function()->handler_count(), TENURED); 141 isolate()->factory()->NewFixedArray(function()->handler_count(), TENURED);
142 142
143 InitializeFeedbackVector();
144
145 profiling_counter_ = isolate()->factory()->NewCell( 143 profiling_counter_ = isolate()->factory()->NewCell(
146 Handle<Smi>(Smi::FromInt(FLAG_interrupt_budget), isolate())); 144 Handle<Smi>(Smi::FromInt(FLAG_interrupt_budget), isolate()));
147 SetFunctionPosition(function()); 145 SetFunctionPosition(function());
148 Comment cmnt(masm_, "[ function compiled by full code generator"); 146 Comment cmnt(masm_, "[ function compiled by full code generator");
149 147
150 ProfileEntryHookStub::MaybeCallEntryHook(masm_); 148 ProfileEntryHookStub::MaybeCallEntryHook(masm_);
151 149
152 #ifdef DEBUG 150 #ifdef DEBUG
153 if (strlen(FLAG_stop_at) > 0 && 151 if (strlen(FLAG_stop_at) > 0 &&
154 info->function()->name()->IsUtf8EqualTo(CStrVector(FLAG_stop_at))) { 152 info->function()->name()->IsUtf8EqualTo(CStrVector(FLAG_stop_at))) {
(...skipping 973 matching lines...) Expand 10 before | Expand all | Expand 10 after
1128 __ jmp(&loop); 1126 __ jmp(&loop);
1129 1127
1130 __ bind(&no_descriptors); 1128 __ bind(&no_descriptors);
1131 __ add(esp, Immediate(kPointerSize)); 1129 __ add(esp, Immediate(kPointerSize));
1132 __ jmp(&exit); 1130 __ jmp(&exit);
1133 1131
1134 // We got a fixed array in register eax. Iterate through that. 1132 // We got a fixed array in register eax. Iterate through that.
1135 Label non_proxy; 1133 Label non_proxy;
1136 __ bind(&fixed_array); 1134 __ bind(&fixed_array);
1137 1135
1138 Handle<Object> feedback = Handle<Object>(
1139 Smi::FromInt(TypeFeedbackInfo::kForInFastCaseMarker),
1140 isolate());
1141 StoreFeedbackVectorSlot(slot, feedback);
1142
1143 // No need for a write barrier, we are storing a Smi in the feedback vector. 1136 // No need for a write barrier, we are storing a Smi in the feedback vector.
1144 __ LoadHeapObject(ebx, FeedbackVector()); 1137 __ LoadHeapObject(ebx, FeedbackVector());
1145 __ mov(FieldOperand(ebx, FixedArray::OffsetOfElementAt(slot)), 1138 __ mov(FieldOperand(ebx, FixedArray::OffsetOfElementAt(slot)),
1146 Immediate(Smi::FromInt(TypeFeedbackInfo::kForInSlowCaseMarker))); 1139 Immediate(TypeFeedbackInfo::MegamorphicSentinel(isolate())));
1147 1140
1148 __ mov(ebx, Immediate(Smi::FromInt(1))); // Smi indicates slow check 1141 __ mov(ebx, Immediate(Smi::FromInt(1))); // Smi indicates slow check
1149 __ mov(ecx, Operand(esp, 0 * kPointerSize)); // Get enumerated object 1142 __ mov(ecx, Operand(esp, 0 * kPointerSize)); // Get enumerated object
1150 STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_SPEC_OBJECT_TYPE); 1143 STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_SPEC_OBJECT_TYPE);
1151 __ CmpObjectType(ecx, LAST_JS_PROXY_TYPE, ecx); 1144 __ CmpObjectType(ecx, LAST_JS_PROXY_TYPE, ecx);
1152 __ j(above, &non_proxy); 1145 __ j(above, &non_proxy);
1153 __ Move(ebx, Immediate(Smi::FromInt(0))); // Zero indicates proxy 1146 __ Move(ebx, Immediate(Smi::FromInt(0))); // Zero indicates proxy
1154 __ bind(&non_proxy); 1147 __ bind(&non_proxy);
1155 __ push(ebx); // Smi 1148 __ push(ebx); // Smi
1156 __ push(eax); // Array 1149 __ push(eax); // Array
(...skipping 1498 matching lines...) Expand 10 before | Expand all | Expand 10 after
2655 ZoneList<Expression*>* args = expr->arguments(); 2648 ZoneList<Expression*>* args = expr->arguments();
2656 int arg_count = args->length(); 2649 int arg_count = args->length();
2657 { PreservePositionScope scope(masm()->positions_recorder()); 2650 { PreservePositionScope scope(masm()->positions_recorder());
2658 for (int i = 0; i < arg_count; i++) { 2651 for (int i = 0; i < arg_count; i++) {
2659 VisitForStackValue(args->at(i)); 2652 VisitForStackValue(args->at(i));
2660 } 2653 }
2661 } 2654 }
2662 // Record source position for debugger. 2655 // Record source position for debugger.
2663 SetSourcePosition(expr->position()); 2656 SetSourcePosition(expr->position());
2664 2657
2665 Handle<Object> uninitialized =
2666 TypeFeedbackInfo::UninitializedSentinel(isolate());
2667 StoreFeedbackVectorSlot(expr->CallFeedbackSlot(), uninitialized);
2668 __ LoadHeapObject(ebx, FeedbackVector()); 2658 __ LoadHeapObject(ebx, FeedbackVector());
2669 __ mov(edx, Immediate(Smi::FromInt(expr->CallFeedbackSlot()))); 2659 __ mov(edx, Immediate(Smi::FromInt(expr->CallFeedbackSlot())));
2670 2660
2671 // Record call targets in unoptimized code. 2661 // Record call targets in unoptimized code.
2672 CallFunctionStub stub(isolate(), arg_count, RECORD_CALL_TARGET); 2662 CallFunctionStub stub(isolate(), arg_count, RECORD_CALL_TARGET);
2673 __ mov(edi, Operand(esp, (arg_count + 1) * kPointerSize)); 2663 __ mov(edi, Operand(esp, (arg_count + 1) * kPointerSize));
2674 __ CallStub(&stub); 2664 __ CallStub(&stub);
2675 2665
2676 RecordJSReturnSite(expr); 2666 RecordJSReturnSite(expr);
2677 // Restore context register. 2667 // Restore context register.
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
2835 2825
2836 // Call the construct call builtin that handles allocation and 2826 // Call the construct call builtin that handles allocation and
2837 // constructor invocation. 2827 // constructor invocation.
2838 SetSourcePosition(expr->position()); 2828 SetSourcePosition(expr->position());
2839 2829
2840 // Load function and argument count into edi and eax. 2830 // Load function and argument count into edi and eax.
2841 __ Move(eax, Immediate(arg_count)); 2831 __ Move(eax, Immediate(arg_count));
2842 __ mov(edi, Operand(esp, arg_count * kPointerSize)); 2832 __ mov(edi, Operand(esp, arg_count * kPointerSize));
2843 2833
2844 // Record call targets in unoptimized code. 2834 // Record call targets in unoptimized code.
2845 Handle<Object> uninitialized =
2846 TypeFeedbackInfo::UninitializedSentinel(isolate());
2847 StoreFeedbackVectorSlot(expr->CallNewFeedbackSlot(), uninitialized);
2848 if (FLAG_pretenuring_call_new) { 2835 if (FLAG_pretenuring_call_new) {
2849 StoreFeedbackVectorSlot(expr->AllocationSiteFeedbackSlot(), 2836 EnsureSlotContainsAllocationSite(expr->AllocationSiteFeedbackSlot());
2850 isolate()->factory()->NewAllocationSite());
2851 ASSERT(expr->AllocationSiteFeedbackSlot() == 2837 ASSERT(expr->AllocationSiteFeedbackSlot() ==
2852 expr->CallNewFeedbackSlot() + 1); 2838 expr->CallNewFeedbackSlot() + 1);
2853 } 2839 }
2854 2840
2855 __ LoadHeapObject(ebx, FeedbackVector()); 2841 __ LoadHeapObject(ebx, FeedbackVector());
2856 __ mov(edx, Immediate(Smi::FromInt(expr->CallNewFeedbackSlot()))); 2842 __ mov(edx, Immediate(Smi::FromInt(expr->CallNewFeedbackSlot())));
2857 2843
2858 CallConstructStub stub(isolate(), RECORD_CALL_TARGET); 2844 CallConstructStub stub(isolate(), RECORD_CALL_TARGET);
2859 __ call(stub.GetCode(), RelocInfo::CONSTRUCT_CALL); 2845 __ call(stub.GetCode(), RelocInfo::CONSTRUCT_CALL);
2860 PrepareForBailoutForId(expr->ReturnId(), TOS_REG); 2846 PrepareForBailoutForId(expr->ReturnId(), TOS_REG);
(...skipping 2031 matching lines...) Expand 10 before | Expand all | Expand 10 after
4892 ASSERT_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), 4878 ASSERT_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(),
4893 Assembler::target_address_at(call_target_address, 4879 Assembler::target_address_at(call_target_address,
4894 unoptimized_code)); 4880 unoptimized_code));
4895 return OSR_AFTER_STACK_CHECK; 4881 return OSR_AFTER_STACK_CHECK;
4896 } 4882 }
4897 4883
4898 4884
4899 } } // namespace v8::internal 4885 } } // namespace v8::internal
4900 4886
4901 #endif // V8_TARGET_ARCH_IA32 4887 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/hydrogen.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698