OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_PPC | 7 #if V8_TARGET_ARCH_PPC |
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 3188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3199 | 3199 |
3200 void FullCodeGenerator::VisitCallNew(CallNew* expr) { | 3200 void FullCodeGenerator::VisitCallNew(CallNew* expr) { |
3201 Comment cmnt(masm_, "[ CallNew"); | 3201 Comment cmnt(masm_, "[ CallNew"); |
3202 // According to ECMA-262, section 11.2.2, page 44, the function | 3202 // According to ECMA-262, section 11.2.2, page 44, the function |
3203 // expression in new calls must be evaluated before the | 3203 // expression in new calls must be evaluated before the |
3204 // arguments. | 3204 // arguments. |
3205 | 3205 |
3206 // Push constructor on the stack. If it's not a function it's used as | 3206 // Push constructor on the stack. If it's not a function it's used as |
3207 // receiver for CALL_NON_FUNCTION, otherwise the value on the stack is | 3207 // receiver for CALL_NON_FUNCTION, otherwise the value on the stack is |
3208 // ignored. | 3208 // ignored. |
3209 if (expr->expression()->IsSuperReference()) { | 3209 DCHECK(!expr->expression()->IsSuperReference()); |
3210 EmitLoadSuperConstructor(expr->expression()->AsSuperReference()); | 3210 VisitForStackValue(expr->expression()); |
3211 __ Push(result_register()); | |
3212 } else { | |
3213 VisitForStackValue(expr->expression()); | |
3214 } | |
3215 | 3211 |
3216 // Push the arguments ("left-to-right") on the stack. | 3212 // Push the arguments ("left-to-right") on the stack. |
3217 ZoneList<Expression*>* args = expr->arguments(); | 3213 ZoneList<Expression*>* args = expr->arguments(); |
3218 int arg_count = args->length(); | 3214 int arg_count = args->length(); |
3219 for (int i = 0; i < arg_count; i++) { | 3215 for (int i = 0; i < arg_count; i++) { |
3220 VisitForStackValue(args->at(i)); | 3216 VisitForStackValue(args->at(i)); |
3221 } | 3217 } |
3222 | 3218 |
3223 // Call the construct call builtin that handles allocation and | 3219 // Call the construct call builtin that handles allocation and |
3224 // constructor invocation. | 3220 // constructor invocation. |
(...skipping 2146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5371 return ON_STACK_REPLACEMENT; | 5367 return ON_STACK_REPLACEMENT; |
5372 } | 5368 } |
5373 | 5369 |
5374 DCHECK(interrupt_address == | 5370 DCHECK(interrupt_address == |
5375 isolate->builtins()->OsrAfterStackCheck()->entry()); | 5371 isolate->builtins()->OsrAfterStackCheck()->entry()); |
5376 return OSR_AFTER_STACK_CHECK; | 5372 return OSR_AFTER_STACK_CHECK; |
5377 } | 5373 } |
5378 } | 5374 } |
5379 } // namespace v8::internal | 5375 } // namespace v8::internal |
5380 #endif // V8_TARGET_ARCH_PPC | 5376 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |