Commit 0d8ec2a8 authored by antonm@chromium.org's avatar antonm@chromium.org

Remove temporary support for two indexed property query APIs.

Review URL: http://codereview.chromium.org/3143015

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5271 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent e18d07b6
...@@ -1824,19 +1824,10 @@ typedef Handle<Value> (*IndexedPropertySetter)(uint32_t index, ...@@ -1824,19 +1824,10 @@ typedef Handle<Value> (*IndexedPropertySetter)(uint32_t index,
/** /**
* Returns a non-empty handle if the interceptor intercepts the request. * 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 * The result is an integer encoding property attributes.
* otherwise) or an integer encoding property attributes.
*/ */
#ifdef USE_NEW_QUERY_CALLBACKS
typedef Handle<Integer> (*IndexedPropertyQuery)(uint32_t index, typedef Handle<Integer> (*IndexedPropertyQuery)(uint32_t index,
const AccessorInfo& info); 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. * Returns a non-empty handle if the deleter intercepts the request.
...@@ -2054,23 +2045,7 @@ class V8EXPORT FunctionTemplate : public Template { ...@@ -2054,23 +2045,7 @@ class V8EXPORT FunctionTemplate : public Template {
IndexedPropertyQuery query, IndexedPropertyQuery query,
IndexedPropertyDeleter remover, IndexedPropertyDeleter remover,
IndexedPropertyEnumerator enumerator, IndexedPropertyEnumerator enumerator,
Handle<Value> data) { 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);
void SetInstanceCallAsFunctionHandler(InvocationCallback callback, void SetInstanceCallAsFunctionHandler(InvocationCallback callback,
Handle<Value> data); Handle<Value> data);
...@@ -2169,24 +2144,7 @@ class V8EXPORT ObjectTemplate : public Template { ...@@ -2169,24 +2144,7 @@ class V8EXPORT ObjectTemplate : public Template {
IndexedPropertyQuery query = 0, IndexedPropertyQuery query = 0,
IndexedPropertyDeleter deleter = 0, IndexedPropertyDeleter deleter = 0,
IndexedPropertyEnumerator enumerator = 0, IndexedPropertyEnumerator enumerator = 0,
Handle<Value> data = Handle<Value>()) { 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:
/** /**
* Sets the callback to be used when calling instances created from * Sets the callback to be used when calling instances created from
......
...@@ -888,10 +888,10 @@ void FunctionTemplate::SetNamedInstancePropertyHandler( ...@@ -888,10 +888,10 @@ void FunctionTemplate::SetNamedInstancePropertyHandler(
} }
void FunctionTemplate::SetIndexedInstancePropertyHandlerImpl( void FunctionTemplate::SetIndexedInstancePropertyHandler(
IndexedPropertyGetter getter, IndexedPropertyGetter getter,
IndexedPropertySetter setter, IndexedPropertySetter setter,
IndexedPropertyQueryImpl query, IndexedPropertyQuery query,
IndexedPropertyDeleter remover, IndexedPropertyDeleter remover,
IndexedPropertyEnumerator enumerator, IndexedPropertyEnumerator enumerator,
Handle<Value> data) { Handle<Value> data) {
...@@ -1056,10 +1056,10 @@ void ObjectTemplate::SetAccessCheckCallbacks( ...@@ -1056,10 +1056,10 @@ void ObjectTemplate::SetAccessCheckCallbacks(
} }
void ObjectTemplate::SetIndexedPropertyHandlerImpl( void ObjectTemplate::SetIndexedPropertyHandler(
IndexedPropertyGetter getter, IndexedPropertyGetter getter,
IndexedPropertySetter setter, IndexedPropertySetter setter,
IndexedPropertyQueryImpl query, IndexedPropertyQuery query,
IndexedPropertyDeleter remover, IndexedPropertyDeleter remover,
IndexedPropertyEnumerator enumerator, IndexedPropertyEnumerator enumerator,
Handle<Value> data) { Handle<Value> data) {
...@@ -1070,12 +1070,12 @@ void ObjectTemplate::SetIndexedPropertyHandlerImpl( ...@@ -1070,12 +1070,12 @@ void ObjectTemplate::SetIndexedPropertyHandlerImpl(
i::FunctionTemplateInfo* constructor = i::FunctionTemplateInfo* constructor =
i::FunctionTemplateInfo::cast(Utils::OpenHandle(this)->constructor()); i::FunctionTemplateInfo::cast(Utils::OpenHandle(this)->constructor());
i::Handle<i::FunctionTemplateInfo> cons(constructor); i::Handle<i::FunctionTemplateInfo> cons(constructor);
Utils::ToLocal(cons)->SetIndexedInstancePropertyHandlerImpl(getter, Utils::ToLocal(cons)->SetIndexedInstancePropertyHandler(getter,
setter, setter,
query, query,
remover, remover,
enumerator, enumerator,
data); data);
} }
......
...@@ -5768,23 +5768,18 @@ bool JSObject::HasElementWithInterceptor(JSObject* receiver, uint32_t index) { ...@@ -5768,23 +5768,18 @@ bool JSObject::HasElementWithInterceptor(JSObject* receiver, uint32_t index) {
CustomArguments args(interceptor->data(), receiver, this); CustomArguments args(interceptor->data(), receiver, this);
v8::AccessorInfo info(args.end()); v8::AccessorInfo info(args.end());
if (!interceptor->query()->IsUndefined()) { if (!interceptor->query()->IsUndefined()) {
v8::IndexedPropertyQueryImpl query = v8::IndexedPropertyQuery query =
v8::ToCData<v8::IndexedPropertyQueryImpl>(interceptor->query()); v8::ToCData<v8::IndexedPropertyQuery>(interceptor->query());
LOG(ApiIndexedPropertyAccess("interceptor-indexed-has", this, index)); LOG(ApiIndexedPropertyAccess("interceptor-indexed-has", this, index));
v8::Handle<v8::Value> result; v8::Handle<v8::Integer> result;
{ {
// Leaving JavaScript. // Leaving JavaScript.
VMState state(EXTERNAL); VMState state(EXTERNAL);
result = query(index, info); result = query(index, info);
} }
if (!result.IsEmpty()) { if (!result.IsEmpty()) {
// IsBoolean check would be removed when transition to new API is over. ASSERT(result->IsInt32());
if (result->IsBoolean()) { return true; // absence of property is signaled by empty handle.
return result->IsTrue() ? true : false;
} else {
ASSERT(result->IsInt32());
return true; // absence of property is signaled by empty handle.
}
} }
} else if (!interceptor->getter()->IsUndefined()) { } else if (!interceptor->getter()->IsUndefined()) {
v8::IndexedPropertyGetter getter = v8::IndexedPropertyGetter getter =
......
...@@ -27,8 +27,6 @@ ...@@ -27,8 +27,6 @@
#include <limits.h> #include <limits.h>
#define USE_NEW_QUERY_CALLBACKS
#include "v8.h" #include "v8.h"
#include "api.h" #include "api.h"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment