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

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

Issue 630003002: MIPS: Support for super keyed loads where key is a name. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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/mips/full-codegen-mips.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_MIPS64 7 #if V8_TARGET_ARCH_MIPS64
8 8
9 // Note on Mips implementation: 9 // Note on Mips implementation:
10 // 10 //
(...skipping 2341 matching lines...) Expand 10 before | Expand all | Expand 10 after
2352 if (FLAG_vector_ics) { 2352 if (FLAG_vector_ics) {
2353 __ li(VectorLoadICDescriptor::SlotRegister(), 2353 __ li(VectorLoadICDescriptor::SlotRegister(),
2354 Operand(Smi::FromInt(prop->PropertyFeedbackSlot()))); 2354 Operand(Smi::FromInt(prop->PropertyFeedbackSlot())));
2355 CallIC(ic); 2355 CallIC(ic);
2356 } else { 2356 } else {
2357 CallIC(ic, prop->PropertyFeedbackId()); 2357 CallIC(ic, prop->PropertyFeedbackId());
2358 } 2358 }
2359 } 2359 }
2360 2360
2361 2361
2362 void FullCodeGenerator::EmitKeyedSuperPropertyLoad(Property* prop) {
2363 // Stack: receiver, home_object, key.
2364 SetSourcePosition(prop->position());
2365
2366 __ CallRuntime(Runtime::kLoadKeyedFromSuper, 3);
2367 }
2368
2369
2362 void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr, 2370 void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr,
2363 Token::Value op, 2371 Token::Value op,
2364 OverwriteMode mode, 2372 OverwriteMode mode,
2365 Expression* left_expr, 2373 Expression* left_expr,
2366 Expression* right_expr) { 2374 Expression* right_expr) {
2367 Label done, smi_case, stub_call; 2375 Label done, smi_case, stub_call;
2368 2376
2369 Register scratch1 = a2; 2377 Register scratch1 = a2;
2370 Register scratch2 = a3; 2378 Register scratch2 = a3;
2371 2379
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
2663 EmitNamedPropertyLoad(expr); 2671 EmitNamedPropertyLoad(expr);
2664 } else { 2672 } else {
2665 VisitForStackValue(expr->obj()->AsSuperReference()->this_var()); 2673 VisitForStackValue(expr->obj()->AsSuperReference()->this_var());
2666 EmitLoadHomeObject(expr->obj()->AsSuperReference()); 2674 EmitLoadHomeObject(expr->obj()->AsSuperReference());
2667 __ Push(result_register()); 2675 __ Push(result_register());
2668 EmitNamedSuperPropertyLoad(expr); 2676 EmitNamedSuperPropertyLoad(expr);
2669 } 2677 }
2670 PrepareForBailoutForId(expr->LoadId(), TOS_REG); 2678 PrepareForBailoutForId(expr->LoadId(), TOS_REG);
2671 context()->Plug(v0); 2679 context()->Plug(v0);
2672 } else { 2680 } else {
2673 VisitForStackValue(expr->obj()); 2681 if (!expr->IsSuperAccess()) {
2674 VisitForAccumulatorValue(expr->key()); 2682 VisitForStackValue(expr->obj());
2675 __ Move(LoadDescriptor::NameRegister(), v0); 2683 VisitForAccumulatorValue(expr->key());
2676 __ pop(LoadDescriptor::ReceiverRegister()); 2684 __ Move(LoadDescriptor::NameRegister(), v0);
2677 EmitKeyedPropertyLoad(expr); 2685 __ pop(LoadDescriptor::ReceiverRegister());
2686 EmitKeyedPropertyLoad(expr);
2687 } else {
2688 VisitForStackValue(expr->obj()->AsSuperReference()->this_var());
2689 EmitLoadHomeObject(expr->obj()->AsSuperReference());
2690 __ Push(result_register());
2691 VisitForStackValue(expr->key());
2692 EmitKeyedSuperPropertyLoad(expr);
2693 }
2678 context()->Plug(v0); 2694 context()->Plug(v0);
2679 } 2695 }
2680 } 2696 }
2681 2697
2682 2698
2683 void FullCodeGenerator::CallIC(Handle<Code> code, 2699 void FullCodeGenerator::CallIC(Handle<Code> code,
2684 TypeFeedbackId id) { 2700 TypeFeedbackId id) {
2685 ic_total_count_++; 2701 ic_total_count_++;
2686 __ Call(code, RelocInfo::CODE_TARGET, id); 2702 __ Call(code, RelocInfo::CODE_TARGET, id);
2687 } 2703 }
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
2773 2789
2774 // Push the target function under the receiver. 2790 // Push the target function under the receiver.
2775 __ ld(at, MemOperand(sp, 0)); 2791 __ ld(at, MemOperand(sp, 0));
2776 __ push(at); 2792 __ push(at);
2777 __ sd(v0, MemOperand(sp, kPointerSize)); 2793 __ sd(v0, MemOperand(sp, kPointerSize));
2778 2794
2779 EmitCall(expr, CallICState::METHOD); 2795 EmitCall(expr, CallICState::METHOD);
2780 } 2796 }
2781 2797
2782 2798
2799 void FullCodeGenerator::EmitKeyedSuperCallWithLoadIC(Call* expr) {
2800 Expression* callee = expr->expression();
2801 DCHECK(callee->IsProperty());
2802 Property* prop = callee->AsProperty();
2803 DCHECK(prop->IsSuperAccess());
2804
2805 SetSourcePosition(prop->position());
2806 // Load the function from the receiver.
2807 const Register scratch = a1;
2808 SuperReference* super_ref = prop->obj()->AsSuperReference();
2809 EmitLoadHomeObject(super_ref);
2810 __ Move(scratch, v0);
2811 VisitForAccumulatorValue(super_ref->this_var());
2812 __ Push(scratch, v0, v0, scratch);
2813 VisitForStackValue(prop->key());
2814
2815 // Stack here:
2816 // - home_object
2817 // - this (receiver)
2818 // - this (receiver) <-- LoadKeyedFromSuper will pop here and below.
2819 // - home_object
2820 // - key
2821 __ CallRuntime(Runtime::kLoadKeyedFromSuper, 3);
2822
2823 // Replace home_object with target function.
2824 __ sd(v0, MemOperand(sp, kPointerSize));
2825
2826 // Stack here:
2827 // - target function
2828 // - this (receiver)
2829 EmitCall(expr, CallICState::METHOD);
2830 }
2831
2832
2783 void FullCodeGenerator::EmitCall(Call* expr, CallICState::CallType call_type) { 2833 void FullCodeGenerator::EmitCall(Call* expr, CallICState::CallType call_type) {
2784 // Load the arguments. 2834 // Load the arguments.
2785 ZoneList<Expression*>* args = expr->arguments(); 2835 ZoneList<Expression*>* args = expr->arguments();
2786 int arg_count = args->length(); 2836 int arg_count = args->length();
2787 { PreservePositionScope scope(masm()->positions_recorder()); 2837 { PreservePositionScope scope(masm()->positions_recorder());
2788 for (int i = 0; i < arg_count; i++) { 2838 for (int i = 0; i < arg_count; i++) {
2789 VisitForStackValue(args->at(i)); 2839 VisitForStackValue(args->at(i));
2790 } 2840 }
2791 } 2841 }
2792 2842
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
2919 __ push(a1); 2969 __ push(a1);
2920 __ bind(&call); 2970 __ bind(&call);
2921 } 2971 }
2922 2972
2923 // The receiver is either the global receiver or an object found 2973 // The receiver is either the global receiver or an object found
2924 // by LoadContextSlot. 2974 // by LoadContextSlot.
2925 EmitCall(expr); 2975 EmitCall(expr);
2926 } else if (call_type == Call::PROPERTY_CALL) { 2976 } else if (call_type == Call::PROPERTY_CALL) {
2927 Property* property = callee->AsProperty(); 2977 Property* property = callee->AsProperty();
2928 bool is_named_call = property->key()->IsPropertyName(); 2978 bool is_named_call = property->key()->IsPropertyName();
2929 // super.x() is handled in EmitCallWithLoadIC. 2979 if (property->IsSuperAccess()) {
2930 if (property->IsSuperAccess() && is_named_call) { 2980 if (is_named_call) {
2931 EmitSuperCallWithLoadIC(expr); 2981 EmitSuperCallWithLoadIC(expr);
2982 } else {
2983 EmitKeyedSuperCallWithLoadIC(expr);
2984 }
2932 } else { 2985 } else {
2933 { 2986 {
2934 PreservePositionScope scope(masm()->positions_recorder()); 2987 PreservePositionScope scope(masm()->positions_recorder());
2935 VisitForStackValue(property->obj()); 2988 VisitForStackValue(property->obj());
2936 } 2989 }
2937 if (is_named_call) { 2990 if (is_named_call) {
2938 EmitCallWithLoadIC(expr); 2991 EmitCallWithLoadIC(expr);
2939 } else { 2992 } else {
2940 EmitKeyedCallWithLoadIC(expr, property->key()); 2993 EmitKeyedCallWithLoadIC(expr, property->key());
2941 } 2994 }
(...skipping 2092 matching lines...) Expand 10 before | Expand all | Expand 10 after
5034 Assembler::target_address_at(pc_immediate_load_address)) == 5087 Assembler::target_address_at(pc_immediate_load_address)) ==
5035 reinterpret_cast<uint64_t>( 5088 reinterpret_cast<uint64_t>(
5036 isolate->builtins()->OsrAfterStackCheck()->entry())); 5089 isolate->builtins()->OsrAfterStackCheck()->entry()));
5037 return OSR_AFTER_STACK_CHECK; 5090 return OSR_AFTER_STACK_CHECK;
5038 } 5091 }
5039 5092
5040 5093
5041 } } // namespace v8::internal 5094 } } // namespace v8::internal
5042 5095
5043 #endif // V8_TARGET_ARCH_MIPS64 5096 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/mips/full-codegen-mips.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698