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

Side by Side Diff: src/ic/arm64/handler-compiler-arm64.cc

Issue 872723003: Load getter from map descriptor instead of embedding it in handler. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add mips, mips64, x87 Created 5 years, 11 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/arm/handler-compiler-arm.cc ('k') | src/ic/handler-compiler.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 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_ARM64 7 #if V8_TARGET_ARCH_ARM64
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 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 256
257 // Restore context register. 257 // Restore context register.
258 __ Ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); 258 __ Ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
259 } 259 }
260 __ Ret(); 260 __ Ret();
261 } 261 }
262 262
263 263
264 void NamedLoadHandlerCompiler::GenerateLoadViaGetter( 264 void NamedLoadHandlerCompiler::GenerateLoadViaGetter(
265 MacroAssembler* masm, Handle<HeapType> type, Register receiver, 265 MacroAssembler* masm, Handle<HeapType> type, Register receiver,
266 Handle<JSFunction> getter) { 266 Register holder, int accessor_index, int expected_arguments) {
267 { 267 {
268 FrameScope scope(masm, StackFrame::INTERNAL); 268 FrameScope scope(masm, StackFrame::INTERNAL);
269 269
270 if (!getter.is_null()) { 270 if (accessor_index >= 0) {
271 // Call the JavaScript getter with the receiver on the stack. 271 // Call the JavaScript getter with the receiver on the stack.
272 if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) { 272 if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) {
273 // Swap in the global receiver. 273 // Swap in the global receiver.
274 __ Ldr(receiver, 274 __ Ldr(receiver,
275 FieldMemOperand(receiver, JSGlobalObject::kGlobalProxyOffset)); 275 FieldMemOperand(receiver, JSGlobalObject::kGlobalProxyOffset));
276 } 276 }
277 __ Push(receiver); 277 __ Push(receiver);
278 ParameterCount actual(0); 278 ParameterCount actual(0);
279 ParameterCount expected(getter); 279 ParameterCount expected(expected_arguments);
280 __ InvokeFunction(getter, expected, actual, CALL_FUNCTION, 280 Register scratch = holder;
281 NullCallWrapper()); 281 __ Ldr(scratch, FieldMemOperand(holder, HeapObject::kMapOffset));
282 __ LoadInstanceDescriptors(scratch, scratch);
283 __ Ldr(scratch, FieldMemOperand(scratch, DescriptorArray::GetValueOffset(
284 accessor_index)));
285 __ Ldr(x1, FieldMemOperand(scratch, AccessorPair::kGetterOffset));
286 __ InvokeFunction(x1, expected, actual, CALL_FUNCTION, NullCallWrapper());
282 } else { 287 } else {
283 // If we generate a global code snippet for deoptimization only, remember 288 // If we generate a global code snippet for deoptimization only, remember
284 // the place to continue after deoptimization. 289 // the place to continue after deoptimization.
285 masm->isolate()->heap()->SetGetterStubDeoptPCOffset(masm->pc_offset()); 290 masm->isolate()->heap()->SetGetterStubDeoptPCOffset(masm->pc_offset());
286 } 291 }
287 292
288 // Restore context register. 293 // Restore context register.
289 __ Ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); 294 __ Ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
290 } 295 }
291 __ Ret(); 296 __ Ret();
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after
746 // Return the generated code. 751 // Return the generated code.
747 return GetCode(kind(), Code::FAST, name); 752 return GetCode(kind(), Code::FAST, name);
748 } 753 }
749 754
750 755
751 #undef __ 756 #undef __
752 } 757 }
753 } // namespace v8::internal 758 } // namespace v8::internal
754 759
755 #endif // V8_TARGET_ARCH_IA32 760 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ic/arm/handler-compiler-arm.cc ('k') | src/ic/handler-compiler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698