Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Side by Side Diff: src/arm64/full-codegen-arm64.cc

Issue 665773003: Classes: implement 'new super'. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: debug compilation fixed Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/arm/full-codegen-arm.cc ('k') | src/full-codegen.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 2610 matching lines...) Expand 10 before | Expand all | Expand 10 after
2621 __ Mov(x13, Smi::FromInt(scope()->start_position())); 2621 __ Mov(x13, Smi::FromInt(scope()->start_position()));
2622 2622
2623 // Push. 2623 // Push.
2624 __ Push(x10, x11, x12, x13); 2624 __ Push(x10, x11, x12, x13);
2625 2625
2626 // Do the runtime call. 2626 // Do the runtime call.
2627 __ CallRuntime(Runtime::kResolvePossiblyDirectEval, 5); 2627 __ CallRuntime(Runtime::kResolvePossiblyDirectEval, 5);
2628 } 2628 }
2629 2629
2630 2630
2631 void FullCodeGenerator::EmitLoadSuperConstructor(SuperReference* super_ref) {
2632 DCHECK(super_ref != NULL);
2633 __ ldr(x0, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
2634 __ Push(x0);
2635 __ CallRuntime(Runtime::kGetPrototype, 1);
2636 }
2637
2638
2631 void FullCodeGenerator::VisitCall(Call* expr) { 2639 void FullCodeGenerator::VisitCall(Call* expr) {
2632 #ifdef DEBUG 2640 #ifdef DEBUG
2633 // We want to verify that RecordJSReturnSite gets called on all paths 2641 // We want to verify that RecordJSReturnSite gets called on all paths
2634 // through this function. Avoid early returns. 2642 // through this function. Avoid early returns.
2635 expr->return_is_recorded_ = false; 2643 expr->return_is_recorded_ = false;
2636 #endif 2644 #endif
2637 2645
2638 Comment cmnt(masm_, "[ Call"); 2646 Comment cmnt(masm_, "[ Call");
2639 Expression* callee = expr->expression(); 2647 Expression* callee = expr->expression();
2640 Call::CallType call_type = expr->GetCallType(isolate()); 2648 Call::CallType call_type = expr->GetCallType(isolate());
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
2739 VisitForStackValue(property->obj()); 2747 VisitForStackValue(property->obj());
2740 } 2748 }
2741 if (is_named_call) { 2749 if (is_named_call) {
2742 EmitCallWithLoadIC(expr); 2750 EmitCallWithLoadIC(expr);
2743 } else { 2751 } else {
2744 EmitKeyedCallWithLoadIC(expr, property->key()); 2752 EmitKeyedCallWithLoadIC(expr, property->key());
2745 } 2753 }
2746 } 2754 }
2747 } else if (call_type == Call::SUPER_CALL) { 2755 } else if (call_type == Call::SUPER_CALL) {
2748 SuperReference* super_ref = callee->AsSuperReference(); 2756 SuperReference* super_ref = callee->AsSuperReference();
2749 DCHECK(super_ref != NULL); 2757 EmitLoadSuperConstructor(super_ref);
2750 __ Ldr(x0, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
2751 __ Push(x0);
2752 __ CallRuntime(Runtime::kGetPrototype, 1);
2753 __ Push(result_register()); 2758 __ Push(result_register());
2754 VisitForStackValue(super_ref->this_var()); 2759 VisitForStackValue(super_ref->this_var());
2755 EmitCall(expr, CallICState::METHOD); 2760 EmitCall(expr, CallICState::METHOD);
2756 } else { 2761 } else {
2757 DCHECK(call_type == Call::OTHER_CALL); 2762 DCHECK(call_type == Call::OTHER_CALL);
2758 // Call to an arbitrary expression not handled specially above. 2763 // Call to an arbitrary expression not handled specially above.
2759 { PreservePositionScope scope(masm()->positions_recorder()); 2764 { PreservePositionScope scope(masm()->positions_recorder());
2760 VisitForStackValue(callee); 2765 VisitForStackValue(callee);
2761 } 2766 }
2762 __ LoadRoot(x1, Heap::kUndefinedValueRootIndex); 2767 __ LoadRoot(x1, Heap::kUndefinedValueRootIndex);
(...skipping 11 matching lines...) Expand all
2774 2779
2775 void FullCodeGenerator::VisitCallNew(CallNew* expr) { 2780 void FullCodeGenerator::VisitCallNew(CallNew* expr) {
2776 Comment cmnt(masm_, "[ CallNew"); 2781 Comment cmnt(masm_, "[ CallNew");
2777 // According to ECMA-262, section 11.2.2, page 44, the function 2782 // According to ECMA-262, section 11.2.2, page 44, the function
2778 // expression in new calls must be evaluated before the 2783 // expression in new calls must be evaluated before the
2779 // arguments. 2784 // arguments.
2780 2785
2781 // Push constructor on the stack. If it's not a function it's used as 2786 // Push constructor on the stack. If it's not a function it's used as
2782 // receiver for CALL_NON_FUNCTION, otherwise the value on the stack is 2787 // receiver for CALL_NON_FUNCTION, otherwise the value on the stack is
2783 // ignored. 2788 // ignored.
2784 VisitForStackValue(expr->expression()); 2789 if (expr->expression()->IsSuperReference()) {
2790 EmitLoadSuperConstructor(expr->expression()->AsSuperReference());
2791 __ Push(result_register());
2792 } else {
2793 VisitForStackValue(expr->expression());
2794 }
2785 2795
2786 // Push the arguments ("left-to-right") on the stack. 2796 // Push the arguments ("left-to-right") on the stack.
2787 ZoneList<Expression*>* args = expr->arguments(); 2797 ZoneList<Expression*>* args = expr->arguments();
2788 int arg_count = args->length(); 2798 int arg_count = args->length();
2789 for (int i = 0; i < arg_count; i++) { 2799 for (int i = 0; i < arg_count; i++) {
2790 VisitForStackValue(args->at(i)); 2800 VisitForStackValue(args->at(i));
2791 } 2801 }
2792 2802
2793 // Call the construct call builtin that handles allocation and 2803 // Call the construct call builtin that handles allocation and
2794 // constructor invocation. 2804 // constructor invocation.
(...skipping 2452 matching lines...) Expand 10 before | Expand all | Expand 10 after
5247 return previous_; 5257 return previous_;
5248 } 5258 }
5249 5259
5250 5260
5251 #undef __ 5261 #undef __
5252 5262
5253 5263
5254 } } // namespace v8::internal 5264 } } // namespace v8::internal
5255 5265
5256 #endif // V8_TARGET_ARCH_ARM64 5266 #endif // V8_TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « src/arm/full-codegen-arm.cc ('k') | src/full-codegen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698