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

Side by Side Diff: src/contexts.cc

Issue 197813004: Handlify PropertyAttribute lookups. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: addressed comment Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « src/api.cc ('k') | src/objects.h » ('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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 if (context->IsNativeContext() || 124 if (context->IsNativeContext() ||
125 context->IsWithContext() || 125 context->IsWithContext() ||
126 (context->IsFunctionContext() && context->has_extension())) { 126 (context->IsFunctionContext() && context->has_extension())) {
127 Handle<JSReceiver> object( 127 Handle<JSReceiver> object(
128 JSReceiver::cast(context->extension()), isolate); 128 JSReceiver::cast(context->extension()), isolate);
129 // Context extension objects needs to behave as if they have no 129 // Context extension objects needs to behave as if they have no
130 // prototype. So even if we want to follow prototype chains, we need 130 // prototype. So even if we want to follow prototype chains, we need
131 // to only do a local lookup for context extension objects. 131 // to only do a local lookup for context extension objects.
132 if ((flags & FOLLOW_PROTOTYPE_CHAIN) == 0 || 132 if ((flags & FOLLOW_PROTOTYPE_CHAIN) == 0 ||
133 object->IsJSContextExtensionObject()) { 133 object->IsJSContextExtensionObject()) {
134 *attributes = object->GetLocalPropertyAttribute(*name); 134 *attributes = JSReceiver::GetLocalPropertyAttribute(object, name);
135 } else { 135 } else {
136 *attributes = object->GetPropertyAttribute(*name); 136 *attributes = JSReceiver::GetPropertyAttribute(object, name);
137 } 137 }
138 if (isolate->has_pending_exception()) return Handle<Object>(); 138 if (isolate->has_pending_exception()) return Handle<Object>();
139 139
140 if (*attributes != ABSENT) { 140 if (*attributes != ABSENT) {
141 if (FLAG_trace_contexts) { 141 if (FLAG_trace_contexts) {
142 PrintF("=> found property in context object %p\n", 142 PrintF("=> found property in context object %p\n",
143 reinterpret_cast<void*>(*object)); 143 reinterpret_cast<void*>(*object));
144 } 144 }
145 return object; 145 return object;
146 } 146 }
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 bool Context::IsBootstrappingOrGlobalObject(Isolate* isolate, Object* object) { 389 bool Context::IsBootstrappingOrGlobalObject(Isolate* isolate, Object* object) {
390 // During bootstrapping we allow all objects to pass as global 390 // During bootstrapping we allow all objects to pass as global
391 // objects. This is necessary to fix circular dependencies. 391 // objects. This is necessary to fix circular dependencies.
392 return isolate->heap()->gc_state() != Heap::NOT_IN_GC || 392 return isolate->heap()->gc_state() != Heap::NOT_IN_GC ||
393 isolate->bootstrapper()->IsActive() || 393 isolate->bootstrapper()->IsActive() ||
394 object->IsGlobalObject(); 394 object->IsGlobalObject();
395 } 395 }
396 #endif 396 #endif
397 397
398 } } // namespace v8::internal 398 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/api.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698