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

Side by Side Diff: src/runtime/runtime-scopes.cc

Issue 1484723003: [runtime] Use "the hole" instead of smi 0 as sentinel for context extension. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address comment. Created 5 years 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/runtime/runtime-debug.cc ('k') | src/x64/macro-assembler-x64.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/runtime/runtime-utils.h" 5 #include "src/runtime/runtime-utils.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/arguments.h" 8 #include "src/arguments.h"
9 #include "src/ast/scopeinfo.h" 9 #include "src/ast/scopeinfo.h"
10 #include "src/ast/scopes.h" 10 #include "src/ast/scopes.h"
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 287
288 object = Handle<JSObject>::cast(holder); 288 object = Handle<JSObject>::cast(holder);
289 289
290 } else if (context->has_extension()) { 290 } else if (context->has_extension()) {
291 // Sloppy varblock contexts might not have an extension object yet, 291 // Sloppy varblock contexts might not have an extension object yet,
292 // in which case their extension is a ScopeInfo. 292 // in which case their extension is a ScopeInfo.
293 if (context->extension()->IsScopeInfo()) { 293 if (context->extension()->IsScopeInfo()) {
294 DCHECK(context->IsBlockContext()); 294 DCHECK(context->IsBlockContext());
295 object = isolate->factory()->NewJSObject( 295 object = isolate->factory()->NewJSObject(
296 isolate->context_extension_function()); 296 isolate->context_extension_function());
297 Handle<Object> extension = 297 Handle<HeapObject> extension =
298 isolate->factory()->NewSloppyBlockWithEvalContextExtension( 298 isolate->factory()->NewSloppyBlockWithEvalContextExtension(
299 handle(context->scope_info()), object); 299 handle(context->scope_info()), object);
300 context->set_extension(*extension); 300 context->set_extension(*extension);
301 } else { 301 } else {
302 object = handle(context->extension_object(), isolate); 302 object = handle(context->extension_object(), isolate);
303 } 303 }
304 DCHECK(object->IsJSContextExtensionObject() || object->IsJSGlobalObject()); 304 DCHECK(object->IsJSContextExtensionObject() || object->IsJSGlobalObject());
305 } else { 305 } else {
306 DCHECK(context->IsFunctionContext()); 306 DCHECK(context->IsFunctionContext());
307 object = 307 object =
(...skipping 820 matching lines...) Expand 10 before | Expand all | Expand 10 after
1128 1128
1129 // Lookup in the initial Object.prototype object. 1129 // Lookup in the initial Object.prototype object.
1130 Handle<Object> result; 1130 Handle<Object> result;
1131 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( 1131 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
1132 isolate, result, 1132 isolate, result,
1133 Object::GetProperty(isolate->initial_object_prototype(), key)); 1133 Object::GetProperty(isolate->initial_object_prototype(), key));
1134 return *result; 1134 return *result;
1135 } 1135 }
1136 } // namespace internal 1136 } // namespace internal
1137 } // namespace v8 1137 } // namespace v8
OLDNEW
« no previous file with comments | « src/runtime/runtime-debug.cc ('k') | src/x64/macro-assembler-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698