Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1012)

Unified Diff: src/hydrogen.cc

Issue 18596005: Allocation folding integrated into the GVN phase. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/hydrogen.h ('k') | src/hydrogen-gvn.cc » ('j') | src/hydrogen-gvn.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index 741b8c53ada0e4d19399e4e72830b1b9f18446b0..ae5d7d40b915aa0dcab3e746f94c308cdca3f919 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -663,6 +663,23 @@ DEFINE_GET_CONSTANT(False, false, HType::Boolean(), false)
DEFINE_GET_CONSTANT(Hole, the_hole, HType::Tagged(), false)
DEFINE_GET_CONSTANT(Null, null, HType::Tagged(), false)
+HConstant* HGraph::GetConstantFreeSpaceMap() {
+ if (!constant_free_space_map_.is_set()) {
+ HConstant* constant = new(zone()) HConstant(
+ isolate()->factory()->free_space_map(),
+ UniqueValueId(isolate()->heap()->free_space_map()),
+ Representation::None(),
+ HType::Tagged(),
+ false,
+ true,
+ false,
+ false);
+ constant->InsertAfter(GetConstantUndefined());
+ constant_free_space_map_.set(constant);
+ }
+ return constant_free_space_map_.get();
+}
+
#undef DEFINE_GET_CONSTANT
@@ -3440,6 +3457,7 @@ bool HGraph::Optimize(SmartArrayPointer<char>* bailout_reason) {
// The constant is needed to make idef-based bounds check work: the pass
// evaluates relations with "zero" and that zero cannot be created after GVN.
GetConstant0();
+ GetConstantFreeSpaceMap();
#ifdef DEBUG
// Do a full verify after building the graph and computing dominators.
« no previous file with comments | « src/hydrogen.h ('k') | src/hydrogen-gvn.cc » ('j') | src/hydrogen-gvn.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698