Reviewers: Toon Verwaest,
Message:
PTAL
Description:
Allow map check hoisting in GVN for stable maps.
Please review this at https://codereview.chromium.org/163263002/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files (+6, -10 lines):
M src/hydrogen-instructions.h
M test/cctest/test-deoptimization.cc
Index: src/hydrogen-instructions.h
diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h
index
20a721273ecefcad54578eb1ea6cd0b79c9d2cb7..a2900800cf75fd58d9c34ce7435f26ac20ed341b
100644
--- a/src/hydrogen-instructions.h
+++ b/src/hydrogen-instructions.h
@@ -1557,7 +1557,7 @@ class HCompareMap V8_FINAL : public
HUnaryControlInstruction {
ASSERT(!map.is_null());
is_stable_ = map->is_stable();
- if (FLAG_check_elimination && is_stable_) {
+ if (is_stable_) {
map->AddDependentCompilationInfo(
DependentCode::kPrototypeCheckGroup, info);
}
@@ -2700,10 +2700,12 @@ class HCheckMaps V8_FINAL : public
HTemplateInstruction<2> {
void Add(Handle<Map> map, CompilationInfo* info, Zone* zone) {
map_set_.Add(Unique<Map>(map), zone);
is_stable_ = is_stable_ && map->is_stable();
-
- if (FLAG_check_elimination && is_stable_) {
+ if (is_stable_) {
map->AddDependentCompilationInfo(
DependentCode::kPrototypeCheckGroup, info);
+ } else {
+ SetDependsOnFlag(kMaps);
+ SetDependsOnFlag(kElementsKind);
}
if (!has_migration_target_ && map->is_migration_target()) {
@@ -2722,8 +2724,6 @@ class HCheckMaps V8_FINAL : public
HTemplateInstruction<2> {
set_representation(Representation::Tagged());
SetFlag(kUseGVN);
SetFlag(kTrackSideEffectDominators);
- SetDependsOnFlag(kMaps);
- SetDependsOnFlag(kElementsKind);
}
bool omit_;
@@ -6506,7 +6506,7 @@ class HStoreNamedField V8_FINAL : public
HTemplateInstruction<3> {
has_transition_ = true;
is_stable_ = map->is_stable();
- if (FLAG_check_elimination && is_stable_) {
+ if (is_stable_) {
map->AddDependentCompilationInfo(
DependentCode::kPrototypeCheckGroup, info);
}
Index: test/cctest/test-deoptimization.cc
diff --git a/test/cctest/test-deoptimization.cc
b/test/cctest/test-deoptimization.cc
index
9e36476cbac157382d61f301cc331bd0c39affac..dbbb3edb097d4fc7fc202b93c51611993778e926
100644
--- a/test/cctest/test-deoptimization.cc
+++ b/test/cctest/test-deoptimization.cc
@@ -538,7 +538,6 @@ TEST(DeoptimizeCompare) {
TEST(DeoptimizeLoadICStoreIC) {
i::FLAG_concurrent_recompilation = false;
- i::FLAG_check_elimination = false;
LocalContext env;
v8::HandleScope scope(env->GetIsolate());
@@ -614,13 +613,11 @@ TEST(DeoptimizeLoadICStoreIC) {
CHECK(!GetJSFunction(env->Global(), "g2")->IsOptimized());
CHECK_EQ(4, env->Global()->Get(v8_str("count"))->Int32Value());
CHECK_EQ(13, env->Global()->Get(v8_str("result"))->Int32Value());
- CHECK_EQ(0, Deoptimizer::GetDeoptimizedCodeCount(CcTest::i_isolate()));
}
TEST(DeoptimizeLoadICStoreICNested) {
i::FLAG_concurrent_recompilation = false;
- i::FLAG_check_elimination = false;
LocalContext env;
v8::HandleScope scope(env->GetIsolate());
@@ -697,5 +694,4 @@ TEST(DeoptimizeLoadICStoreICNested) {
CHECK(!GetJSFunction(env->Global(), "g2")->IsOptimized());
CHECK_EQ(1, env->Global()->Get(v8_str("count"))->Int32Value());
CHECK_EQ(13, env->Global()->Get(v8_str("result"))->Int32Value());
- CHECK_EQ(0, Deoptimizer::GetDeoptimizedCodeCount(CcTest::i_isolate()));
}
--
--
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/groups/opt_out.