Revision: 9092
Author: [email protected]
Date: Thu Sep 1 04:06:03 2011
Log: Tiny change flags cleanups.
Introduced a getter for change flags, making a related helper function
private.
Do not print a '*' at the end of hydrogen instruction mnemonics with side
effects, this is subsumed by the 'changes' info.
Review URL: http://codereview.chromium.org/7827009
http://code.google.com/p/v8/source/detail?r=9092
Modified:
/branches/bleeding_edge/src/hydrogen-instructions.cc
/branches/bleeding_edge/src/hydrogen-instructions.h
/branches/bleeding_edge/src/hydrogen.cc
=======================================
--- /branches/bleeding_edge/src/hydrogen-instructions.cc Tue Aug 23
06:23:30 2011
+++ /branches/bleeding_edge/src/hydrogen-instructions.cc Thu Sep 1
04:06:03 2011
@@ -425,7 +425,7 @@
void HValue::PrintChangesTo(StringStream* stream) {
- int changes_flags = (flags() & HValue::ChangesFlagsMask());
+ int changes_flags = ChangesFlags();
if (changes_flags == 0) return;
stream->Add(" changes[");
if (changes_flags == AllSideEffects()) {
@@ -512,9 +512,7 @@
void HInstruction::PrintMnemonicTo(StringStream* stream) {
- stream->Add("%s", Mnemonic());
- if (HasSideEffects()) stream->Add("*");
- stream->Add(" ");
+ stream->Add("%s ", Mnemonic());
}
=======================================
--- /branches/bleeding_edge/src/hydrogen-instructions.h Tue Aug 23 00:34:45
2011
+++ /branches/bleeding_edge/src/hydrogen-instructions.h Thu Sep 1 04:06:03
2011
@@ -513,19 +513,6 @@
static const int kChangesToDependsFlagsLeftShift = 1;
- static int ChangesFlagsMask() {
- int result = 0;
- // Create changes mask.
-#define DECLARE_DO(type) result |= (1 << kChanges##type);
- GVN_FLAG_LIST(DECLARE_DO)
-#undef DECLARE_DO
- return result;
- }
-
- static int DependsFlagsMask() {
- return ConvertChangesToDependsFlags(ChangesFlagsMask());
- }
-
static int ConvertChangesToDependsFlags(int flags) {
return flags << kChangesToDependsFlagsLeftShift;
}
@@ -628,6 +615,8 @@
void SetAllSideEffects() { flags_ |= AllSideEffects(); }
void ClearAllSideEffects() { flags_ &= ~AllSideEffects(); }
bool HasSideEffects() const { return (flags_ & AllSideEffects()) != 0; }
+
+ int ChangesFlags() const { return flags_ & ChangesFlagsMask(); }
Range* range() const { return range_; }
bool HasRange() const { return range_ != NULL; }
@@ -693,6 +682,15 @@
}
private:
+ static int ChangesFlagsMask() {
+ int result = 0;
+ // Create changes mask.
+#define ADD_FLAG(type) result |= (1 << kChanges##type);
+ GVN_FLAG_LIST(ADD_FLAG)
+#undef ADD_FLAG
+ return result;
+ }
+
// A flag mask to mark an instruction as having arbitrary side effects.
static int AllSideEffects() {
return ChangesFlagsMask() & ~(1 << kChangesOsrEntries);
=======================================
--- /branches/bleeding_edge/src/hydrogen.cc Thu Sep 1 03:33:59 2011
+++ /branches/bleeding_edge/src/hydrogen.cc Thu Sep 1 04:06:03 2011
@@ -1382,7 +1382,7 @@
int id = block->block_id();
int side_effects = 0;
while (instr != NULL) {
- side_effects |= (instr->flags() & HValue::ChangesFlagsMask());
+ side_effects |= instr->ChangesFlags();
instr = instr->next();
}
block_side_effects_[id] |= side_effects;
@@ -1499,7 +1499,7 @@
HInstruction* instr = block->first();
while (instr != NULL) {
HInstruction* next = instr->next();
- int flags = (instr->flags() & HValue::ChangesFlagsMask());
+ int flags = instr->ChangesFlags();
if (flags != 0) {
ASSERT(!instr->CheckFlag(HValue::kUseGVN));
// Clear all instructions in the map that are affected by side
effects.
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev