OLD | NEW |
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 Loading... |
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 Loading... |
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 1535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2730 ZoneList<Expression*>* args = expr->arguments(); | 2724 ZoneList<Expression*>* args = expr->arguments(); |
2731 int arg_count = args->length(); | 2725 int arg_count = args->length(); |
2732 { PreservePositionScope scope(masm()->positions_recorder()); | 2726 { PreservePositionScope scope(masm()->positions_recorder()); |
2733 for (int i = 0; i < arg_count; i++) { | 2727 for (int i = 0; i < arg_count; i++) { |
2734 VisitForStackValue(args->at(i)); | 2728 VisitForStackValue(args->at(i)); |
2735 } | 2729 } |
2736 } | 2730 } |
2737 // Record source position for debugger. | 2731 // Record source position for debugger. |
2738 SetSourcePosition(expr->position()); | 2732 SetSourcePosition(expr->position()); |
2739 | 2733 |
2740 Handle<Object> uninitialized = | |
2741 TypeFeedbackInfo::UninitializedSentinel(isolate()); | |
2742 StoreFeedbackVectorSlot(expr->CallFeedbackSlot(), uninitialized); | |
2743 __ li(a2, FeedbackVector()); | 2734 __ li(a2, FeedbackVector()); |
2744 __ li(a3, Operand(Smi::FromInt(expr->CallFeedbackSlot()))); | 2735 __ li(a3, Operand(Smi::FromInt(expr->CallFeedbackSlot()))); |
2745 | 2736 |
2746 // Record call targets in unoptimized code. | 2737 // Record call targets in unoptimized code. |
2747 CallFunctionStub stub(arg_count, RECORD_CALL_TARGET); | 2738 CallFunctionStub stub(arg_count, RECORD_CALL_TARGET); |
2748 __ lw(a1, MemOperand(sp, (arg_count + 1) * kPointerSize)); | 2739 __ lw(a1, MemOperand(sp, (arg_count + 1) * kPointerSize)); |
2749 __ CallStub(&stub); | 2740 __ CallStub(&stub); |
2750 RecordJSReturnSite(expr); | 2741 RecordJSReturnSite(expr); |
2751 // Restore context register. | 2742 // Restore context register. |
2752 __ lw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 2743 __ lw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2917 | 2908 |
2918 // Call the construct call builtin that handles allocation and | 2909 // Call the construct call builtin that handles allocation and |
2919 // constructor invocation. | 2910 // constructor invocation. |
2920 SetSourcePosition(expr->position()); | 2911 SetSourcePosition(expr->position()); |
2921 | 2912 |
2922 // Load function and argument count into a1 and a0. | 2913 // Load function and argument count into a1 and a0. |
2923 __ li(a0, Operand(arg_count)); | 2914 __ li(a0, Operand(arg_count)); |
2924 __ lw(a1, MemOperand(sp, arg_count * kPointerSize)); | 2915 __ lw(a1, MemOperand(sp, arg_count * kPointerSize)); |
2925 | 2916 |
2926 // Record call targets in unoptimized code. | 2917 // Record call targets in unoptimized code. |
2927 Handle<Object> uninitialized = | |
2928 TypeFeedbackInfo::UninitializedSentinel(isolate()); | |
2929 StoreFeedbackVectorSlot(expr->CallNewFeedbackSlot(), uninitialized); | |
2930 __ li(a2, FeedbackVector()); | 2918 __ li(a2, FeedbackVector()); |
2931 __ li(a3, Operand(Smi::FromInt(expr->CallNewFeedbackSlot()))); | 2919 __ li(a3, Operand(Smi::FromInt(expr->CallNewFeedbackSlot()))); |
2932 | 2920 |
2933 CallConstructStub stub(RECORD_CALL_TARGET); | 2921 CallConstructStub stub(RECORD_CALL_TARGET); |
2934 __ Call(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL); | 2922 __ Call(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL); |
2935 PrepareForBailoutForId(expr->ReturnId(), TOS_REG); | 2923 PrepareForBailoutForId(expr->ReturnId(), TOS_REG); |
2936 context()->Plug(v0); | 2924 context()->Plug(v0); |
2937 } | 2925 } |
2938 | 2926 |
2939 | 2927 |
(...skipping 2026 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4966 Assembler::target_address_at(pc_immediate_load_address)) == | 4954 Assembler::target_address_at(pc_immediate_load_address)) == |
4967 reinterpret_cast<uint32_t>( | 4955 reinterpret_cast<uint32_t>( |
4968 isolate->builtins()->OsrAfterStackCheck()->entry())); | 4956 isolate->builtins()->OsrAfterStackCheck()->entry())); |
4969 return OSR_AFTER_STACK_CHECK; | 4957 return OSR_AFTER_STACK_CHECK; |
4970 } | 4958 } |
4971 | 4959 |
4972 | 4960 |
4973 } } // namespace v8::internal | 4961 } } // namespace v8::internal |
4974 | 4962 |
4975 #endif // V8_TARGET_ARCH_MIPS | 4963 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |