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

Side by Side Diff: src/mips/full-codegen-mips.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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 // o sp: stack pointer 132 // o sp: stack pointer
133 // o ra: return address 133 // o ra: return address
134 // 134 //
135 // The function builds a JS frame. Please see JavaScriptFrameConstants in 135 // The function builds a JS frame. Please see JavaScriptFrameConstants in
136 // frames-mips.h for its layout. 136 // frames-mips.h for its layout.
137 void FullCodeGenerator::Generate() { 137 void FullCodeGenerator::Generate() {
138 CompilationInfo* info = info_; 138 CompilationInfo* info = info_;
139 handler_table_ = 139 handler_table_ =
140 isolate()->factory()->NewFixedArray(function()->handler_count(), TENURED); 140 isolate()->factory()->NewFixedArray(function()->handler_count(), TENURED);
141 141
142 InitializeFeedbackVector();
143
144 profiling_counter_ = isolate()->factory()->NewCell( 142 profiling_counter_ = isolate()->factory()->NewCell(
145 Handle<Smi>(Smi::FromInt(FLAG_interrupt_budget), isolate())); 143 Handle<Smi>(Smi::FromInt(FLAG_interrupt_budget), isolate()));
146 SetFunctionPosition(function()); 144 SetFunctionPosition(function());
147 Comment cmnt(masm_, "[ function compiled by full code generator"); 145 Comment cmnt(masm_, "[ function compiled by full code generator");
148 146
149 ProfileEntryHookStub::MaybeCallEntryHook(masm_); 147 ProfileEntryHookStub::MaybeCallEntryHook(masm_);
150 148
151 #ifdef DEBUG 149 #ifdef DEBUG
152 if (strlen(FLAG_stop_at) > 0 && 150 if (strlen(FLAG_stop_at) > 0 &&
153 info->function()->name()->IsUtf8EqualTo(CStrVector(FLAG_stop_at))) { 151 info->function()->name()->IsUtf8EqualTo(CStrVector(FLAG_stop_at))) {
(...skipping 1015 matching lines...) Expand 10 before | Expand all | Expand 10 after
1169 __ jmp(&loop); 1167 __ jmp(&loop);
1170 1168
1171 __ bind(&no_descriptors); 1169 __ bind(&no_descriptors);
1172 __ Drop(1); 1170 __ Drop(1);
1173 __ jmp(&exit); 1171 __ jmp(&exit);
1174 1172
1175 // We got a fixed array in register v0. Iterate through that. 1173 // We got a fixed array in register v0. Iterate through that.
1176 Label non_proxy; 1174 Label non_proxy;
1177 __ bind(&fixed_array); 1175 __ bind(&fixed_array);
1178 1176
1179 Handle<Object> feedback = Handle<Object>(
1180 Smi::FromInt(TypeFeedbackInfo::kForInFastCaseMarker),
1181 isolate());
1182 StoreFeedbackVectorSlot(slot, feedback);
1183 __ li(a1, FeedbackVector()); 1177 __ li(a1, FeedbackVector());
1184 __ li(a2, Operand(Smi::FromInt(TypeFeedbackInfo::kForInSlowCaseMarker))); 1178 __ li(a2, Operand(TypeFeedbackInfo::MegamorphicSentinel(isolate())));
1185 __ sw(a2, FieldMemOperand(a1, FixedArray::OffsetOfElementAt(slot))); 1179 __ sw(a2, FieldMemOperand(a1, FixedArray::OffsetOfElementAt(slot)));
1186 1180
1187 __ li(a1, Operand(Smi::FromInt(1))); // Smi indicates slow check 1181 __ li(a1, Operand(Smi::FromInt(1))); // Smi indicates slow check
1188 __ lw(a2, MemOperand(sp, 0 * kPointerSize)); // Get enumerated object 1182 __ lw(a2, MemOperand(sp, 0 * kPointerSize)); // Get enumerated object
1189 STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_SPEC_OBJECT_TYPE); 1183 STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_SPEC_OBJECT_TYPE);
1190 __ GetObjectType(a2, a3, a3); 1184 __ GetObjectType(a2, a3, a3);
1191 __ Branch(&non_proxy, gt, a3, Operand(LAST_JS_PROXY_TYPE)); 1185 __ Branch(&non_proxy, gt, a3, Operand(LAST_JS_PROXY_TYPE));
1192 __ li(a1, Operand(Smi::FromInt(0))); // Zero indicates proxy 1186 __ li(a1, Operand(Smi::FromInt(0))); // Zero indicates proxy
1193 __ bind(&non_proxy); 1187 __ bind(&non_proxy);
1194 __ Push(a1, v0); // Smi and array 1188 __ Push(a1, v0); // Smi and array
(...skipping 1536 matching lines...) Expand 10 before | Expand all | Expand 10 after
2731 ZoneList<Expression*>* args = expr->arguments(); 2725 ZoneList<Expression*>* args = expr->arguments();
2732 int arg_count = args->length(); 2726 int arg_count = args->length();
2733 { PreservePositionScope scope(masm()->positions_recorder()); 2727 { PreservePositionScope scope(masm()->positions_recorder());
2734 for (int i = 0; i < arg_count; i++) { 2728 for (int i = 0; i < arg_count; i++) {
2735 VisitForStackValue(args->at(i)); 2729 VisitForStackValue(args->at(i));
2736 } 2730 }
2737 } 2731 }
2738 // Record source position for debugger. 2732 // Record source position for debugger.
2739 SetSourcePosition(expr->position()); 2733 SetSourcePosition(expr->position());
2740 2734
2741 Handle<Object> uninitialized =
2742 TypeFeedbackInfo::UninitializedSentinel(isolate());
2743 StoreFeedbackVectorSlot(expr->CallFeedbackSlot(), uninitialized);
2744 __ li(a2, FeedbackVector()); 2735 __ li(a2, FeedbackVector());
2745 __ li(a3, Operand(Smi::FromInt(expr->CallFeedbackSlot()))); 2736 __ li(a3, Operand(Smi::FromInt(expr->CallFeedbackSlot())));
2746 2737
2747 // Record call targets in unoptimized code. 2738 // Record call targets in unoptimized code.
2748 CallFunctionStub stub(arg_count, RECORD_CALL_TARGET); 2739 CallFunctionStub stub(arg_count, RECORD_CALL_TARGET);
2749 __ lw(a1, MemOperand(sp, (arg_count + 1) * kPointerSize)); 2740 __ lw(a1, MemOperand(sp, (arg_count + 1) * kPointerSize));
2750 __ CallStub(&stub); 2741 __ CallStub(&stub);
2751 RecordJSReturnSite(expr); 2742 RecordJSReturnSite(expr);
2752 // Restore context register. 2743 // Restore context register.
2753 __ lw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); 2744 __ lw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
2918 2909
2919 // Call the construct call builtin that handles allocation and 2910 // Call the construct call builtin that handles allocation and
2920 // constructor invocation. 2911 // constructor invocation.
2921 SetSourcePosition(expr->position()); 2912 SetSourcePosition(expr->position());
2922 2913
2923 // Load function and argument count into a1 and a0. 2914 // Load function and argument count into a1 and a0.
2924 __ li(a0, Operand(arg_count)); 2915 __ li(a0, Operand(arg_count));
2925 __ lw(a1, MemOperand(sp, arg_count * kPointerSize)); 2916 __ lw(a1, MemOperand(sp, arg_count * kPointerSize));
2926 2917
2927 // Record call targets in unoptimized code. 2918 // Record call targets in unoptimized code.
2928 Handle<Object> uninitialized =
2929 TypeFeedbackInfo::UninitializedSentinel(isolate());
2930 StoreFeedbackVectorSlot(expr->CallNewFeedbackSlot(), uninitialized);
2931 __ li(a2, FeedbackVector()); 2919 __ li(a2, FeedbackVector());
2932 __ li(a3, Operand(Smi::FromInt(expr->CallNewFeedbackSlot()))); 2920 __ li(a3, Operand(Smi::FromInt(expr->CallNewFeedbackSlot())));
2933 2921
2934 CallConstructStub stub(RECORD_CALL_TARGET); 2922 CallConstructStub stub(RECORD_CALL_TARGET);
2935 __ Call(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL); 2923 __ Call(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL);
2936 PrepareForBailoutForId(expr->ReturnId(), TOS_REG); 2924 PrepareForBailoutForId(expr->ReturnId(), TOS_REG);
2937 context()->Plug(v0); 2925 context()->Plug(v0);
2938 } 2926 }
2939 2927
2940 2928
(...skipping 2026 matching lines...) Expand 10 before | Expand all | Expand 10 after
4967 Assembler::target_address_at(pc_immediate_load_address)) == 4955 Assembler::target_address_at(pc_immediate_load_address)) ==
4968 reinterpret_cast<uint32_t>( 4956 reinterpret_cast<uint32_t>(
4969 isolate->builtins()->OsrAfterStackCheck()->entry())); 4957 isolate->builtins()->OsrAfterStackCheck()->entry()));
4970 return OSR_AFTER_STACK_CHECK; 4958 return OSR_AFTER_STACK_CHECK;
4971 } 4959 }
4972 4960
4973 4961
4974 } } // namespace v8::internal 4962 } } // namespace v8::internal
4975 4963
4976 #endif // V8_TARGET_ARCH_MIPS 4964 #endif // V8_TARGET_ARCH_MIPS
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698