v8/test
keuchel@chromium.org 72dba271eb Reapply r9870 "Remove some initialization checks based on source positions.".
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
2011-11-08 13:28:53 +00:00
..
benchmarks Switch from sample shell to d8 for unit test 2011-07-26 05:56:45 +00:00
cctest Shrink the new space and uncommit marking deque on low memory notification. 2011-11-08 12:42:02 +00:00
es5conform Fixed status file of es5conform test suite. 2011-10-07 15:02:42 +00:00
message Fix bug introduced by earlier "cleanup". 2011-08-22 12:54:03 +00:00
mjsunit Reapply r9870 "Remove some initialization checks based on source positions.". 2011-11-08 13:28:53 +00:00
mozilla Remove special-casing of calls to RegExp test and exec methods with no argument. 2011-10-26 12:51:07 +00:00
preparser Disallow strict mode FutureReservedWords as break/continue labels in strict mode 2011-09-22 16:38:28 +00:00
sputnik Remove special-casing of calls to RegExp test and exec methods with no argument. 2011-10-26 12:51:07 +00:00
test262 Fix setting array length to be ES5 conform. 2011-11-08 11:59:56 +00:00