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

Unified Diff: src/handles.cc

Issue 242050: Changed structure of accessor arguments passing to allow accessor (Closed)
Patch Set: Tuned Created 11 years, 3 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/handles.cc
diff --git a/src/handles.cc b/src/handles.cc
index ba57629e73bc3cb174c5900e7cf037c9bedc70a0..b43ec53207a38281df98987a11df5ab78ab73b78 100644
--- a/src/handles.cc
+++ b/src/handles.cc
@@ -29,6 +29,7 @@
#include "accessors.h"
#include "api.h"
+#include "arguments.h"
#include "bootstrapper.h"
#include "compiler.h"
#include "debug.h"
@@ -479,15 +480,17 @@ int GetScriptLineNumber(Handle<Script> script, int code_pos) {
}
+void CustomArguments::IterateInstance(ObjectVisitor* v) {
+ v->VisitPointers(values_, values_ + 4);
+}
+
+
// Compute the property keys from the interceptor.
v8::Handle<v8::Array> GetKeysForNamedInterceptor(Handle<JSObject> receiver,
Handle<JSObject> object) {
Handle<InterceptorInfo> interceptor(object->GetNamedInterceptor());
- Handle<Object> data(interceptor->data());
- v8::AccessorInfo info(
- v8::Utils::ToLocal(receiver),
- v8::Utils::ToLocal(data),
- v8::Utils::ToLocal(object));
+ CustomArguments args(interceptor->data(), *receiver, *object);
+ v8::AccessorInfo info(args.end());
v8::Handle<v8::Array> result;
if (!interceptor->enumerator()->IsUndefined()) {
v8::NamedPropertyEnumerator enum_fun =
@@ -507,11 +510,8 @@ v8::Handle<v8::Array> GetKeysForNamedInterceptor(Handle<JSObject> receiver,
v8::Handle<v8::Array> GetKeysForIndexedInterceptor(Handle<JSObject> receiver,
Handle<JSObject> object) {
Handle<InterceptorInfo> interceptor(object->GetIndexedInterceptor());
- Handle<Object> data(interceptor->data());
- v8::AccessorInfo info(
- v8::Utils::ToLocal(receiver),
- v8::Utils::ToLocal(data),
- v8::Utils::ToLocal(object));
+ CustomArguments args(interceptor->data(), *receiver, *object);
+ v8::AccessorInfo info(args.end());
v8::Handle<v8::Array> result;
if (!interceptor->enumerator()->IsUndefined()) {
v8::IndexedPropertyEnumerator enum_fun =

Powered by Google App Engine
This is Rietveld 408576698