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/ic/mips64/handler-compiler-mips64.cc

Issue 879213003: Load setter from map descriptor instead of embedding it in handler. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix arm Created 5 years, 10 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
« no previous file with comments | « src/ic/mips/handler-compiler-mips.cc ('k') | src/ic/x64/handler-compiler-x64.cc » ('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 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_MIPS64 7 #if V8_TARGET_ARCH_MIPS64
8 8
9 #include "src/ic/call-optimization.h" 9 #include "src/ic/call-optimization.h"
10 #include "src/ic/handler-compiler.h" 10 #include "src/ic/handler-compiler.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 52
53 // Restore context register. 53 // Restore context register.
54 __ ld(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); 54 __ ld(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
55 } 55 }
56 __ Ret(); 56 __ Ret();
57 } 57 }
58 58
59 59
60 void NamedStoreHandlerCompiler::GenerateStoreViaSetter( 60 void NamedStoreHandlerCompiler::GenerateStoreViaSetter(
61 MacroAssembler* masm, Handle<HeapType> type, Register receiver, 61 MacroAssembler* masm, Handle<HeapType> type, Register receiver,
62 Handle<JSFunction> setter) { 62 Register holder, int accessor_index, int expected_arguments) {
63 // ----------- S t a t e ------------- 63 // ----------- S t a t e -------------
64 // -- ra : return address 64 // -- ra : return address
65 // ----------------------------------- 65 // -----------------------------------
66 { 66 {
67 FrameScope scope(masm, StackFrame::INTERNAL); 67 FrameScope scope(masm, StackFrame::INTERNAL);
68 68
69 // Save value register, so we can restore it later. 69 // Save value register, so we can restore it later.
70 __ push(value()); 70 __ push(value());
71 71
72 if (!setter.is_null()) { 72 if (accessor_index >= 0) {
73 // Call the JavaScript setter with receiver and value on the stack. 73 // Call the JavaScript setter with receiver and value on the stack.
74 if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) { 74 if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) {
75 // Swap in the global receiver. 75 // Swap in the global receiver.
76 __ ld(receiver, 76 __ ld(receiver,
77 FieldMemOperand(receiver, JSGlobalObject::kGlobalProxyOffset)); 77 FieldMemOperand(receiver, JSGlobalObject::kGlobalProxyOffset));
78 } 78 }
79 __ Push(receiver, value()); 79 __ Push(receiver, value());
80 ParameterCount actual(1); 80 ParameterCount actual(1);
81 ParameterCount expected(setter); 81 ParameterCount expected(expected_arguments);
82 __ InvokeFunction(setter, expected, actual, CALL_FUNCTION, 82 Register scratch = holder;
83 NullCallWrapper()); 83 __ ld(scratch, FieldMemOperand(holder, HeapObject::kMapOffset));
84 __ LoadInstanceDescriptors(scratch, scratch);
85 __ ld(scratch, FieldMemOperand(scratch, DescriptorArray::GetValueOffset(
86 accessor_index)));
87 __ ld(a1, FieldMemOperand(scratch, AccessorPair::kSetterOffset));
88 __ InvokeFunction(a1, expected, actual, CALL_FUNCTION, NullCallWrapper());
84 } else { 89 } else {
85 // If we generate a global code snippet for deoptimization only, remember 90 // If we generate a global code snippet for deoptimization only, remember
86 // the place to continue after deoptimization. 91 // the place to continue after deoptimization.
87 masm->isolate()->heap()->SetSetterStubDeoptPCOffset(masm->pc_offset()); 92 masm->isolate()->heap()->SetSetterStubDeoptPCOffset(masm->pc_offset());
88 } 93 }
89 94
90 // We have to return the passed value, not the return value of the setter. 95 // We have to return the passed value, not the return value of the setter.
91 __ pop(v0); 96 __ pop(v0);
92 97
93 // Restore context register. 98 // Restore context register.
(...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after
730 // Return the generated code. 735 // Return the generated code.
731 return GetCode(kind(), Code::NORMAL, name); 736 return GetCode(kind(), Code::NORMAL, name);
732 } 737 }
733 738
734 739
735 #undef __ 740 #undef __
736 } 741 }
737 } // namespace v8::internal 742 } // namespace v8::internal
738 743
739 #endif // V8_TARGET_ARCH_MIPS64 744 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/ic/mips/handler-compiler-mips.cc ('k') | src/ic/x64/handler-compiler-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698