OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_ARM64 | 7 #if V8_TARGET_ARCH_ARM64 |
8 | 8 |
9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 2888 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2899 | 2899 |
2900 void FullCodeGenerator::VisitCallNew(CallNew* expr) { | 2900 void FullCodeGenerator::VisitCallNew(CallNew* expr) { |
2901 Comment cmnt(masm_, "[ CallNew"); | 2901 Comment cmnt(masm_, "[ CallNew"); |
2902 // According to ECMA-262, section 11.2.2, page 44, the function | 2902 // According to ECMA-262, section 11.2.2, page 44, the function |
2903 // expression in new calls must be evaluated before the | 2903 // expression in new calls must be evaluated before the |
2904 // arguments. | 2904 // arguments. |
2905 | 2905 |
2906 // Push constructor on the stack. If it's not a function it's used as | 2906 // Push constructor on the stack. If it's not a function it's used as |
2907 // receiver for CALL_NON_FUNCTION, otherwise the value on the stack is | 2907 // receiver for CALL_NON_FUNCTION, otherwise the value on the stack is |
2908 // ignored. | 2908 // ignored. |
2909 if (expr->expression()->IsSuperReference()) { | 2909 DCHECK(!expr->expression()->IsSuperReference()); |
2910 EmitLoadSuperConstructor(expr->expression()->AsSuperReference()); | 2910 VisitForStackValue(expr->expression()); |
2911 __ Push(result_register()); | |
2912 } else { | |
2913 VisitForStackValue(expr->expression()); | |
2914 } | |
2915 | 2911 |
2916 // Push the arguments ("left-to-right") on the stack. | 2912 // Push the arguments ("left-to-right") on the stack. |
2917 ZoneList<Expression*>* args = expr->arguments(); | 2913 ZoneList<Expression*>* args = expr->arguments(); |
2918 int arg_count = args->length(); | 2914 int arg_count = args->length(); |
2919 for (int i = 0; i < arg_count; i++) { | 2915 for (int i = 0; i < arg_count; i++) { |
2920 VisitForStackValue(args->at(i)); | 2916 VisitForStackValue(args->at(i)); |
2921 } | 2917 } |
2922 | 2918 |
2923 // Call the construct call builtin that handles allocation and | 2919 // Call the construct call builtin that handles allocation and |
2924 // constructor invocation. | 2920 // constructor invocation. |
(...skipping 2480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5405 return previous_; | 5401 return previous_; |
5406 } | 5402 } |
5407 | 5403 |
5408 | 5404 |
5409 #undef __ | 5405 #undef __ |
5410 | 5406 |
5411 | 5407 |
5412 } } // namespace v8::internal | 5408 } } // namespace v8::internal |
5413 | 5409 |
5414 #endif // V8_TARGET_ARCH_ARM64 | 5410 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |