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

Side by Side Diff: src/objects.cc

Issue 3143015: Remove temporary support for two indexed property query APIs. (Closed)
Patch Set: Created 10 years, 4 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 unified diff | Download patch
« no previous file with comments | « src/api.cc ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. 1 // Copyright 2006-2009 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 5738 matching lines...) Expand 10 before | Expand all | Expand 10 after
5749 // Make sure that the top context does not change when doing 5749 // Make sure that the top context does not change when doing
5750 // callbacks or interceptor calls. 5750 // callbacks or interceptor calls.
5751 AssertNoContextChange ncc; 5751 AssertNoContextChange ncc;
5752 HandleScope scope; 5752 HandleScope scope;
5753 Handle<InterceptorInfo> interceptor(GetIndexedInterceptor()); 5753 Handle<InterceptorInfo> interceptor(GetIndexedInterceptor());
5754 Handle<JSObject> receiver_handle(receiver); 5754 Handle<JSObject> receiver_handle(receiver);
5755 Handle<JSObject> holder_handle(this); 5755 Handle<JSObject> holder_handle(this);
5756 CustomArguments args(interceptor->data(), receiver, this); 5756 CustomArguments args(interceptor->data(), receiver, this);
5757 v8::AccessorInfo info(args.end()); 5757 v8::AccessorInfo info(args.end());
5758 if (!interceptor->query()->IsUndefined()) { 5758 if (!interceptor->query()->IsUndefined()) {
5759 v8::IndexedPropertyQueryImpl query = 5759 v8::IndexedPropertyQuery query =
5760 v8::ToCData<v8::IndexedPropertyQueryImpl>(interceptor->query()); 5760 v8::ToCData<v8::IndexedPropertyQuery>(interceptor->query());
5761 LOG(ApiIndexedPropertyAccess("interceptor-indexed-has", this, index)); 5761 LOG(ApiIndexedPropertyAccess("interceptor-indexed-has", this, index));
5762 v8::Handle<v8::Value> result; 5762 v8::Handle<v8::Integer> result;
5763 { 5763 {
5764 // Leaving JavaScript. 5764 // Leaving JavaScript.
5765 VMState state(EXTERNAL); 5765 VMState state(EXTERNAL);
5766 result = query(index, info); 5766 result = query(index, info);
5767 } 5767 }
5768 if (!result.IsEmpty()) { 5768 if (!result.IsEmpty()) {
5769 // IsBoolean check would be removed when transition to new API is over. 5769 ASSERT(result->IsInt32());
5770 if (result->IsBoolean()) { 5770 return true; // absence of property is signaled by empty handle.
5771 return result->IsTrue() ? true : false;
5772 } else {
5773 ASSERT(result->IsInt32());
5774 return true; // absence of property is signaled by empty handle.
5775 }
5776 } 5771 }
5777 } else if (!interceptor->getter()->IsUndefined()) { 5772 } else if (!interceptor->getter()->IsUndefined()) {
5778 v8::IndexedPropertyGetter getter = 5773 v8::IndexedPropertyGetter getter =
5779 v8::ToCData<v8::IndexedPropertyGetter>(interceptor->getter()); 5774 v8::ToCData<v8::IndexedPropertyGetter>(interceptor->getter());
5780 LOG(ApiIndexedPropertyAccess("interceptor-indexed-has-get", this, index)); 5775 LOG(ApiIndexedPropertyAccess("interceptor-indexed-has-get", this, index));
5781 v8::Handle<v8::Value> result; 5776 v8::Handle<v8::Value> result;
5782 { 5777 {
5783 // Leaving JavaScript. 5778 // Leaving JavaScript.
5784 VMState state(EXTERNAL); 5779 VMState state(EXTERNAL);
5785 result = getter(index, info); 5780 result = getter(index, info);
(...skipping 2968 matching lines...) Expand 10 before | Expand all | Expand 10 after
8754 if (break_point_objects()->IsUndefined()) return 0; 8749 if (break_point_objects()->IsUndefined()) return 0;
8755 // Single beak point. 8750 // Single beak point.
8756 if (!break_point_objects()->IsFixedArray()) return 1; 8751 if (!break_point_objects()->IsFixedArray()) return 1;
8757 // Multiple break points. 8752 // Multiple break points.
8758 return FixedArray::cast(break_point_objects())->length(); 8753 return FixedArray::cast(break_point_objects())->length();
8759 } 8754 }
8760 #endif 8755 #endif
8761 8756
8762 8757
8763 } } // namespace v8::internal 8758 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/api.cc ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698