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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: src/arm/stub-cache-arm.cc
===================================================================
--- src/arm/stub-cache-arm.cc (revision 6680)
+++ src/arm/stub-cache-arm.cc (working copy)
@@ -655,12 +655,10 @@
// already generated). Do not allow the assembler to perform a
// garbage collection but instead return the allocation failure
// object.
- MaybeObject* result = masm->TryCallApiFunctionAndReturn(
- &fun, argc + kFastApiCallArguments + 1);
- if (result->IsFailure()) {
- return result;
- }
- return Heap::undefined_value();
+ const int kStackUnwindSpace = argc + kFastApiCallArguments + 1;
+ ExternalReference ref =
+ ExternalReference(&fun, ExternalReference::DIRECT_API_CALL);
+ return masm->TryCallApiFunctionAndReturn(ref, kStackUnwindSpace);
}
class CallInterceptorCompiler BASE_EMBEDDED {
@@ -1241,22 +1239,43 @@
__ b(eq, miss);
// Check that the maps haven't changed.
- Register reg =
+ 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.
CheckPrototypes(object, receiver, holder, scratch1, scratch2, scratch3,
name, miss);
+ 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
- // Push the arguments on the JS stack of the caller.
- __ push(receiver); // Receiver.
- __ mov(scratch3, Operand(Handle<AccessorInfo>(callback))); // callback data
- __ ldr(ip, FieldMemOperand(scratch3, AccessorInfo::kDataOffset));
- __ Push(reg, ip, scratch3, name_reg);
+ // Push AccessorInfo arguments and property name below the
+ // exit frame and hence accessible to GC.
+ __ 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
+ __ mov(scratch2, sp);
+ __ push(holder_reg);
+ Handle<AccessorInfo> callback_handle(callback);
+ if (Heap::InNewSpace(callback_handle->data())) {
+ __ Move(scratch3, callback_handle);
+ __ ldr(scratch3, FieldMemOperand(scratch3, AccessorInfo::kDataOffset));
+ } else {
+ __ Move(scratch3, Handle<Object>(callback_handle->data()));
+ }
+ __ push(scratch3);
+ __ 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
+ __ mov(r0, sp); // r0 = Handle<String>
- // Do tail-call to the runtime system.
- ExternalReference load_callback_property =
- ExternalReference(IC_Utility(IC::kLoadCallbackProperty));
- __ TailCallExternalReference(load_callback_property, 5, 1);
+ Address getter_address = v8::ToCData<Address>(callback->getter());
+ ApiFunction fun(getter_address);
- return Heap::undefined_value(); // Success.
+ const int kApiStackSpace = 1;
+ __ EnterExitFrame(false, kApiStackSpace);
+ __ 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
+ __ add(r1, sp, Operand(1 * kPointerSize)); // r1 = AccessorInfo&
+
+ // Emitting a stub call may try to allocate (if the code is not
+ // already generated). Do not allow the assembler to perform a
+ // garbage collection but instead return the allocation failure
+ // object.
+ const int kStackUnwindSpace = 4;
+ ExternalReference ref =
+ ExternalReference(&fun, ExternalReference::DIRECT_LOAD_CALL);
+ return masm()->TryCallApiFunctionAndReturn(ref, kStackUnwindSpace);
}

Powered by Google App Engine
This is Rietveld 408576698