• keuchel@chromium.org's avatar
    Reapply r9870 "Remove some initialization checks based on source positions.". · 72dba271
    keuchel@chromium.org authored
    This reverts r9896 "Revert r9870 due to browser-test failures." See below for
    the diff from the previous version for the ia32 platform. The code for other
    platforms has been changed accordingly.
    
    TEST=mjsunit/compiler/lazy-const-lookup.js
    
    diff --git a/src/ia32/full-codegen-ia32.cc b/src/ia32/full-codegen-ia32.cc
    index 2cbf518..1990f2f 100644
    --- a/src/ia32/full-codegen-ia32.cc
    +++ b/src/ia32/full-codegen-ia32.cc
    @@ -1258,13 +1258,17 @@ void FullCodeGenerator::EmitVariableLoad(VariableProxy* proxy) {
             // binding is initialized:
             //   function() { f(); let x = 1; function f() { x = 2; } }
             //
    -        // Check that we always have valid source position.
    -        ASSERT(var->initializer_position() != RelocInfo::kNoPosition);
    -        ASSERT(proxy->position() != RelocInfo::kNoPosition);
    -        bool skip_init_check =
    -            var->mode() != CONST &&
    -            var->scope()->DeclarationScope() == scope()->DeclarationScope() &&
    -            var->initializer_position() < proxy->position();
    +        bool skip_init_check;
    +        if (var->scope()->DeclarationScope() != scope()->DeclarationScope()) {
    +          skip_init_check = false;
    +        } else {
    +          // Check that we always have valid source position.
    +          ASSERT(var->initializer_position() != RelocInfo::kNoPosition);
    +          ASSERT(proxy->position() != RelocInfo::kNoPosition);
    +          skip_init_check = var->mode() != CONST &&
    +              var->initializer_position() < proxy->position();
    +        }
    +
             if (!skip_init_check) {
               // Let and const need a read barrier.
               Label done;
    
    Review URL: http://codereview.chromium.org/8479034
    
    git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9915 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
    72dba271
Name
Last commit
Last update
..
assembler-x64-inl.h Loading commit data...
assembler-x64.cc Loading commit data...
assembler-x64.h Loading commit data...
builtins-x64.cc Loading commit data...
code-stubs-x64.cc Loading commit data...
code-stubs-x64.h Loading commit data...
codegen-x64.cc Loading commit data...
codegen-x64.h Loading commit data...
cpu-x64.cc Loading commit data...
debug-x64.cc Loading commit data...
deoptimizer-x64.cc Loading commit data...
disasm-x64.cc Loading commit data...
frames-x64.cc Loading commit data...
frames-x64.h Loading commit data...
full-codegen-x64.cc Loading commit data...
ic-x64.cc Loading commit data...
lithium-codegen-x64.cc Loading commit data...
lithium-codegen-x64.h Loading commit data...
lithium-gap-resolver-x64.cc Loading commit data...
lithium-gap-resolver-x64.h Loading commit data...
lithium-x64.cc Loading commit data...
lithium-x64.h Loading commit data...
macro-assembler-x64.cc Loading commit data...
macro-assembler-x64.h Loading commit data...
regexp-macro-assembler-x64.cc Loading commit data...
regexp-macro-assembler-x64.h Loading commit data...
simulator-x64.cc Loading commit data...
simulator-x64.h Loading commit data...
stub-cache-x64.cc Loading commit data...