DescriptionReapply 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;
Committed: http://code.google.com/p/v8/source/detail?r=9915
Patch Set 1 #
Messages
Total messages: 2 (0 generated)
|