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

Unified Diff: src/virtual-frame.cc

Issue 668151: Make more use of the NumberInfo data.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 10 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
Index: src/virtual-frame.cc
===================================================================
--- src/virtual-frame.cc (revision 4025)
+++ src/virtual-frame.cc (working copy)
@@ -43,7 +43,7 @@
// not conflict with the existing type information and must be equally or
// more precise. The default parameter value kUninitialized means that there
// is no additional information.
-FrameElement VirtualFrame::CopyElementAt(int index, NumberInfo::Type info) {
+FrameElement VirtualFrame::CopyElementAt(int index, NumberInfo info) {
ASSERT(index >= 0);
ASSERT(index < element_count());
@@ -74,14 +74,14 @@
result.set_index(index);
elements_[index].set_copied();
// Update backing element's number information.
- NumberInfo::Type existing = elements_[index].number_info();
- ASSERT(existing != NumberInfo::kUninitialized);
- // Assert that the new type information (a) does not conflict with the
- // existing one and (b) is equally or more precise.
- ASSERT((info == NumberInfo::kUninitialized) ||
- (existing | info) != NumberInfo::kUninitialized);
- ASSERT(existing <= info);
- elements_[index].set_number_info(info != NumberInfo::kUninitialized
+ NumberInfo existing = elements_[index].number_info();
+ ASSERT(!existing.IsUninitialized());
+ // Assert that the new type information (a) does not conflict with the existing one and
+ // (b) is equally or more precise.
+ ASSERT((info.ToInt() & existing.ToInt()) == existing.ToInt());
+ ASSERT((info.ToInt() | existing.ToInt()) == info.ToInt());
+
+ elements_[index].set_number_info(!info.IsUninitialized()
? info
: existing);
break;
@@ -104,7 +104,7 @@
ASSERT(stack_pointer_ == element_count() - 1);
for (int i = 0; i < count; i++) {
- elements_.Add(FrameElement::MemoryElement(NumberInfo::kUnknown));
+ elements_.Add(FrameElement::MemoryElement(NumberInfo::Unknown()));
}
stack_pointer_ += count;
}
@@ -152,7 +152,7 @@
SyncElementAt(index);
// Number type information is preserved.
// Copies get their number information from their backing element.
- NumberInfo::Type info;
+ NumberInfo info;
if (!elements_[index].is_copy()) {
info = elements_[index].number_info();
} else {

Powered by Google App Engine
This is Rietveld 408576698