Revision: 2538 Author: [email protected] Date: Mon Jul 27 02:54:59 2009 Log: Stub Cache: speed up load callback accessor by allocating data handle on stack.
Review URL: http://codereview.chromium.org/160041 http://code.google.com/p/v8/source/detail?r=2538 Modified: /branches/bleeding_edge/src/arm/stub-cache-arm.cc /branches/bleeding_edge/src/ia32/stub-cache-ia32.cc /branches/bleeding_edge/src/stub-cache.cc ======================================= --- /branches/bleeding_edge/src/arm/stub-cache-arm.cc Fri Jul 17 01:55:01 2009 +++ /branches/bleeding_edge/src/arm/stub-cache-arm.cc Mon Jul 27 02:54:59 2009 @@ -467,15 +467,17 @@ // Push the arguments on the JS stack of the caller. __ push(receiver); // receiver + __ push(reg); // holder __ mov(ip, Operand(Handle<AccessorInfo>(callback))); // callback data __ push(ip); + __ ldr(reg, FieldMemOperand(ip, AccessorInfo::kDataOffset)); + __ push(reg); __ push(name_reg); // name - __ push(reg); // holder // Do tail-call to the runtime system. ExternalReference load_callback_property = ExternalReference(IC_Utility(IC::kLoadCallbackProperty)); - __ TailCallRuntime(load_callback_property, 4); + __ TailCallRuntime(load_callback_property, 5); } ======================================= --- /branches/bleeding_edge/src/ia32/stub-cache-ia32.cc Fri Jul 24 04:22:35 2009 +++ /branches/bleeding_edge/src/ia32/stub-cache-ia32.cc Mon Jul 27 02:54:59 2009 @@ -447,15 +447,17 @@ // Push the arguments on the JS stack of the caller. __ pop(scratch2); // remove return address __ push(receiver); // receiver - __ push(Immediate(Handle<AccessorInfo>(callback))); // callback data - __ push(name_reg); // name __ push(reg); // holder + __ mov(reg, Immediate(Handle<AccessorInfo>(callback))); // callback data + __ push(reg); + __ push(FieldOperand(reg, AccessorInfo::kDataOffset)); + __ push(name_reg); // name __ push(scratch2); // restore return address // Do tail-call to the runtime system. ExternalReference load_callback_property = ExternalReference(IC_Utility(IC::kLoadCallbackProperty)); - __ TailCallRuntime(load_callback_property, 4); + __ TailCallRuntime(load_callback_property, 5); } ======================================= --- /branches/bleeding_edge/src/stub-cache.cc Thu Jul 16 01:38:52 2009 +++ /branches/bleeding_edge/src/stub-cache.cc Mon Jul 27 02:54:59 2009 @@ -736,22 +736,22 @@ Object* LoadCallbackProperty(Arguments args) { Handle<JSObject> recv = args.at<JSObject>(0); - AccessorInfo* callback = AccessorInfo::cast(args[1]); + Handle<JSObject> holder = args.at<JSObject>(1); + AccessorInfo* callback = AccessorInfo::cast(args[2]); + Handle<Object> data = args.at<Object>(3); Address getter_address = v8::ToCData<Address>(callback->getter()); v8::AccessorGetter fun = FUNCTION_CAST<v8::AccessorGetter>(getter_address); ASSERT(fun != NULL); - Handle<String> name = args.at<String>(2); - Handle<JSObject> holder = args.at<JSObject>(3); - HandleScope scope; - Handle<Object> data(callback->data()); - LOG(ApiNamedPropertyAccess("load", *recv, *name)); + Handle<String> name = args.at<String>(4); // NOTE: If we can align the structure of an AccessorInfo with the // locations of the arguments to this function maybe we don't have // to explicitly create the structure but can just pass a pointer // into the stack. + LOG(ApiNamedPropertyAccess("load", *recv, *name)); v8::AccessorInfo info(v8::Utils::ToLocal(recv), v8::Utils::ToLocal(data), v8::Utils::ToLocal(holder)); + HandleScope scope; v8::Handle<v8::Value> result; { // Leaving JavaScript. --~--~---------~--~----~------------~-------~--~----~ v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev -~----------~----~----~----~------~----~------~--~---
