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

Unified Diff: src/lookup-inl.h

Issue 437513002: Inline LookupInHolder and NextHolder (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Don't recreate a handle for the map if it didn't change Created 6 years, 5 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/lookup.cc ('k') | tools/gyp/v8.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/lookup-inl.h
diff --git a/src/lookup-inl.h b/src/lookup-inl.h
new file mode 100644
index 0000000000000000000000000000000000000000..87ee0e0361e85b3b7546e616cf467f78772a476b
--- /dev/null
+++ b/src/lookup-inl.h
@@ -0,0 +1,68 @@
+// Copyright 2014 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef V8_LOOKUP_INL_H_
+#define V8_LOOKUP_INL_H_
+
+#include "src/lookup.h"
+
+namespace v8 {
+namespace internal {
+
+
+JSReceiver* LookupIterator::NextHolder(Map* map) {
+ DisallowHeapAllocation no_gc;
+ if (map->prototype()->IsNull()) return NULL;
+
+ JSReceiver* next = JSReceiver::cast(map->prototype());
+ ASSERT(!next->map()->IsGlobalObjectMap() ||
+ next->map()->is_hidden_prototype());
+
+ if (!check_derived() &&
+ !(check_hidden() && next->map()->is_hidden_prototype())) {
+ return NULL;
+ }
+
+ return next;
+}
+
+
+LookupIterator::State LookupIterator::LookupInHolder(Map* map) {
+ DisallowHeapAllocation no_gc;
+ switch (state_) {
+ case NOT_FOUND:
+ if (map->IsJSProxyMap()) {
+ return JSPROXY;
+ }
+ if (check_access_check() && map->is_access_check_needed()) {
+ return ACCESS_CHECK;
+ }
+ // Fall through.
+ case ACCESS_CHECK:
+ if (check_interceptor() && map->has_named_interceptor()) {
+ return INTERCEPTOR;
+ }
+ // Fall through.
+ case INTERCEPTOR:
+ if (map->is_dictionary_map()) {
+ property_encoding_ = DICTIONARY;
+ } else {
+ DescriptorArray* descriptors = map->instance_descriptors();
+ number_ = descriptors->SearchWithCache(*name_, map);
+ if (number_ == DescriptorArray::kNotFound) return NOT_FOUND;
+ property_encoding_ = DESCRIPTOR;
+ }
+ return PROPERTY;
+ case PROPERTY:
+ return NOT_FOUND;
+ case JSPROXY:
+ UNREACHABLE();
+ }
+ UNREACHABLE();
+ return state_;
+}
+}
+} // namespace v8::internal
+
+#endif // V8_LOOKUP_INL_H_
« no previous file with comments | « src/lookup.cc ('k') | tools/gyp/v8.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698