• 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
..
alloc-number.js Loading commit data...
array-access.js Loading commit data...
array-length.js Loading commit data...
assignment-deopt.js Loading commit data...
assignment.js Loading commit data...
binary-ops.js Loading commit data...
call-keyed.js Loading commit data...
compare.js Loading commit data...
complex-for-in.js Loading commit data...
control-flow-0.js Loading commit data...
control-flow-1.js Loading commit data...
control-flow-2.js Loading commit data...
count-deopt.js Loading commit data...
countoperation.js Loading commit data...
delete.js Loading commit data...
deopt-args.js Loading commit data...
deopt-inlined-smi.js Loading commit data...
eval-introduced-closure.js Loading commit data...
expression-trees.js Loading commit data...
for-stmt.js Loading commit data...
function-call.js Loading commit data...
global-accessors.js Loading commit data...
globals.js Loading commit data...
inline-arguments.js Loading commit data...
inline-compare.js Loading commit data...
inline-conditional.js Loading commit data...
inline-context-slots.js Loading commit data...
inline-global-access.js Loading commit data...
inline-param.js Loading commit data...
inline-throw.js Loading commit data...
inline-two.js Loading commit data...
jsnatives.js Loading commit data...
lazy-const-lookup.js Loading commit data...
literals-assignment.js Loading commit data...
literals.js Loading commit data...
logical-and.js Loading commit data...
logical-or.js Loading commit data...
loopcount.js Loading commit data...
loops.js Loading commit data...
null-compare.js Loading commit data...
objectliterals.js Loading commit data...
optimized-function-calls.js Loading commit data...
pic.js Loading commit data...
property-calls.js Loading commit data...
property-refs.js Loading commit data...
property-simple.js Loading commit data...
property-stores.js Loading commit data...
recursive-deopt.js Loading commit data...
regress-0.js Loading commit data...
regress-1.js Loading commit data...
regress-1085.js Loading commit data...
regress-1394.js Loading commit data...
regress-2.js Loading commit data...
regress-3.js Loading commit data...
regress-3136962.js Loading commit data...
regress-3185901.js Loading commit data...
regress-3218915.js Loading commit data...
regress-3249650.js Loading commit data...
regress-3260426.js Loading commit data...
regress-4.js Loading commit data...
regress-5.js Loading commit data...
regress-6.js Loading commit data...
regress-7.js Loading commit data...
regress-8.js Loading commit data...
regress-96989.js Loading commit data...
regress-arguments.js Loading commit data...
regress-arrayliteral.js Loading commit data...
regress-closures-with-eval.js Loading commit data...
regress-const.js Loading commit data...
regress-deopt-call-as-function.js Loading commit data...
regress-funarguments.js Loading commit data...
regress-funcaller.js Loading commit data...
regress-gap.js Loading commit data...
regress-gvn.js Loading commit data...
regress-inline-callfunctionstub.js Loading commit data...
regress-intoverflow.js Loading commit data...
regress-lbranch-double.js Loading commit data...
regress-loadfield.js Loading commit data...
regress-loop-deopt.js Loading commit data...
regress-max-locals-for-osr.js Loading commit data...
regress-max.js Loading commit data...
regress-or.js Loading commit data...
regress-rep-change.js Loading commit data...
regress-serialized-slots.js Loading commit data...
regress-stacktrace-methods.js Loading commit data...
regress-stacktrace.js Loading commit data...
regress-valueof.js Loading commit data...
safepoint.js Loading commit data...
short-circuit.js Loading commit data...
simple-bailouts.js Loading commit data...
simple-binary-op.js Loading commit data...
simple-deopt.js Loading commit data...
simple-global-access.js Loading commit data...
simple-inlining.js Loading commit data...
simple-osr.js Loading commit data...
strict-recompile.js Loading commit data...
switch-bailout.js Loading commit data...
this-property-refs.js Loading commit data...
thisfunction.js Loading commit data...
unary-add.js Loading commit data...
variables.js Loading commit data...