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

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

Issue 178463007: Moved type feedback vector to SharedFunctionInfo. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: REBASE Created 6 years, 9 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/a64/full-codegen-a64.cc ('k') | src/compiler.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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 // o sp: stack pointer 124 // o sp: stack pointer
125 // o lr: return address 125 // o lr: return address
126 // 126 //
127 // The function builds a JS frame. Please see JavaScriptFrameConstants in 127 // The function builds a JS frame. Please see JavaScriptFrameConstants in
128 // frames-arm.h for its layout. 128 // frames-arm.h for its layout.
129 void FullCodeGenerator::Generate() { 129 void FullCodeGenerator::Generate() {
130 CompilationInfo* info = info_; 130 CompilationInfo* info = info_;
131 handler_table_ = 131 handler_table_ =
132 isolate()->factory()->NewFixedArray(function()->handler_count(), TENURED); 132 isolate()->factory()->NewFixedArray(function()->handler_count(), TENURED);
133 133
134 InitializeFeedbackVector();
135
136 profiling_counter_ = isolate()->factory()->NewCell( 134 profiling_counter_ = isolate()->factory()->NewCell(
137 Handle<Smi>(Smi::FromInt(FLAG_interrupt_budget), isolate())); 135 Handle<Smi>(Smi::FromInt(FLAG_interrupt_budget), isolate()));
138 SetFunctionPosition(function()); 136 SetFunctionPosition(function());
139 Comment cmnt(masm_, "[ function compiled by full code generator"); 137 Comment cmnt(masm_, "[ function compiled by full code generator");
140 138
141 ProfileEntryHookStub::MaybeCallEntryHook(masm_); 139 ProfileEntryHookStub::MaybeCallEntryHook(masm_);
142 140
143 #ifdef DEBUG 141 #ifdef DEBUG
144 if (strlen(FLAG_stop_at) > 0 && 142 if (strlen(FLAG_stop_at) > 0 &&
145 info->function()->name()->IsUtf8EqualTo(CStrVector(FLAG_stop_at))) { 143 info->function()->name()->IsUtf8EqualTo(CStrVector(FLAG_stop_at))) {
(...skipping 1014 matching lines...) Expand 10 before | Expand all | Expand 10 after
1160 __ jmp(&loop); 1158 __ jmp(&loop);
1161 1159
1162 __ bind(&no_descriptors); 1160 __ bind(&no_descriptors);
1163 __ Drop(1); 1161 __ Drop(1);
1164 __ jmp(&exit); 1162 __ jmp(&exit);
1165 1163
1166 // We got a fixed array in register r0. Iterate through that. 1164 // We got a fixed array in register r0. Iterate through that.
1167 Label non_proxy; 1165 Label non_proxy;
1168 __ bind(&fixed_array); 1166 __ bind(&fixed_array);
1169 1167
1170 Handle<Object> feedback = Handle<Object>(
1171 Smi::FromInt(TypeFeedbackInfo::kForInFastCaseMarker),
1172 isolate());
1173 StoreFeedbackVectorSlot(slot, feedback);
1174 __ Move(r1, FeedbackVector()); 1168 __ Move(r1, FeedbackVector());
1175 __ mov(r2, Operand(Smi::FromInt(TypeFeedbackInfo::kForInSlowCaseMarker))); 1169 __ mov(r2, Operand(TypeFeedbackInfo::MegamorphicSentinel(isolate())));
1176 __ str(r2, FieldMemOperand(r1, FixedArray::OffsetOfElementAt(slot))); 1170 __ str(r2, FieldMemOperand(r1, FixedArray::OffsetOfElementAt(slot)));
1177 1171
1178 __ mov(r1, Operand(Smi::FromInt(1))); // Smi indicates slow check 1172 __ mov(r1, Operand(Smi::FromInt(1))); // Smi indicates slow check
1179 __ ldr(r2, MemOperand(sp, 0 * kPointerSize)); // Get enumerated object 1173 __ ldr(r2, MemOperand(sp, 0 * kPointerSize)); // Get enumerated object
1180 STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_SPEC_OBJECT_TYPE); 1174 STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_SPEC_OBJECT_TYPE);
1181 __ CompareObjectType(r2, r3, r3, LAST_JS_PROXY_TYPE); 1175 __ CompareObjectType(r2, r3, r3, LAST_JS_PROXY_TYPE);
1182 __ b(gt, &non_proxy); 1176 __ b(gt, &non_proxy);
1183 __ mov(r1, Operand(Smi::FromInt(0))); // Zero indicates proxy 1177 __ mov(r1, Operand(Smi::FromInt(0))); // Zero indicates proxy
1184 __ bind(&non_proxy); 1178 __ bind(&non_proxy);
1185 __ Push(r1, r0); // Smi and array 1179 __ Push(r1, r0); // Smi and array
(...skipping 1521 matching lines...) Expand 10 before | Expand all | Expand 10 after
2707 ZoneList<Expression*>* args = expr->arguments(); 2701 ZoneList<Expression*>* args = expr->arguments();
2708 int arg_count = args->length(); 2702 int arg_count = args->length();
2709 { PreservePositionScope scope(masm()->positions_recorder()); 2703 { PreservePositionScope scope(masm()->positions_recorder());
2710 for (int i = 0; i < arg_count; i++) { 2704 for (int i = 0; i < arg_count; i++) {
2711 VisitForStackValue(args->at(i)); 2705 VisitForStackValue(args->at(i));
2712 } 2706 }
2713 } 2707 }
2714 // Record source position for debugger. 2708 // Record source position for debugger.
2715 SetSourcePosition(expr->position()); 2709 SetSourcePosition(expr->position());
2716 2710
2717 Handle<Object> uninitialized =
2718 TypeFeedbackInfo::UninitializedSentinel(isolate());
2719 StoreFeedbackVectorSlot(expr->CallFeedbackSlot(), uninitialized);
2720 __ Move(r2, FeedbackVector()); 2711 __ Move(r2, FeedbackVector());
2721 __ mov(r3, Operand(Smi::FromInt(expr->CallFeedbackSlot()))); 2712 __ mov(r3, Operand(Smi::FromInt(expr->CallFeedbackSlot())));
2722 2713
2723 // Record call targets in unoptimized code. 2714 // Record call targets in unoptimized code.
2724 CallFunctionStub stub(arg_count, RECORD_CALL_TARGET); 2715 CallFunctionStub stub(arg_count, RECORD_CALL_TARGET);
2725 __ ldr(r1, MemOperand(sp, (arg_count + 1) * kPointerSize)); 2716 __ ldr(r1, MemOperand(sp, (arg_count + 1) * kPointerSize));
2726 __ CallStub(&stub); 2717 __ CallStub(&stub);
2727 RecordJSReturnSite(expr); 2718 RecordJSReturnSite(expr);
2728 // Restore context register. 2719 // Restore context register.
2729 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); 2720 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
2896 2887
2897 // Call the construct call builtin that handles allocation and 2888 // Call the construct call builtin that handles allocation and
2898 // constructor invocation. 2889 // constructor invocation.
2899 SetSourcePosition(expr->position()); 2890 SetSourcePosition(expr->position());
2900 2891
2901 // Load function and argument count into r1 and r0. 2892 // Load function and argument count into r1 and r0.
2902 __ mov(r0, Operand(arg_count)); 2893 __ mov(r0, Operand(arg_count));
2903 __ ldr(r1, MemOperand(sp, arg_count * kPointerSize)); 2894 __ ldr(r1, MemOperand(sp, arg_count * kPointerSize));
2904 2895
2905 // Record call targets in unoptimized code. 2896 // Record call targets in unoptimized code.
2906 Handle<Object> uninitialized =
2907 TypeFeedbackInfo::UninitializedSentinel(isolate());
2908 StoreFeedbackVectorSlot(expr->CallNewFeedbackSlot(), uninitialized);
2909 __ Move(r2, FeedbackVector()); 2897 __ Move(r2, FeedbackVector());
2910 __ mov(r3, Operand(Smi::FromInt(expr->CallNewFeedbackSlot()))); 2898 __ mov(r3, Operand(Smi::FromInt(expr->CallNewFeedbackSlot())));
2911 2899
2912 CallConstructStub stub(RECORD_CALL_TARGET); 2900 CallConstructStub stub(RECORD_CALL_TARGET);
2913 __ Call(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL); 2901 __ Call(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL);
2914 PrepareForBailoutForId(expr->ReturnId(), TOS_REG); 2902 PrepareForBailoutForId(expr->ReturnId(), TOS_REG);
2915 context()->Plug(r0); 2903 context()->Plug(r0);
2916 } 2904 }
2917 2905
2918 2906
(...skipping 1998 matching lines...) Expand 10 before | Expand all | Expand 10 after
4917 ASSERT(Memory::uint32_at(interrupt_address_pointer) == 4905 ASSERT(Memory::uint32_at(interrupt_address_pointer) ==
4918 reinterpret_cast<uint32_t>( 4906 reinterpret_cast<uint32_t>(
4919 isolate->builtins()->OsrAfterStackCheck()->entry())); 4907 isolate->builtins()->OsrAfterStackCheck()->entry()));
4920 return OSR_AFTER_STACK_CHECK; 4908 return OSR_AFTER_STACK_CHECK;
4921 } 4909 }
4922 4910
4923 4911
4924 } } // namespace v8::internal 4912 } } // namespace v8::internal
4925 4913
4926 #endif // V8_TARGET_ARCH_ARM 4914 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/a64/full-codegen-a64.cc ('k') | src/compiler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698