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

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: Ports and comment response. 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
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 1522 matching lines...) Expand 10 before | Expand all | Expand 10 after
2708 ZoneList<Expression*>* args = expr->arguments(); 2702 ZoneList<Expression*>* args = expr->arguments();
2709 int arg_count = args->length(); 2703 int arg_count = args->length();
2710 { PreservePositionScope scope(masm()->positions_recorder()); 2704 { PreservePositionScope scope(masm()->positions_recorder());
2711 for (int i = 0; i < arg_count; i++) { 2705 for (int i = 0; i < arg_count; i++) {
2712 VisitForStackValue(args->at(i)); 2706 VisitForStackValue(args->at(i));
2713 } 2707 }
2714 } 2708 }
2715 // Record source position for debugger. 2709 // Record source position for debugger.
2716 SetSourcePosition(expr->position()); 2710 SetSourcePosition(expr->position());
2717 2711
2718 Handle<Object> uninitialized =
2719 TypeFeedbackInfo::UninitializedSentinel(isolate());
2720 StoreFeedbackVectorSlot(expr->CallFeedbackSlot(), uninitialized);
2721 __ Move(r2, FeedbackVector()); 2712 __ Move(r2, FeedbackVector());
2722 __ mov(r3, Operand(Smi::FromInt(expr->CallFeedbackSlot()))); 2713 __ mov(r3, Operand(Smi::FromInt(expr->CallFeedbackSlot())));
2723 2714
2724 // Record call targets in unoptimized code. 2715 // Record call targets in unoptimized code.
2725 CallFunctionStub stub(arg_count, RECORD_CALL_TARGET); 2716 CallFunctionStub stub(arg_count, RECORD_CALL_TARGET);
2726 __ ldr(r1, MemOperand(sp, (arg_count + 1) * kPointerSize)); 2717 __ ldr(r1, MemOperand(sp, (arg_count + 1) * kPointerSize));
2727 __ CallStub(&stub); 2718 __ CallStub(&stub);
2728 RecordJSReturnSite(expr); 2719 RecordJSReturnSite(expr);
2729 // Restore context register. 2720 // Restore context register.
2730 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); 2721 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
2897 2888
2898 // Call the construct call builtin that handles allocation and 2889 // Call the construct call builtin that handles allocation and
2899 // constructor invocation. 2890 // constructor invocation.
2900 SetSourcePosition(expr->position()); 2891 SetSourcePosition(expr->position());
2901 2892
2902 // Load function and argument count into r1 and r0. 2893 // Load function and argument count into r1 and r0.
2903 __ mov(r0, Operand(arg_count)); 2894 __ mov(r0, Operand(arg_count));
2904 __ ldr(r1, MemOperand(sp, arg_count * kPointerSize)); 2895 __ ldr(r1, MemOperand(sp, arg_count * kPointerSize));
2905 2896
2906 // Record call targets in unoptimized code. 2897 // Record call targets in unoptimized code.
2907 Handle<Object> uninitialized =
2908 TypeFeedbackInfo::UninitializedSentinel(isolate());
2909 StoreFeedbackVectorSlot(expr->CallNewFeedbackSlot(), uninitialized);
2910 __ Move(r2, FeedbackVector()); 2898 __ Move(r2, FeedbackVector());
2911 __ mov(r3, Operand(Smi::FromInt(expr->CallNewFeedbackSlot()))); 2899 __ mov(r3, Operand(Smi::FromInt(expr->CallNewFeedbackSlot())));
2912 2900
2913 CallConstructStub stub(RECORD_CALL_TARGET); 2901 CallConstructStub stub(RECORD_CALL_TARGET);
2914 __ Call(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL); 2902 __ Call(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL);
2915 PrepareForBailoutForId(expr->ReturnId(), TOS_REG); 2903 PrepareForBailoutForId(expr->ReturnId(), TOS_REG);
2916 context()->Plug(r0); 2904 context()->Plug(r0);
2917 } 2905 }
2918 2906
2919 2907
(...skipping 1998 matching lines...) Expand 10 before | Expand all | Expand 10 after
4918 ASSERT(Memory::uint32_at(interrupt_address_pointer) == 4906 ASSERT(Memory::uint32_at(interrupt_address_pointer) ==
4919 reinterpret_cast<uint32_t>( 4907 reinterpret_cast<uint32_t>(
4920 isolate->builtins()->OsrAfterStackCheck()->entry())); 4908 isolate->builtins()->OsrAfterStackCheck()->entry()));
4921 return OSR_AFTER_STACK_CHECK; 4909 return OSR_AFTER_STACK_CHECK;
4922 } 4910 }
4923 4911
4924 4912
4925 } } // namespace v8::internal 4913 } } // namespace v8::internal
4926 4914
4927 #endif // V8_TARGET_ARCH_ARM 4915 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/a64/full-codegen-a64.cc ('k') | src/compiler.h » ('j') | src/compiler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698