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

Unified Diff: src/frame-element.h

Issue 113524: Remove code that adjusts synced and copied flags in MergeTo. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 7 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 | « no previous file | src/ia32/virtual-frame-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/frame-element.h
===================================================================
--- src/frame-element.h (revision 1997)
+++ src/frame-element.h (working copy)
@@ -152,24 +152,27 @@
}
bool Equals(FrameElement other) {
- if (value_ == other.value_) return true;
-
- if (type() != other.type() ||
- is_copied() != other.is_copied() ||
- is_synced() != other.is_synced() ||
- !(static_type() == other.static_type())) {
- return false;
+ uint32_t masked_difference = (value_ ^ other.value_) & ~CopiedField::mask();
+ if (!masked_difference) {
+ // The elements are equal if they agree exactly except on copied field.
+ return true;
+ } else {
+ // If two constants have the same value, and agree otherwise, return true.
+ return !(masked_difference & ~DataField::mask()) &&
+ is_constant() &&
+ handle().is_identical_to(other.handle());
}
+ }
- if (is_register()) {
- if (!reg().is(other.reg())) return false;
- } else if (is_constant()) {
- if (!handle().is_identical_to(other.handle())) return false;
- } else if (is_copy()) {
- if (index() != other.index()) return false;
+ // Test if two FrameElements refer to the same memory or register location.
+ bool SameLocation(FrameElement* other) {
+ if (type() == other->type()) {
+ if (value_ == other->value_) return true;
+ if (is_constant() && handle().is_identical_to(other->handle())) {
+ return true;
+ }
}
-
- return true;
+ return false;
}
// Given a pair of non-null frame element pointers, return one of them
@@ -179,14 +182,7 @@
if (!is_valid()) return this;
if (!other->is_valid()) return other;
- // If they do not have the exact same location we reallocate.
- bool not_same_location =
- (type() != other->type()) ||
- (is_register() && !reg().is(other->reg())) ||
- (is_constant() && !handle().is_identical_to(other->handle())) ||
- (is_copy() && index() != other->index());
- if (not_same_location) return NULL;
-
+ if (!SameLocation(other)) return NULL;
// If either is unsynced, the result is. The result static type is
// the merge of the static types. It's safe to set it on one of the
// frame elements, and harmless too (because we are only going to
« no previous file with comments | « no previous file | src/ia32/virtual-frame-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698