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

Side by Side Diff: src/a64/full-codegen-a64.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 | « no previous file | src/arm/full-codegen-arm.cc » ('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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 // - jssp: stack pointer. 122 // - jssp: stack pointer.
123 // - lr: return address. 123 // - lr: return address.
124 // 124 //
125 // The function builds a JS frame. See JavaScriptFrameConstants in 125 // The function builds a JS frame. See JavaScriptFrameConstants in
126 // frames-arm.h for its layout. 126 // frames-arm.h for its layout.
127 void FullCodeGenerator::Generate() { 127 void FullCodeGenerator::Generate() {
128 CompilationInfo* info = info_; 128 CompilationInfo* info = info_;
129 handler_table_ = 129 handler_table_ =
130 isolate()->factory()->NewFixedArray(function()->handler_count(), TENURED); 130 isolate()->factory()->NewFixedArray(function()->handler_count(), TENURED);
131 131
132 InitializeFeedbackVector();
133
134 profiling_counter_ = isolate()->factory()->NewCell( 132 profiling_counter_ = isolate()->factory()->NewCell(
135 Handle<Smi>(Smi::FromInt(FLAG_interrupt_budget), isolate())); 133 Handle<Smi>(Smi::FromInt(FLAG_interrupt_budget), isolate()));
136 SetFunctionPosition(function()); 134 SetFunctionPosition(function());
137 Comment cmnt(masm_, "[ Function compiled by full code generator"); 135 Comment cmnt(masm_, "[ Function compiled by full code generator");
138 136
139 ProfileEntryHookStub::MaybeCallEntryHook(masm_); 137 ProfileEntryHookStub::MaybeCallEntryHook(masm_);
140 138
141 #ifdef DEBUG 139 #ifdef DEBUG
142 if (strlen(FLAG_stop_at) > 0 && 140 if (strlen(FLAG_stop_at) > 0 &&
143 info->function()->name()->IsUtf8EqualTo(CStrVector(FLAG_stop_at))) { 141 info->function()->name()->IsUtf8EqualTo(CStrVector(FLAG_stop_at))) {
(...skipping 1011 matching lines...) Expand 10 before | Expand all | Expand 10 after
1155 __ Push(x2, x1, x0); 1153 __ Push(x2, x1, x0);
1156 __ B(&loop); 1154 __ B(&loop);
1157 1155
1158 __ Bind(&no_descriptors); 1156 __ Bind(&no_descriptors);
1159 __ Drop(1); 1157 __ Drop(1);
1160 __ B(&exit); 1158 __ B(&exit);
1161 1159
1162 // We got a fixed array in register x0. Iterate through that. 1160 // We got a fixed array in register x0. Iterate through that.
1163 __ Bind(&fixed_array); 1161 __ Bind(&fixed_array);
1164 1162
1165 Handle<Object> feedback = Handle<Object>(
1166 Smi::FromInt(TypeFeedbackInfo::kForInFastCaseMarker),
1167 isolate());
1168 StoreFeedbackVectorSlot(slot, feedback);
1169 __ LoadObject(x1, FeedbackVector()); 1163 __ LoadObject(x1, FeedbackVector());
1170 __ Mov(x10, Operand(Smi::FromInt(TypeFeedbackInfo::kForInSlowCaseMarker))); 1164 __ Mov(x10, Operand(TypeFeedbackInfo::MegamorphicSentinel(isolate())));
1171 __ Str(x10, FieldMemOperand(x1, FixedArray::OffsetOfElementAt(slot))); 1165 __ Str(x10, FieldMemOperand(x1, FixedArray::OffsetOfElementAt(slot)));
1172 1166
1173 __ Mov(x1, Operand(Smi::FromInt(1))); // Smi indicates slow check. 1167 __ Mov(x1, Operand(Smi::FromInt(1))); // Smi indicates slow check.
1174 __ Peek(x10, 0); // Get enumerated object. 1168 __ Peek(x10, 0); // Get enumerated object.
1175 STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_SPEC_OBJECT_TYPE); 1169 STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_SPEC_OBJECT_TYPE);
1176 // TODO(all): similar check was done already. Can we avoid it here? 1170 // TODO(all): similar check was done already. Can we avoid it here?
1177 __ CompareObjectType(x10, x11, x12, LAST_JS_PROXY_TYPE); 1171 __ CompareObjectType(x10, x11, x12, LAST_JS_PROXY_TYPE);
1178 ASSERT(Smi::FromInt(0) == 0); 1172 ASSERT(Smi::FromInt(0) == 0);
1179 __ CzeroX(x1, le); // Zero indicates proxy. 1173 __ CzeroX(x1, le); // Zero indicates proxy.
1180 __ Push(x1, x0); // Smi and array 1174 __ Push(x1, x0); // Smi and array
(...skipping 1228 matching lines...) Expand 10 before | Expand all | Expand 10 after
2409 ZoneList<Expression*>* args = expr->arguments(); 2403 ZoneList<Expression*>* args = expr->arguments();
2410 int arg_count = args->length(); 2404 int arg_count = args->length();
2411 { PreservePositionScope scope(masm()->positions_recorder()); 2405 { PreservePositionScope scope(masm()->positions_recorder());
2412 for (int i = 0; i < arg_count; i++) { 2406 for (int i = 0; i < arg_count; i++) {
2413 VisitForStackValue(args->at(i)); 2407 VisitForStackValue(args->at(i));
2414 } 2408 }
2415 } 2409 }
2416 // Record source position for debugger. 2410 // Record source position for debugger.
2417 SetSourcePosition(expr->position()); 2411 SetSourcePosition(expr->position());
2418 2412
2419 Handle<Object> uninitialized =
2420 TypeFeedbackInfo::UninitializedSentinel(isolate());
2421 StoreFeedbackVectorSlot(expr->CallFeedbackSlot(), uninitialized);
2422 __ LoadObject(x2, FeedbackVector()); 2413 __ LoadObject(x2, FeedbackVector());
2423 __ Mov(x3, Operand(Smi::FromInt(expr->CallFeedbackSlot()))); 2414 __ Mov(x3, Operand(Smi::FromInt(expr->CallFeedbackSlot())));
2424 2415
2425 // Record call targets in unoptimized code. 2416 // Record call targets in unoptimized code.
2426 CallFunctionStub stub(arg_count, RECORD_CALL_TARGET); 2417 CallFunctionStub stub(arg_count, RECORD_CALL_TARGET);
2427 __ Peek(x1, (arg_count + 1) * kXRegSizeInBytes); 2418 __ Peek(x1, (arg_count + 1) * kXRegSizeInBytes);
2428 __ CallStub(&stub); 2419 __ CallStub(&stub);
2429 RecordJSReturnSite(expr); 2420 RecordJSReturnSite(expr);
2430 // Restore context register. 2421 // Restore context register.
2431 __ Ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); 2422 __ Ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
2608 2599
2609 // Call the construct call builtin that handles allocation and 2600 // Call the construct call builtin that handles allocation and
2610 // constructor invocation. 2601 // constructor invocation.
2611 SetSourcePosition(expr->position()); 2602 SetSourcePosition(expr->position());
2612 2603
2613 // Load function and argument count into x1 and x0. 2604 // Load function and argument count into x1 and x0.
2614 __ Mov(x0, arg_count); 2605 __ Mov(x0, arg_count);
2615 __ Peek(x1, arg_count * kXRegSizeInBytes); 2606 __ Peek(x1, arg_count * kXRegSizeInBytes);
2616 2607
2617 // Record call targets in unoptimized code. 2608 // Record call targets in unoptimized code.
2618 Handle<Object> uninitialized =
2619 TypeFeedbackInfo::UninitializedSentinel(isolate());
2620 StoreFeedbackVectorSlot(expr->CallNewFeedbackSlot(), uninitialized);
2621 __ LoadObject(x2, FeedbackVector()); 2609 __ LoadObject(x2, FeedbackVector());
2622 __ Mov(x3, Operand(Smi::FromInt(expr->CallNewFeedbackSlot()))); 2610 __ Mov(x3, Operand(Smi::FromInt(expr->CallNewFeedbackSlot())));
2623 2611
2624 CallConstructStub stub(RECORD_CALL_TARGET); 2612 CallConstructStub stub(RECORD_CALL_TARGET);
2625 __ Call(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL); 2613 __ Call(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL);
2626 PrepareForBailoutForId(expr->ReturnId(), TOS_REG); 2614 PrepareForBailoutForId(expr->ReturnId(), TOS_REG);
2627 context()->Plug(x0); 2615 context()->Plug(x0);
2628 } 2616 }
2629 2617
2630 2618
(...skipping 2352 matching lines...) Expand 10 before | Expand all | Expand 10 after
4983 return previous_; 4971 return previous_;
4984 } 4972 }
4985 4973
4986 4974
4987 #undef __ 4975 #undef __
4988 4976
4989 4977
4990 } } // namespace v8::internal 4978 } } // namespace v8::internal
4991 4979
4992 #endif // V8_TARGET_ARCH_A64 4980 #endif // V8_TARGET_ARCH_A64
OLDNEW
« no previous file with comments | « no previous file | src/arm/full-codegen-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698