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/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 3127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3138 __ CmpInstanceType(map, FIRST_JS_PROXY_TYPE); | 3138 __ CmpInstanceType(map, FIRST_JS_PROXY_TYPE); |
3139 __ j(less, if_false); | 3139 __ j(less, if_false); |
3140 __ CmpInstanceType(map, LAST_JS_PROXY_TYPE); | 3140 __ CmpInstanceType(map, LAST_JS_PROXY_TYPE); |
3141 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | 3141 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
3142 Split(less_equal, if_true, if_false, fall_through); | 3142 Split(less_equal, if_true, if_false, fall_through); |
3143 | 3143 |
3144 context()->Plug(if_true, if_false); | 3144 context()->Plug(if_true, if_false); |
3145 } | 3145 } |
3146 | 3146 |
3147 | 3147 |
3148 void FullCodeGenerator::EmitIsConstructCall(CallRuntime* expr) { | |
3149 DCHECK(expr->arguments()->length() == 0); | |
3150 | |
3151 Label materialize_true, materialize_false; | |
3152 Label* if_true = NULL; | |
3153 Label* if_false = NULL; | |
3154 Label* fall_through = NULL; | |
3155 context()->PrepareTest(&materialize_true, &materialize_false, | |
3156 &if_true, &if_false, &fall_through); | |
3157 | |
3158 // Get the frame pointer for the calling frame. | |
3159 __ movp(rax, Operand(rbp, StandardFrameConstants::kCallerFPOffset)); | |
3160 | |
3161 // Skip the arguments adaptor frame if it exists. | |
3162 Label check_frame_marker; | |
3163 __ Cmp(Operand(rax, StandardFrameConstants::kContextOffset), | |
3164 Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR)); | |
3165 __ j(not_equal, &check_frame_marker); | |
3166 __ movp(rax, Operand(rax, StandardFrameConstants::kCallerFPOffset)); | |
3167 | |
3168 // Check the marker in the calling frame. | |
3169 __ bind(&check_frame_marker); | |
3170 __ Cmp(Operand(rax, StandardFrameConstants::kMarkerOffset), | |
3171 Smi::FromInt(StackFrame::CONSTRUCT)); | |
3172 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | |
3173 Split(equal, if_true, if_false, fall_through); | |
3174 | |
3175 context()->Plug(if_true, if_false); | |
3176 } | |
3177 | |
3178 | |
3179 void FullCodeGenerator::EmitObjectEquals(CallRuntime* expr) { | 3148 void FullCodeGenerator::EmitObjectEquals(CallRuntime* expr) { |
3180 ZoneList<Expression*>* args = expr->arguments(); | 3149 ZoneList<Expression*>* args = expr->arguments(); |
3181 DCHECK(args->length() == 2); | 3150 DCHECK(args->length() == 2); |
3182 | 3151 |
3183 // Load the two objects into registers and perform the comparison. | 3152 // Load the two objects into registers and perform the comparison. |
3184 VisitForStackValue(args->at(0)); | 3153 VisitForStackValue(args->at(0)); |
3185 VisitForAccumulatorValue(args->at(1)); | 3154 VisitForAccumulatorValue(args->at(1)); |
3186 | 3155 |
3187 Label materialize_true, materialize_false; | 3156 Label materialize_true, materialize_false; |
3188 Label* if_true = NULL; | 3157 Label* if_true = NULL; |
(...skipping 1690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4879 Assembler::target_address_at(call_target_address, | 4848 Assembler::target_address_at(call_target_address, |
4880 unoptimized_code)); | 4849 unoptimized_code)); |
4881 return OSR_AFTER_STACK_CHECK; | 4850 return OSR_AFTER_STACK_CHECK; |
4882 } | 4851 } |
4883 | 4852 |
4884 | 4853 |
4885 } // namespace internal | 4854 } // namespace internal |
4886 } // namespace v8 | 4855 } // namespace v8 |
4887 | 4856 |
4888 #endif // V8_TARGET_ARCH_X64 | 4857 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |