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

Unified Diff: src/hydrogen.cc

Issue 14040006: Remove relocation lock. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: fixed nits. Created 7 years, 8 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-instructions.h » ('j') | no next file with comments »
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 19edbd0c2efecd25d9ef55dc94d06f94d384ea99..31b6def5dbae2bd6681f7e26e24dd350998efdfb 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -517,7 +517,6 @@ class ReachabilityAnalyzer BASE_EMBEDDED {
void HGraph::Verify(bool do_full_verify) const {
// Allow dereferencing for debug mode verification.
- Heap::RelocationLock(isolate()->heap());
HandleDereferenceGuard allow_handle_deref(isolate(),
HandleDereferenceGuard::ALLOW);
for (int i = 0; i < blocks_.length(); i++) {
@@ -619,6 +618,7 @@ HConstant* HGraph::GetConstant##Name() { \
if (!constant_##name##_.is_set()) { \
HConstant* constant = new(zone()) HConstant( \
isolate()->factory()->name##_value(), \
+ UniqueValueId(isolate()->heap()->name##_value()), \
Representation::Tagged(), \
htype, \
false, \
@@ -880,6 +880,7 @@ HGraph* HGraphBuilder::CreateGraph() {
HPhase phase("H_Block building", isolate());
set_current_block(graph()->entry_block());
if (!BuildGraph()) return NULL;
+ graph()->FinalizeUniqueValueIds();
return graph_;
}
@@ -1696,6 +1697,19 @@ HBasicBlock* HGraph::CreateBasicBlock() {
}
+void HGraph::FinalizeUniqueValueIds() {
+ AssertNoAllocation no_gc;
+ ASSERT(!isolate()->optimizing_compiler_thread()->IsOptimizerThread());
+ for (int i = 0; i < blocks()->length(); ++i) {
+ for (HInstruction* instr = blocks()->at(i)->first();
+ instr != NULL;
+ instr = instr->next()) {
+ instr->FinalizeUniqueValueId();
+ }
+ }
+}
+
+
void HGraph::Canonicalize() {
if (!FLAG_use_canonicalizing) return;
HPhase phase("H_Canonicalize", this);
@@ -4327,8 +4341,6 @@ bool HOptimizedGraphBuilder::BuildGraph() {
void HGraph::GlobalValueNumbering() {
// Perform common subexpression elimination and loop-invariant code motion.
if (FLAG_use_gvn) {
- // We use objects' raw addresses for identification, so they must not move.
- Heap::RelocationLock relocation_lock(isolate()->heap());
HPhase phase("H_Global value numbering", this);
HGlobalValueNumberer gvn(this, info());
bool removed_side_effects = gvn.Analyze();
« no previous file with comments | « src/hydrogen.h ('k') | src/hydrogen-instructions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698