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

Side by Side Diff: src/contexts.cc

Issue 722723002: Move public symbols to the root set. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/bootstrapper.h" 7 #include "src/bootstrapper.h"
8 #include "src/debug.h" 8 #include "src/debug.h"
9 #include "src/scopeinfo.h" 9 #include "src/scopeinfo.h"
10 10
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 * Lookups a property in an object environment, taking the unscopables into 117 * Lookups a property in an object environment, taking the unscopables into
118 * account. This is used For HasBinding spec algorithms for ObjectEnvironment. 118 * account. This is used For HasBinding spec algorithms for ObjectEnvironment.
119 */ 119 */
120 static Maybe<PropertyAttributes> UnscopableLookup(LookupIterator* it) { 120 static Maybe<PropertyAttributes> UnscopableLookup(LookupIterator* it) {
121 Isolate* isolate = it->isolate(); 121 Isolate* isolate = it->isolate();
122 122
123 Maybe<PropertyAttributes> attrs = JSReceiver::GetPropertyAttributes(it); 123 Maybe<PropertyAttributes> attrs = JSReceiver::GetPropertyAttributes(it);
124 DCHECK(attrs.has_value || isolate->has_pending_exception()); 124 DCHECK(attrs.has_value || isolate->has_pending_exception());
125 if (!attrs.has_value || attrs.value == ABSENT) return attrs; 125 if (!attrs.has_value || attrs.value == ABSENT) return attrs;
126 126
127 Handle<Symbol> unscopables_symbol( 127 Handle<Symbol> unscopables_symbol = isolate->factory()->unscopables_symbol();
128 isolate->native_context()->unscopables_symbol(), isolate);
129 Handle<Object> receiver = it->GetReceiver(); 128 Handle<Object> receiver = it->GetReceiver();
130 Handle<Object> unscopables; 129 Handle<Object> unscopables;
131 MaybeHandle<Object> maybe_unscopables = 130 MaybeHandle<Object> maybe_unscopables =
132 Object::GetProperty(receiver, unscopables_symbol); 131 Object::GetProperty(receiver, unscopables_symbol);
133 if (!maybe_unscopables.ToHandle(&unscopables)) { 132 if (!maybe_unscopables.ToHandle(&unscopables)) {
134 return Maybe<PropertyAttributes>(); 133 return Maybe<PropertyAttributes>();
135 } 134 }
136 if (!unscopables->IsSpecObject()) return attrs; 135 if (!unscopables->IsSpecObject()) return attrs;
137 Maybe<bool> blacklist = JSReceiver::HasProperty( 136 Maybe<bool> blacklist = JSReceiver::HasProperty(
138 Handle<JSReceiver>::cast(unscopables), it->name()); 137 Handle<JSReceiver>::cast(unscopables), it->name());
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 bool Context::IsBootstrappingOrGlobalObject(Isolate* isolate, Object* object) { 487 bool Context::IsBootstrappingOrGlobalObject(Isolate* isolate, Object* object) {
489 // During bootstrapping we allow all objects to pass as global 488 // During bootstrapping we allow all objects to pass as global
490 // objects. This is necessary to fix circular dependencies. 489 // objects. This is necessary to fix circular dependencies.
491 return isolate->heap()->gc_state() != Heap::NOT_IN_GC || 490 return isolate->heap()->gc_state() != Heap::NOT_IN_GC ||
492 isolate->bootstrapper()->IsActive() || 491 isolate->bootstrapper()->IsActive() ||
493 object->IsGlobalObject(); 492 object->IsGlobalObject();
494 } 493 }
495 #endif 494 #endif
496 495
497 } } // namespace v8::internal 496 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698