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

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

Issue 1292753007: [es6] Parameter scopes for sloppy eval (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Comments Created 5 years, 4 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
« no previous file with comments | « src/pattern-rewriter.cc ('k') | src/runtime/runtime-scopes.cc » ('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/arguments.h" 7 #include "src/arguments.h"
8 #include "src/bootstrapper.h" 8 #include "src/bootstrapper.h"
9 #include "src/debug/debug.h" 9 #include "src/debug/debug.h"
10 #include "src/messages.h" 10 #include "src/messages.h"
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after
416 HandleScope scope(isolate); 416 HandleScope scope(isolate);
417 DCHECK_EQ(1, args.length()); 417 DCHECK_EQ(1, args.length());
418 CONVERT_SMI_ARG_CHECKED(slot, 0); 418 CONVERT_SMI_ARG_CHECKED(slot, 0);
419 419
420 // Go up context chain to the script context. 420 // Go up context chain to the script context.
421 Handle<Context> script_context(isolate->context()->script_context(), isolate); 421 Handle<Context> script_context(isolate->context()->script_context(), isolate);
422 DCHECK(script_context->IsScriptContext()); 422 DCHECK(script_context->IsScriptContext());
423 DCHECK(script_context->get(slot)->IsPropertyCell()); 423 DCHECK(script_context->get(slot)->IsPropertyCell());
424 424
425 // Lookup the named property on the global object. 425 // Lookup the named property on the global object.
426 Handle<ScopeInfo> scope_info(ScopeInfo::cast(script_context->extension()), 426 Handle<ScopeInfo> scope_info(script_context->scope_info(), isolate);
427 isolate);
428 Handle<Name> name(scope_info->ContextSlotName(slot), isolate); 427 Handle<Name> name(scope_info->ContextSlotName(slot), isolate);
429 Handle<GlobalObject> global_object(script_context->global_object(), isolate); 428 Handle<GlobalObject> global_object(script_context->global_object(), isolate);
430 LookupIterator it(global_object, name, LookupIterator::HIDDEN); 429 LookupIterator it(global_object, name, LookupIterator::HIDDEN);
431 430
432 // Switch to fast mode only if there is a data property and it's not on 431 // Switch to fast mode only if there is a data property and it's not on
433 // a hidden prototype. 432 // a hidden prototype.
434 if (it.state() == LookupIterator::DATA && 433 if (it.state() == LookupIterator::DATA &&
435 it.GetHolder<Object>().is_identical_to(global_object)) { 434 it.GetHolder<Object>().is_identical_to(global_object)) {
436 // Now update the cell in the script context. 435 // Now update the cell in the script context.
437 Handle<PropertyCell> cell = it.GetPropertyCell(); 436 Handle<PropertyCell> cell = it.GetPropertyCell();
(...skipping 13 matching lines...) Expand all
451 namespace { 450 namespace {
452 451
453 Object* StoreGlobalViaContext(Isolate* isolate, int slot, Handle<Object> value, 452 Object* StoreGlobalViaContext(Isolate* isolate, int slot, Handle<Object> value,
454 LanguageMode language_mode) { 453 LanguageMode language_mode) {
455 // Go up context chain to the script context. 454 // Go up context chain to the script context.
456 Handle<Context> script_context(isolate->context()->script_context(), isolate); 455 Handle<Context> script_context(isolate->context()->script_context(), isolate);
457 DCHECK(script_context->IsScriptContext()); 456 DCHECK(script_context->IsScriptContext());
458 DCHECK(script_context->get(slot)->IsPropertyCell()); 457 DCHECK(script_context->get(slot)->IsPropertyCell());
459 458
460 // Lookup the named property on the global object. 459 // Lookup the named property on the global object.
461 Handle<ScopeInfo> scope_info(ScopeInfo::cast(script_context->extension()), 460 Handle<ScopeInfo> scope_info(script_context->scope_info(), isolate);
462 isolate);
463 Handle<Name> name(scope_info->ContextSlotName(slot), isolate); 461 Handle<Name> name(scope_info->ContextSlotName(slot), isolate);
464 Handle<GlobalObject> global_object(script_context->global_object(), isolate); 462 Handle<GlobalObject> global_object(script_context->global_object(), isolate);
465 LookupIterator it(global_object, name, LookupIterator::HIDDEN); 463 LookupIterator it(global_object, name, LookupIterator::HIDDEN);
466 464
467 // Switch to fast mode only if there is a data property and it's not on 465 // Switch to fast mode only if there is a data property and it's not on
468 // a hidden prototype. 466 // a hidden prototype.
469 if (it.state() == LookupIterator::DATA && 467 if (it.state() == LookupIterator::DATA &&
470 it.GetHolder<Object>().is_identical_to(global_object)) { 468 it.GetHolder<Object>().is_identical_to(global_object)) {
471 // Now update cell in the script context. 469 // Now update cell in the script context.
472 Handle<PropertyCell> cell = it.GetPropertyCell(); 470 Handle<PropertyCell> cell = it.GetPropertyCell();
(...skipping 992 matching lines...) Expand 10 before | Expand all | Expand 10 after
1465 SealHandleScope scope(isolate); 1463 SealHandleScope scope(isolate);
1466 DCHECK_EQ(2, args.length()); 1464 DCHECK_EQ(2, args.length());
1467 CONVERT_ARG_CHECKED(Object, x, 0); 1465 CONVERT_ARG_CHECKED(Object, x, 0);
1468 CONVERT_ARG_CHECKED(Object, y, 1); 1466 CONVERT_ARG_CHECKED(Object, y, 1);
1469 // TODO(bmeurer): Change this at some point to return true/false instead. 1467 // TODO(bmeurer): Change this at some point to return true/false instead.
1470 return Smi::FromInt(x->StrictEquals(y) ? EQUAL : NOT_EQUAL); 1468 return Smi::FromInt(x->StrictEquals(y) ? EQUAL : NOT_EQUAL);
1471 } 1469 }
1472 1470
1473 } // namespace internal 1471 } // namespace internal
1474 } // namespace v8 1472 } // namespace v8
OLDNEW
« no previous file with comments | « src/pattern-rewriter.cc ('k') | src/runtime/runtime-scopes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698