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

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
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 560 matching lines...) Expand 10 before | Expand all | Expand 10 after
1234 Register scratch2, 1232 Register scratch2,
1235 Register scratch3, 1233 Register scratch3,
1236 AccessorInfo* callback, 1234 AccessorInfo* callback,
1237 String* name, 1235 String* name,
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 holder_reg =
antonm 2011/02/17 16:13:44 if you change this, please, change other platforms
Zaheer 2011/02/21 10:25:35 Do not wish to touch x86, reverted it back to reg.
1245 CheckPrototypes(object, receiver, holder, scratch1, scratch2, scratch3, 1243 CheckPrototypes(object, receiver, holder, scratch1, scratch2, scratch3,
1246 name, miss); 1244 name, miss);
1245 ASSERT(holder_reg.is(receiver) || holder_reg.is(scratch1));
antonm 2011/02/17 16:13:44 do you waht to assert this or rather the fact that
Zaheer 2011/02/21 10:25:35 The holder_reg.is(scratch{2,3}) check already happ
antonm 2011/02/21 17:45:12 So why you bother asserting here? What kind of in
Zaheer 2011/02/23 06:34:07 I added this as a sanity check on the return value
1247 1246
1248 // Push the arguments on the JS stack of the caller. 1247 // Push AccessorInfo arguments and property name below the
1249 __ push(receiver); // Receiver. 1248 // exit frame and hence accessible to GC.
1250 __ mov(scratch3, Operand(Handle<AccessorInfo>(callback))); // callback data 1249 __ push(receiver);
antonm 2011/02/17 16:13:44 may I ask you to reformat and comment you code sli
Zaheer 2011/02/21 10:25:35 with the merge of pushes, its difficult to separat
1251 __ ldr(ip, FieldMemOperand(scratch3, AccessorInfo::kDataOffset)); 1250 __ mov(scratch2, sp);
1252 __ Push(reg, ip, scratch3, name_reg); 1251 __ push(holder_reg);
1252 Handle<AccessorInfo> callback_handle(callback);
1253 if (Heap::InNewSpace(callback_handle->data())) {
1254 __ Move(scratch3, callback_handle);
1255 __ ldr(scratch3, FieldMemOperand(scratch3, AccessorInfo::kDataOffset));
1256 } else {
1257 __ Move(scratch3, Handle<Object>(callback_handle->data()));
1258 }
1259 __ push(scratch3);
1260 __ push(name_reg);
SeRya 2011/02/20 17:28:39 __ Push(receiver, scratch3, name_reg) (or at least
Zaheer 2011/02/21 10:25:35 Done. Merged the last three pushes. cant merge the
1261 __ mov(r0, sp); // r0 = Handle<String>
1253 1262
1254 // Do tail-call to the runtime system. 1263 Address getter_address = v8::ToCData<Address>(callback->getter());
1255 ExternalReference load_callback_property = 1264 ApiFunction fun(getter_address);
1256 ExternalReference(IC_Utility(IC::kLoadCallbackProperty));
1257 __ TailCallExternalReference(load_callback_property, 5, 1);
1258 1265
1259 return Heap::undefined_value(); // Success. 1266 const int kApiStackSpace = 1;
1267 __ EnterExitFrame(false, kApiStackSpace);
1268 __ str(scratch2, MemOperand(sp, 1 * kPointerSize));
antonm 2011/02/17 16:13:44 Please, explain briefly why we need additional wra
SeRya 2011/02/20 17:28:39 Is is an instance of v8::AccessorInfo which consis
Zaheer 2011/02/21 10:25:35 This to create internal::Object** (AccessorInfo on
antonm 2011/02/21 17:45:12 I am sorry, I thought that's some additional wrapp
1269 __ add(r1, sp, Operand(1 * kPointerSize)); // r1 = AccessorInfo&
1270
1271 // Emitting a stub call may try to allocate (if the code is not
1272 // already generated). Do not allow the assembler to perform a
1273 // garbage collection but instead return the allocation failure
1274 // object.
1275 const int kStackUnwindSpace = 4;
1276 ExternalReference ref =
1277 ExternalReference(&fun, ExternalReference::DIRECT_LOAD_CALL);
1278 return masm()->TryCallApiFunctionAndReturn(ref, kStackUnwindSpace);
1260 } 1279 }
1261 1280
1262 1281
1263 void StubCompiler::GenerateLoadInterceptor(JSObject* object, 1282 void StubCompiler::GenerateLoadInterceptor(JSObject* object,
1264 JSObject* interceptor_holder, 1283 JSObject* interceptor_holder,
1265 LookupResult* lookup, 1284 LookupResult* lookup,
1266 Register receiver, 1285 Register receiver,
1267 Register name_reg, 1286 Register name_reg,
1268 Register scratch1, 1287 Register scratch1,
1269 Register scratch2, 1288 Register scratch2,
(...skipping 2728 matching lines...) Expand 10 before | Expand all | Expand 10 after
3998 4017
3999 return GetCode(flags); 4018 return GetCode(flags);
4000 } 4019 }
4001 4020
4002 4021
4003 #undef __ 4022 #undef __
4004 4023
4005 } } // namespace v8::internal 4024 } } // namespace v8::internal
4006 4025
4007 #endif // V8_TARGET_ARCH_ARM 4026 #endif // V8_TARGET_ARCH_ARM
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698