OLD | NEW |
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 Loading... |
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 Loading... |
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 1226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2407 ZoneList<Expression*>* args = expr->arguments(); | 2401 ZoneList<Expression*>* args = expr->arguments(); |
2408 int arg_count = args->length(); | 2402 int arg_count = args->length(); |
2409 { PreservePositionScope scope(masm()->positions_recorder()); | 2403 { PreservePositionScope scope(masm()->positions_recorder()); |
2410 for (int i = 0; i < arg_count; i++) { | 2404 for (int i = 0; i < arg_count; i++) { |
2411 VisitForStackValue(args->at(i)); | 2405 VisitForStackValue(args->at(i)); |
2412 } | 2406 } |
2413 } | 2407 } |
2414 // Record source position for debugger. | 2408 // Record source position for debugger. |
2415 SetSourcePosition(expr->position()); | 2409 SetSourcePosition(expr->position()); |
2416 | 2410 |
2417 Handle<Object> uninitialized = | |
2418 TypeFeedbackInfo::UninitializedSentinel(isolate()); | |
2419 StoreFeedbackVectorSlot(expr->CallFeedbackSlot(), uninitialized); | |
2420 __ LoadObject(x2, FeedbackVector()); | 2411 __ LoadObject(x2, FeedbackVector()); |
2421 __ Mov(x3, Operand(Smi::FromInt(expr->CallFeedbackSlot()))); | 2412 __ Mov(x3, Operand(Smi::FromInt(expr->CallFeedbackSlot()))); |
2422 | 2413 |
2423 // Record call targets in unoptimized code. | 2414 // Record call targets in unoptimized code. |
2424 CallFunctionStub stub(arg_count, RECORD_CALL_TARGET); | 2415 CallFunctionStub stub(arg_count, RECORD_CALL_TARGET); |
2425 __ Peek(x1, (arg_count + 1) * kXRegSize); | 2416 __ Peek(x1, (arg_count + 1) * kXRegSize); |
2426 __ CallStub(&stub); | 2417 __ CallStub(&stub); |
2427 RecordJSReturnSite(expr); | 2418 RecordJSReturnSite(expr); |
2428 // Restore context register. | 2419 // Restore context register. |
2429 __ Ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 2420 __ Ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2606 | 2597 |
2607 // Call the construct call builtin that handles allocation and | 2598 // Call the construct call builtin that handles allocation and |
2608 // constructor invocation. | 2599 // constructor invocation. |
2609 SetSourcePosition(expr->position()); | 2600 SetSourcePosition(expr->position()); |
2610 | 2601 |
2611 // Load function and argument count into x1 and x0. | 2602 // Load function and argument count into x1 and x0. |
2612 __ Mov(x0, arg_count); | 2603 __ Mov(x0, arg_count); |
2613 __ Peek(x1, arg_count * kXRegSize); | 2604 __ Peek(x1, arg_count * kXRegSize); |
2614 | 2605 |
2615 // Record call targets in unoptimized code. | 2606 // Record call targets in unoptimized code. |
2616 Handle<Object> uninitialized = | |
2617 TypeFeedbackInfo::UninitializedSentinel(isolate()); | |
2618 StoreFeedbackVectorSlot(expr->CallNewFeedbackSlot(), uninitialized); | |
2619 __ LoadObject(x2, FeedbackVector()); | 2607 __ LoadObject(x2, FeedbackVector()); |
2620 __ Mov(x3, Operand(Smi::FromInt(expr->CallNewFeedbackSlot()))); | 2608 __ Mov(x3, Operand(Smi::FromInt(expr->CallNewFeedbackSlot()))); |
2621 | 2609 |
2622 CallConstructStub stub(RECORD_CALL_TARGET); | 2610 CallConstructStub stub(RECORD_CALL_TARGET); |
2623 __ Call(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL); | 2611 __ Call(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL); |
2624 PrepareForBailoutForId(expr->ReturnId(), TOS_REG); | 2612 PrepareForBailoutForId(expr->ReturnId(), TOS_REG); |
2625 context()->Plug(x0); | 2613 context()->Plug(x0); |
2626 } | 2614 } |
2627 | 2615 |
2628 | 2616 |
(...skipping 2350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4979 return previous_; | 4967 return previous_; |
4980 } | 4968 } |
4981 | 4969 |
4982 | 4970 |
4983 #undef __ | 4971 #undef __ |
4984 | 4972 |
4985 | 4973 |
4986 } } // namespace v8::internal | 4974 } } // namespace v8::internal |
4987 | 4975 |
4988 #endif // V8_TARGET_ARCH_A64 | 4976 #endif // V8_TARGET_ARCH_A64 |
OLD | NEW |