Revision: 5271
Author: [email protected]
Date: Mon Aug 16 04:53:52 2010
Log: Remove temporary support for two indexed property query APIs.
Review URL: http://codereview.chromium.org/3143015
http://code.google.com/p/v8/source/detail?r=5271
Modified:
/branches/bleeding_edge/include/v8.h
/branches/bleeding_edge/src/api.cc
/branches/bleeding_edge/src/objects.cc
/branches/bleeding_edge/test/cctest/test-api.cc
=======================================
--- /branches/bleeding_edge/include/v8.h Tue Aug 10 03:05:18 2010
+++ /branches/bleeding_edge/include/v8.h Mon Aug 16 04:53:52 2010
@@ -1824,19 +1824,10 @@
/**
* Returns a non-empty handle if the interceptor intercepts the request.
- * The result is true if either a boolean (true if property exists and
false
- * otherwise) or an integer encoding property attributes.
+ * The result is an integer encoding property attributes.
*/
-#ifdef USE_NEW_QUERY_CALLBACKS
typedef Handle<Integer> (*IndexedPropertyQuery)(uint32_t index,
const AccessorInfo& info);
-#else
-typedef Handle<Boolean> (*IndexedPropertyQuery)(uint32_t index,
- const AccessorInfo& info);
-#endif
-
-typedef Handle<Value> (*IndexedPropertyQueryImpl)(uint32_t index,
- const AccessorInfo&
info);
/**
* Returns a non-empty handle if the deleter intercepts the request.
@@ -2054,23 +2045,7 @@
IndexedPropertyQuery query,
IndexedPropertyDeleter remover,
IndexedPropertyEnumerator
enumerator,
- Handle<Value> data) {
- IndexedPropertyQueryImpl casted =
- reinterpret_cast<IndexedPropertyQueryImpl>(query);
- SetIndexedInstancePropertyHandlerImpl(getter,
- setter,
- casted,
- remover,
- enumerator,
- data);
- }
- void SetIndexedInstancePropertyHandlerImpl(
- IndexedPropertyGetter getter,
- IndexedPropertySetter setter,
- IndexedPropertyQueryImpl query,
- IndexedPropertyDeleter remover,
- IndexedPropertyEnumerator enumerator,
- Handle<Value> data);
+ Handle<Value> data);
void SetInstanceCallAsFunctionHandler(InvocationCallback callback,
Handle<Value> data);
@@ -2169,24 +2144,7 @@
IndexedPropertyQuery query = 0,
IndexedPropertyDeleter deleter = 0,
IndexedPropertyEnumerator enumerator = 0,
- Handle<Value> data = Handle<Value>()) {
- IndexedPropertyQueryImpl casted =
- reinterpret_cast<IndexedPropertyQueryImpl>(query);
- SetIndexedPropertyHandlerImpl(getter,
- setter,
- casted,
- deleter,
- enumerator,
- data);
- }
- private:
- void SetIndexedPropertyHandlerImpl(IndexedPropertyGetter getter,
- IndexedPropertySetter setter,
- IndexedPropertyQueryImpl query,
- IndexedPropertyDeleter deleter,
- IndexedPropertyEnumerator enumerator,
- Handle<Value> data);
- public:
+ Handle<Value> data = Handle<Value>());
/**
* Sets the callback to be used when calling instances created from
=======================================
--- /branches/bleeding_edge/src/api.cc Fri Aug 13 04:11:36 2010
+++ /branches/bleeding_edge/src/api.cc Mon Aug 16 04:53:52 2010
@@ -888,10 +888,10 @@
}
-void FunctionTemplate::SetIndexedInstancePropertyHandlerImpl(
+void FunctionTemplate::SetIndexedInstancePropertyHandler(
IndexedPropertyGetter getter,
IndexedPropertySetter setter,
- IndexedPropertyQueryImpl query,
+ IndexedPropertyQuery query,
IndexedPropertyDeleter remover,
IndexedPropertyEnumerator enumerator,
Handle<Value> data) {
@@ -1056,10 +1056,10 @@
}
-void ObjectTemplate::SetIndexedPropertyHandlerImpl(
+void ObjectTemplate::SetIndexedPropertyHandler(
IndexedPropertyGetter getter,
IndexedPropertySetter setter,
- IndexedPropertyQueryImpl query,
+ IndexedPropertyQuery query,
IndexedPropertyDeleter remover,
IndexedPropertyEnumerator enumerator,
Handle<Value> data) {
@@ -1070,12 +1070,12 @@
i::FunctionTemplateInfo* constructor =
i::FunctionTemplateInfo::cast(Utils::OpenHandle(this)->constructor());
i::Handle<i::FunctionTemplateInfo> cons(constructor);
- Utils::ToLocal(cons)->SetIndexedInstancePropertyHandlerImpl(getter,
- setter,
- query,
- remover,
- enumerator,
- data);
+ Utils::ToLocal(cons)->SetIndexedInstancePropertyHandler(getter,
+ setter,
+ query,
+ remover,
+ enumerator,
+ data);
}
=======================================
--- /branches/bleeding_edge/src/objects.cc Mon Aug 16 00:52:49 2010
+++ /branches/bleeding_edge/src/objects.cc Mon Aug 16 04:53:52 2010
@@ -5768,23 +5768,18 @@
CustomArguments args(interceptor->data(), receiver, this);
v8::AccessorInfo info(args.end());
if (!interceptor->query()->IsUndefined()) {
- v8::IndexedPropertyQueryImpl query =
- v8::ToCData<v8::IndexedPropertyQueryImpl>(interceptor->query());
+ v8::IndexedPropertyQuery query =
+ v8::ToCData<v8::IndexedPropertyQuery>(interceptor->query());
LOG(ApiIndexedPropertyAccess("interceptor-indexed-has", this, index));
- v8::Handle<v8::Value> result;
+ v8::Handle<v8::Integer> result;
{
// Leaving JavaScript.
VMState state(EXTERNAL);
result = query(index, info);
}
if (!result.IsEmpty()) {
- // IsBoolean check would be removed when transition to new API is
over.
- if (result->IsBoolean()) {
- return result->IsTrue() ? true : false;
- } else {
- ASSERT(result->IsInt32());
- return true; // absence of property is signaled by empty handle.
- }
+ ASSERT(result->IsInt32());
+ return true; // absence of property is signaled by empty handle.
}
} else if (!interceptor->getter()->IsUndefined()) {
v8::IndexedPropertyGetter getter =
=======================================
--- /branches/bleeding_edge/test/cctest/test-api.cc Thu Aug 12 23:55:44 2010
+++ /branches/bleeding_edge/test/cctest/test-api.cc Mon Aug 16 04:53:52 2010
@@ -27,8 +27,6 @@
#include <limits.h>
-#define USE_NEW_QUERY_CALLBACKS
-
#include "v8.h"
#include "api.h"
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev