Reviewers: Michael Starzinger,
Description:
[turbofan] OSR loops assign all local variables.
[email protected]
BUG=
Please review this at https://codereview.chromium.org/886733005/
Base URL: https://chromium.googlesource.com/v8/v8.git@master
Affected files (+4, -0 lines):
M src/bit-vector.h
M src/compiler/ast-loop-assignment-analyzer.cc
Index: src/bit-vector.h
diff --git a/src/bit-vector.h b/src/bit-vector.h
index
29c6b438a9b037e84d3833773f4da3c9b71a89ef..9e1ce81db9047b921279d0b3da319b1a11a898fd
100644
--- a/src/bit-vector.h
+++ b/src/bit-vector.h
@@ -103,6 +103,8 @@ class BitVector : public ZoneObject {
data_[i / kDataBits] |= (kOne << (i % kDataBits));
}
+ void AddAll() { memset(data_, -1, sizeof(uintptr_t) * data_length_); }
+
void Remove(int i) {
DCHECK(i >= 0 && i < length());
data_[i / kDataBits] &= ~(kOne << (i % kDataBits));
Index: src/compiler/ast-loop-assignment-analyzer.cc
diff --git a/src/compiler/ast-loop-assignment-analyzer.cc
b/src/compiler/ast-loop-assignment-analyzer.cc
index
f94d9e07d2740b7827fa848d3bc32c511e58c358..e6764d0eb02f42feda6ed2caff172b46424f830e
100644
--- a/src/compiler/ast-loop-assignment-analyzer.cc
+++ b/src/compiler/ast-loop-assignment-analyzer.cc
@@ -30,6 +30,8 @@ void ALAA::Enter(IterationStatement* loop) {
int num_variables = 1 + info()->scope()->num_parameters() +
info()->scope()->num_stack_slots();
BitVector* bits = new (zone()) BitVector(num_variables, zone());
+ if (info()->is_osr() && info()->osr_ast_id() == loop->OsrEntryId())
+ bits->AddAll();
loop_stack_.push_back(bits);
}
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.