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

Side by Side Diff: src/arm/stub-cache-arm.cc

Issue 6462029: Direct call accessor getter callbacks (arm implementation). (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 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 | Annotate | Revision Log
« no previous file with comments | « src/arm/simulator-arm.cc ('k') | src/assembler.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 2006-2009 the V8 project authors. All rights reserved. 1 // Copyright 2006-2009 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after
648 __ mov(ip, Operand(argc)); 648 __ mov(ip, Operand(argc));
649 __ str(ip, MemOperand(r0, 2 * kPointerSize)); 649 __ str(ip, MemOperand(r0, 2 * kPointerSize));
650 // v8::Arguments::is_construct_call = 0 650 // v8::Arguments::is_construct_call = 0
651 __ mov(ip, Operand(0)); 651 __ mov(ip, Operand(0));
652 __ str(ip, MemOperand(r0, 3 * kPointerSize)); 652 __ str(ip, MemOperand(r0, 3 * kPointerSize));
653 653
654 // Emitting a stub call may try to allocate (if the code is not 654 // Emitting a stub call may try to allocate (if the code is not
655 // already generated). Do not allow the assembler to perform a 655 // already generated). Do not allow the assembler to perform a
656 // garbage collection but instead return the allocation failure 656 // garbage collection but instead return the allocation failure
657 // object. 657 // object.
658 MaybeObject* result = masm->TryCallApiFunctionAndReturn( 658 const int kStackUnwindSpace = argc + kFastApiCallArguments + 1;
659 &fun, argc + kFastApiCallArguments + 1); 659 ExternalReference ref =
660 if (result->IsFailure()) { 660 ExternalReference(&fun, ExternalReference::DIRECT_API_CALL);
661 return result; 661 return masm->TryCallApiFunctionAndReturn(ref, kStackUnwindSpace);
662 }
663 return Heap::undefined_value();
664 } 662 }
665 663
666 class CallInterceptorCompiler BASE_EMBEDDED { 664 class CallInterceptorCompiler BASE_EMBEDDED {
667 public: 665 public:
668 CallInterceptorCompiler(StubCompiler* stub_compiler, 666 CallInterceptorCompiler(StubCompiler* stub_compiler,
669 const ParameterCount& arguments, 667 const ParameterCount& arguments,
670 Register name) 668 Register name)
671 : stub_compiler_(stub_compiler), 669 : stub_compiler_(stub_compiler),
672 arguments_(arguments), 670 arguments_(arguments),
673 name_(name) {} 671 name_(name) {}
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after
1238 Label* miss) { 1236 Label* miss) {
1239 // Check that the receiver isn't a smi. 1237 // Check that the receiver isn't a smi.
1240 __ tst(receiver, Operand(kSmiTagMask)); 1238 __ tst(receiver, Operand(kSmiTagMask));
1241 __ b(eq, miss); 1239 __ b(eq, miss);
1242 1240
1243 // Check that the maps haven't changed. 1241 // Check that the maps haven't changed.
1244 Register reg = 1242 Register reg =
1245 CheckPrototypes(object, receiver, holder, scratch1, scratch2, scratch3, 1243 CheckPrototypes(object, receiver, holder, scratch1, scratch2, scratch3,
1246 name, miss); 1244 name, miss);
1247 1245
1248 // Push the arguments on the JS stack of the caller. 1246 // Build AccessorInfo::args_ list on the stack and push property name below
1249 __ push(receiver); // Receiver. 1247 // the exit frame to make GC aware of them and store pointers to them.
1250 __ mov(scratch3, Operand(Handle<AccessorInfo>(callback))); // callback data 1248 __ push(receiver);
1251 __ ldr(ip, FieldMemOperand(scratch3, AccessorInfo::kDataOffset)); 1249 __ mov(scratch2, sp); // scratch2 = AccessorInfo::args_
1252 __ Push(reg, ip, scratch3, name_reg); 1250 Handle<AccessorInfo> callback_handle(callback);
1251 if (Heap::InNewSpace(callback_handle->data())) {
1252 __ Move(scratch3, callback_handle);
1253 __ ldr(scratch3, FieldMemOperand(scratch3, AccessorInfo::kDataOffset));
1254 } else {
1255 __ Move(scratch3, Handle<Object>(callback_handle->data()));
1256 }
1257 __ Push(reg, scratch3, name_reg);
1258 __ mov(r0, sp); // r0 = Handle<String>
1253 1259
1254 // Do tail-call to the runtime system. 1260 Address getter_address = v8::ToCData<Address>(callback->getter());
1255 ExternalReference load_callback_property = 1261 ApiFunction fun(getter_address);
1256 ExternalReference(IC_Utility(IC::kLoadCallbackProperty));
1257 __ TailCallExternalReference(load_callback_property, 5, 1);
1258 1262
1259 return Heap::undefined_value(); // Success. 1263 const int kApiStackSpace = 1;
1264 __ EnterExitFrame(false, kApiStackSpace);
1265 // Create AccessorInfo instance on the stack above the exit frame with
1266 // scratch2 (internal::Object **args_) as the data.
1267 __ str(scratch2, MemOperand(sp, 1 * kPointerSize));
1268 __ add(r1, sp, Operand(1 * kPointerSize)); // r1 = AccessorInfo&
1269
1270 // Emitting a stub call may try to allocate (if the code is not
1271 // already generated). Do not allow the assembler to perform a
1272 // garbage collection but instead return the allocation failure
1273 // object.
1274 const int kStackUnwindSpace = 4;
1275 ExternalReference ref =
1276 ExternalReference(&fun, ExternalReference::DIRECT_GETTER_CALL);
1277 return masm()->TryCallApiFunctionAndReturn(ref, kStackUnwindSpace);
1260 } 1278 }
1261 1279
1262 1280
1263 void StubCompiler::GenerateLoadInterceptor(JSObject* object, 1281 void StubCompiler::GenerateLoadInterceptor(JSObject* object,
1264 JSObject* interceptor_holder, 1282 JSObject* interceptor_holder,
1265 LookupResult* lookup, 1283 LookupResult* lookup,
1266 Register receiver, 1284 Register receiver,
1267 Register name_reg, 1285 Register name_reg,
1268 Register scratch1, 1286 Register scratch1,
1269 Register scratch2, 1287 Register scratch2,
(...skipping 2769 matching lines...) Expand 10 before | Expand all | Expand 10 after
4039 4057
4040 return GetCode(flags); 4058 return GetCode(flags);
4041 } 4059 }
4042 4060
4043 4061
4044 #undef __ 4062 #undef __
4045 4063
4046 } } // namespace v8::internal 4064 } } // namespace v8::internal
4047 4065
4048 #endif // V8_TARGET_ARCH_ARM 4066 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/simulator-arm.cc ('k') | src/assembler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698