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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 // o sp: stack pointer | 149 // o sp: stack pointer |
150 // o lr: return address | 150 // o lr: return address |
151 // | 151 // |
152 // The function builds a JS frame. Please see JavaScriptFrameConstants in | 152 // The function builds a JS frame. Please see JavaScriptFrameConstants in |
153 // frames-arm.h for its layout. | 153 // frames-arm.h for its layout. |
154 void FullCodeGenerator::Generate() { | 154 void FullCodeGenerator::Generate() { |
155 CompilationInfo* info = info_; | 155 CompilationInfo* info = info_; |
156 handler_table_ = | 156 handler_table_ = |
157 isolate()->factory()->NewFixedArray(function()->handler_count(), TENURED); | 157 isolate()->factory()->NewFixedArray(function()->handler_count(), TENURED); |
158 | 158 |
159 InitializeFeedbackVector(); | |
160 | |
161 profiling_counter_ = isolate()->factory()->NewCell( | 159 profiling_counter_ = isolate()->factory()->NewCell( |
162 Handle<Smi>(Smi::FromInt(FLAG_interrupt_budget), isolate())); | 160 Handle<Smi>(Smi::FromInt(FLAG_interrupt_budget), isolate())); |
163 SetFunctionPosition(function()); | 161 SetFunctionPosition(function()); |
164 Comment cmnt(masm_, "[ function compiled by full code generator"); | 162 Comment cmnt(masm_, "[ function compiled by full code generator"); |
165 | 163 |
166 ProfileEntryHookStub::MaybeCallEntryHook(masm_); | 164 ProfileEntryHookStub::MaybeCallEntryHook(masm_); |
167 | 165 |
168 #ifdef DEBUG | 166 #ifdef DEBUG |
169 if (strlen(FLAG_stop_at) > 0 && | 167 if (strlen(FLAG_stop_at) > 0 && |
170 info->function()->name()->IsUtf8EqualTo(CStrVector(FLAG_stop_at))) { | 168 info->function()->name()->IsUtf8EqualTo(CStrVector(FLAG_stop_at))) { |
(...skipping 1015 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1186 __ jmp(&loop); | 1184 __ jmp(&loop); |
1187 | 1185 |
1188 __ bind(&no_descriptors); | 1186 __ bind(&no_descriptors); |
1189 __ Drop(1); | 1187 __ Drop(1); |
1190 __ jmp(&exit); | 1188 __ jmp(&exit); |
1191 | 1189 |
1192 // We got a fixed array in register r0. Iterate through that. | 1190 // We got a fixed array in register r0. Iterate through that. |
1193 Label non_proxy; | 1191 Label non_proxy; |
1194 __ bind(&fixed_array); | 1192 __ bind(&fixed_array); |
1195 | 1193 |
1196 Handle<Object> feedback = Handle<Object>( | |
1197 Smi::FromInt(TypeFeedbackInfo::kForInFastCaseMarker), | |
1198 isolate()); | |
1199 StoreFeedbackVectorSlot(slot, feedback); | |
1200 __ Move(r1, FeedbackVector()); | 1194 __ Move(r1, FeedbackVector()); |
1201 __ mov(r2, Operand(Smi::FromInt(TypeFeedbackInfo::kForInSlowCaseMarker))); | 1195 __ mov(r2, Operand(TypeFeedbackInfo::MegamorphicSentinel(isolate()))); |
1202 __ str(r2, FieldMemOperand(r1, FixedArray::OffsetOfElementAt(slot))); | 1196 __ str(r2, FieldMemOperand(r1, FixedArray::OffsetOfElementAt(slot))); |
1203 | 1197 |
1204 __ mov(r1, Operand(Smi::FromInt(1))); // Smi indicates slow check | 1198 __ mov(r1, Operand(Smi::FromInt(1))); // Smi indicates slow check |
1205 __ ldr(r2, MemOperand(sp, 0 * kPointerSize)); // Get enumerated object | 1199 __ ldr(r2, MemOperand(sp, 0 * kPointerSize)); // Get enumerated object |
1206 STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_SPEC_OBJECT_TYPE); | 1200 STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_SPEC_OBJECT_TYPE); |
1207 __ CompareObjectType(r2, r3, r3, LAST_JS_PROXY_TYPE); | 1201 __ CompareObjectType(r2, r3, r3, LAST_JS_PROXY_TYPE); |
1208 __ b(gt, &non_proxy); | 1202 __ b(gt, &non_proxy); |
1209 __ mov(r1, Operand(Smi::FromInt(0))); // Zero indicates proxy | 1203 __ mov(r1, Operand(Smi::FromInt(0))); // Zero indicates proxy |
1210 __ bind(&non_proxy); | 1204 __ bind(&non_proxy); |
1211 __ Push(r1, r0); // Smi and array | 1205 __ Push(r1, r0); // Smi and array |
(...skipping 1502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2714 ZoneList<Expression*>* args = expr->arguments(); | 2708 ZoneList<Expression*>* args = expr->arguments(); |
2715 int arg_count = args->length(); | 2709 int arg_count = args->length(); |
2716 { PreservePositionScope scope(masm()->positions_recorder()); | 2710 { PreservePositionScope scope(masm()->positions_recorder()); |
2717 for (int i = 0; i < arg_count; i++) { | 2711 for (int i = 0; i < arg_count; i++) { |
2718 VisitForStackValue(args->at(i)); | 2712 VisitForStackValue(args->at(i)); |
2719 } | 2713 } |
2720 } | 2714 } |
2721 // Record source position for debugger. | 2715 // Record source position for debugger. |
2722 SetSourcePosition(expr->position()); | 2716 SetSourcePosition(expr->position()); |
2723 | 2717 |
2724 Handle<Object> uninitialized = | |
2725 TypeFeedbackInfo::UninitializedSentinel(isolate()); | |
2726 StoreFeedbackVectorSlot(expr->CallFeedbackSlot(), uninitialized); | |
2727 __ Move(r2, FeedbackVector()); | 2718 __ Move(r2, FeedbackVector()); |
2728 __ mov(r3, Operand(Smi::FromInt(expr->CallFeedbackSlot()))); | 2719 __ mov(r3, Operand(Smi::FromInt(expr->CallFeedbackSlot()))); |
2729 | 2720 |
2730 // Record call targets in unoptimized code. | 2721 // Record call targets in unoptimized code. |
2731 CallFunctionStub stub(isolate(), arg_count, RECORD_CALL_TARGET); | 2722 CallFunctionStub stub(isolate(), arg_count, RECORD_CALL_TARGET); |
2732 __ ldr(r1, MemOperand(sp, (arg_count + 1) * kPointerSize)); | 2723 __ ldr(r1, MemOperand(sp, (arg_count + 1) * kPointerSize)); |
2733 __ CallStub(&stub); | 2724 __ CallStub(&stub); |
2734 RecordJSReturnSite(expr); | 2725 RecordJSReturnSite(expr); |
2735 // Restore context register. | 2726 // Restore context register. |
2736 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 2727 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2903 | 2894 |
2904 // Call the construct call builtin that handles allocation and | 2895 // Call the construct call builtin that handles allocation and |
2905 // constructor invocation. | 2896 // constructor invocation. |
2906 SetSourcePosition(expr->position()); | 2897 SetSourcePosition(expr->position()); |
2907 | 2898 |
2908 // Load function and argument count into r1 and r0. | 2899 // Load function and argument count into r1 and r0. |
2909 __ mov(r0, Operand(arg_count)); | 2900 __ mov(r0, Operand(arg_count)); |
2910 __ ldr(r1, MemOperand(sp, arg_count * kPointerSize)); | 2901 __ ldr(r1, MemOperand(sp, arg_count * kPointerSize)); |
2911 | 2902 |
2912 // Record call targets in unoptimized code. | 2903 // Record call targets in unoptimized code. |
2913 Handle<Object> uninitialized = | |
2914 TypeFeedbackInfo::UninitializedSentinel(isolate()); | |
2915 StoreFeedbackVectorSlot(expr->CallNewFeedbackSlot(), uninitialized); | |
2916 if (FLAG_pretenuring_call_new) { | 2904 if (FLAG_pretenuring_call_new) { |
2917 StoreFeedbackVectorSlot(expr->AllocationSiteFeedbackSlot(), | 2905 EnsureSlotContainsAllocationSite(expr->AllocationSiteFeedbackSlot()); |
2918 isolate()->factory()->NewAllocationSite()); | |
2919 ASSERT(expr->AllocationSiteFeedbackSlot() == | 2906 ASSERT(expr->AllocationSiteFeedbackSlot() == |
2920 expr->CallNewFeedbackSlot() + 1); | 2907 expr->CallNewFeedbackSlot() + 1); |
2921 } | 2908 } |
2922 | 2909 |
2923 __ Move(r2, FeedbackVector()); | 2910 __ Move(r2, FeedbackVector()); |
2924 __ mov(r3, Operand(Smi::FromInt(expr->CallNewFeedbackSlot()))); | 2911 __ mov(r3, Operand(Smi::FromInt(expr->CallNewFeedbackSlot()))); |
2925 | 2912 |
2926 CallConstructStub stub(isolate(), RECORD_CALL_TARGET); | 2913 CallConstructStub stub(isolate(), RECORD_CALL_TARGET); |
2927 __ Call(stub.GetCode(), RelocInfo::CONSTRUCT_CALL); | 2914 __ Call(stub.GetCode(), RelocInfo::CONSTRUCT_CALL); |
2928 PrepareForBailoutForId(expr->ReturnId(), TOS_REG); | 2915 PrepareForBailoutForId(expr->ReturnId(), TOS_REG); |
(...skipping 1986 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4915 | 4902 |
4916 ASSERT(interrupt_address == | 4903 ASSERT(interrupt_address == |
4917 isolate->builtins()->OsrAfterStackCheck()->entry()); | 4904 isolate->builtins()->OsrAfterStackCheck()->entry()); |
4918 return OSR_AFTER_STACK_CHECK; | 4905 return OSR_AFTER_STACK_CHECK; |
4919 } | 4906 } |
4920 | 4907 |
4921 | 4908 |
4922 } } // namespace v8::internal | 4909 } } // namespace v8::internal |
4923 | 4910 |
4924 #endif // V8_TARGET_ARCH_ARM | 4911 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |