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

Unified Diff: src/runtime/runtime-array.cc

Issue 639123009: Classes: Add basic support for properties (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: git rebase Created 6 years, 2 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
« no previous file with comments | « src/runtime/runtime.h ('k') | src/runtime/runtime-collections.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-array.cc
diff --git a/src/runtime/runtime-array.cc b/src/runtime/runtime-array.cc
index 939898edfa345dd2bdc1196d4afe35c4e0cfcddd..c3a6d80ecf5ba422f0a2ff1ffa632a4cb5bd1269 100644
--- a/src/runtime/runtime-array.cc
+++ b/src/runtime/runtime-array.cc
@@ -5,7 +5,6 @@
#include "src/v8.h"
#include "src/arguments.h"
-#include "src/runtime/runtime.h"
#include "src/runtime/runtime-utils.h"
namespace v8 {
@@ -1044,6 +1043,30 @@ RUNTIME_FUNCTION(Runtime_NormalizeElements) {
}
+RUNTIME_FUNCTION(Runtime_HasComplexElements) {
+ HandleScope scope(isolate);
+ DCHECK(args.length() == 1);
+ CONVERT_ARG_HANDLE_CHECKED(JSObject, array, 0);
+ for (PrototypeIterator iter(isolate, array,
+ PrototypeIterator::START_AT_RECEIVER);
+ !iter.IsAtEnd(); iter.Advance()) {
+ if (PrototypeIterator::GetCurrent(iter)->IsJSProxy()) {
+ return isolate->heap()->true_value();
+ }
+ Handle<JSObject> current =
+ Handle<JSObject>::cast(PrototypeIterator::GetCurrent(iter));
+ if (current->HasIndexedInterceptor()) {
+ return isolate->heap()->true_value();
+ }
+ if (!current->HasDictionaryElements()) continue;
+ if (current->element_dictionary()->HasComplexElements()) {
+ return isolate->heap()->true_value();
+ }
+ }
+ return isolate->heap()->false_value();
+}
+
+
// TODO(dcarney): remove this function when TurboFan supports it.
// Takes the object to be iterated over and the result of GetPropertyNamesFast
// Returns pair (cache_array, cache_type).
« no previous file with comments | « src/runtime/runtime.h ('k') | src/runtime/runtime-collections.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698