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 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_IA32 | 7 #if V8_TARGET_ARCH_IA32 |
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 3079 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3090 | 3090 |
3091 void FullCodeGenerator::VisitCallNew(CallNew* expr) { | 3091 void FullCodeGenerator::VisitCallNew(CallNew* expr) { |
3092 Comment cmnt(masm_, "[ CallNew"); | 3092 Comment cmnt(masm_, "[ CallNew"); |
3093 // According to ECMA-262, section 11.2.2, page 44, the function | 3093 // According to ECMA-262, section 11.2.2, page 44, the function |
3094 // expression in new calls must be evaluated before the | 3094 // expression in new calls must be evaluated before the |
3095 // arguments. | 3095 // arguments. |
3096 | 3096 |
3097 // Push constructor on the stack. If it's not a function it's used as | 3097 // Push constructor on the stack. If it's not a function it's used as |
3098 // receiver for CALL_NON_FUNCTION, otherwise the value on the stack is | 3098 // receiver for CALL_NON_FUNCTION, otherwise the value on the stack is |
3099 // ignored. | 3099 // ignored. |
3100 if (expr->expression()->IsSuperReference()) { | 3100 DCHECK(!expr->expression()->IsSuperReference()); |
3101 EmitLoadSuperConstructor(expr->expression()->AsSuperReference()); | 3101 VisitForStackValue(expr->expression()); |
3102 __ push(result_register()); | |
3103 } else { | |
3104 VisitForStackValue(expr->expression()); | |
3105 } | |
3106 | 3102 |
3107 // Push the arguments ("left-to-right") on the stack. | 3103 // Push the arguments ("left-to-right") on the stack. |
3108 ZoneList<Expression*>* args = expr->arguments(); | 3104 ZoneList<Expression*>* args = expr->arguments(); |
3109 int arg_count = args->length(); | 3105 int arg_count = args->length(); |
3110 for (int i = 0; i < arg_count; i++) { | 3106 for (int i = 0; i < arg_count; i++) { |
3111 VisitForStackValue(args->at(i)); | 3107 VisitForStackValue(args->at(i)); |
3112 } | 3108 } |
3113 | 3109 |
3114 // Call the construct call builtin that handles allocation and | 3110 // Call the construct call builtin that handles allocation and |
3115 // constructor invocation. | 3111 // constructor invocation. |
(...skipping 2176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5292 DCHECK_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), | 5288 DCHECK_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), |
5293 Assembler::target_address_at(call_target_address, | 5289 Assembler::target_address_at(call_target_address, |
5294 unoptimized_code)); | 5290 unoptimized_code)); |
5295 return OSR_AFTER_STACK_CHECK; | 5291 return OSR_AFTER_STACK_CHECK; |
5296 } | 5292 } |
5297 | 5293 |
5298 | 5294 |
5299 } } // namespace v8::internal | 5295 } } // namespace v8::internal |
5300 | 5296 |
5301 #endif // V8_TARGET_ARCH_IA32 | 5297 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |