OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #if V8_TARGET_ARCH_X64 | 5 #if V8_TARGET_ARCH_X64 |
6 | 6 |
7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
10 #include "src/compiler.h" | 10 #include "src/compiler.h" |
(...skipping 1066 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1077 | 1077 |
1078 __ bind(&no_descriptors); | 1078 __ bind(&no_descriptors); |
1079 __ addp(rsp, Immediate(kPointerSize)); | 1079 __ addp(rsp, Immediate(kPointerSize)); |
1080 __ jmp(&exit); | 1080 __ jmp(&exit); |
1081 | 1081 |
1082 // We got a fixed array in register rax. Iterate through that. | 1082 // We got a fixed array in register rax. Iterate through that. |
1083 Label non_proxy; | 1083 Label non_proxy; |
1084 __ bind(&fixed_array); | 1084 __ bind(&fixed_array); |
1085 | 1085 |
1086 // No need for a write barrier, we are storing a Smi in the feedback vector. | 1086 // No need for a write barrier, we are storing a Smi in the feedback vector. |
1087 __ Move(rbx, FeedbackVector()); | 1087 __ EmitLoadTypeFeedbackVector(rbx); |
1088 int vector_index = FeedbackVector()->GetIndex(slot); | 1088 int vector_index = SmiFromSlot(slot)->value(); |
1089 __ Move(FieldOperand(rbx, FixedArray::OffsetOfElementAt(vector_index)), | 1089 __ Move(FieldOperand(rbx, FixedArray::OffsetOfElementAt(vector_index)), |
1090 TypeFeedbackVector::MegamorphicSentinel(isolate())); | 1090 TypeFeedbackVector::MegamorphicSentinel(isolate())); |
1091 __ Move(rbx, Smi::FromInt(1)); // Smi indicates slow check | 1091 __ Move(rbx, Smi::FromInt(1)); // Smi indicates slow check |
1092 __ movp(rcx, Operand(rsp, 0 * kPointerSize)); // Get enumerated object | 1092 __ movp(rcx, Operand(rsp, 0 * kPointerSize)); // Get enumerated object |
1093 STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_SPEC_OBJECT_TYPE); | 1093 STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_SPEC_OBJECT_TYPE); |
1094 __ CmpObjectType(rcx, LAST_JS_PROXY_TYPE, rcx); | 1094 __ CmpObjectType(rcx, LAST_JS_PROXY_TYPE, rcx); |
1095 __ j(above, &non_proxy); | 1095 __ j(above, &non_proxy); |
1096 __ Move(rbx, Smi::FromInt(0)); // Zero indicates proxy | 1096 __ Move(rbx, Smi::FromInt(0)); // Zero indicates proxy |
1097 __ bind(&non_proxy); | 1097 __ bind(&non_proxy); |
1098 __ Push(rbx); // Smi | 1098 __ Push(rbx); // Smi |
(...skipping 1960 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3059 | 3059 |
3060 // Call the construct call builtin that handles allocation and | 3060 // Call the construct call builtin that handles allocation and |
3061 // constructor invocation. | 3061 // constructor invocation. |
3062 SetConstructCallPosition(expr); | 3062 SetConstructCallPosition(expr); |
3063 | 3063 |
3064 // Load function and argument count into rdi and rax. | 3064 // Load function and argument count into rdi and rax. |
3065 __ Set(rax, arg_count); | 3065 __ Set(rax, arg_count); |
3066 __ movp(rdi, Operand(rsp, arg_count * kPointerSize)); | 3066 __ movp(rdi, Operand(rsp, arg_count * kPointerSize)); |
3067 | 3067 |
3068 // Record call targets in unoptimized code, but not in the snapshot. | 3068 // Record call targets in unoptimized code, but not in the snapshot. |
3069 __ Move(rbx, FeedbackVector()); | 3069 __ EmitLoadTypeFeedbackVector(rbx); |
3070 __ Move(rdx, SmiFromSlot(expr->CallNewFeedbackSlot())); | 3070 __ Move(rdx, SmiFromSlot(expr->CallNewFeedbackSlot())); |
3071 | 3071 |
3072 CallConstructStub stub(isolate(), RECORD_CONSTRUCTOR_TARGET); | 3072 CallConstructStub stub(isolate(), RECORD_CONSTRUCTOR_TARGET); |
3073 __ Call(stub.GetCode(), RelocInfo::CONSTRUCT_CALL); | 3073 __ Call(stub.GetCode(), RelocInfo::CONSTRUCT_CALL); |
3074 PrepareForBailoutForId(expr->ReturnId(), TOS_REG); | 3074 PrepareForBailoutForId(expr->ReturnId(), TOS_REG); |
3075 // Restore context register. | 3075 // Restore context register. |
3076 __ movp(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); | 3076 __ movp(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); |
3077 context()->Plug(rax); | 3077 context()->Plug(rax); |
3078 } | 3078 } |
3079 | 3079 |
(...skipping 19 matching lines...) Expand all Loading... |
3099 | 3099 |
3100 // Load original constructor into rcx. | 3100 // Load original constructor into rcx. |
3101 VisitForAccumulatorValue(super_call_ref->new_target_var()); | 3101 VisitForAccumulatorValue(super_call_ref->new_target_var()); |
3102 __ movp(rcx, result_register()); | 3102 __ movp(rcx, result_register()); |
3103 | 3103 |
3104 // Load function and argument count into rdi and rax. | 3104 // Load function and argument count into rdi and rax. |
3105 __ Set(rax, arg_count); | 3105 __ Set(rax, arg_count); |
3106 __ movp(rdi, Operand(rsp, arg_count * kPointerSize)); | 3106 __ movp(rdi, Operand(rsp, arg_count * kPointerSize)); |
3107 | 3107 |
3108 // Record call targets in unoptimized code. | 3108 // Record call targets in unoptimized code. |
3109 __ Move(rbx, FeedbackVector()); | 3109 __ EmitLoadTypeFeedbackVector(rbx); |
3110 __ Move(rdx, SmiFromSlot(expr->CallFeedbackSlot())); | 3110 __ Move(rdx, SmiFromSlot(expr->CallFeedbackSlot())); |
3111 | 3111 |
3112 CallConstructStub stub(isolate(), SUPER_CALL_RECORD_TARGET); | 3112 CallConstructStub stub(isolate(), SUPER_CALL_RECORD_TARGET); |
3113 __ call(stub.GetCode(), RelocInfo::CONSTRUCT_CALL); | 3113 __ call(stub.GetCode(), RelocInfo::CONSTRUCT_CALL); |
3114 | 3114 |
3115 RecordJSReturnSite(expr); | 3115 RecordJSReturnSite(expr); |
3116 | 3116 |
3117 // Restore context register. | 3117 // Restore context register. |
3118 __ movp(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); | 3118 __ movp(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); |
3119 | 3119 |
(...skipping 2022 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5142 Assembler::target_address_at(call_target_address, | 5142 Assembler::target_address_at(call_target_address, |
5143 unoptimized_code)); | 5143 unoptimized_code)); |
5144 return OSR_AFTER_STACK_CHECK; | 5144 return OSR_AFTER_STACK_CHECK; |
5145 } | 5145 } |
5146 | 5146 |
5147 | 5147 |
5148 } // namespace internal | 5148 } // namespace internal |
5149 } // namespace v8 | 5149 } // namespace v8 |
5150 | 5150 |
5151 #endif // V8_TARGET_ARCH_X64 | 5151 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |