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