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

Unified Diff: runtime/vm/assembler_mips.h

Issue 2937933002: Reduce copying, redundancy & repetition for codegen of comparison instructions (Closed)
Patch Set: Created 3 years, 6 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 | runtime/vm/constants_arm.h » ('j') | runtime/vm/constants_arm.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/assembler_mips.h
diff --git a/runtime/vm/assembler_mips.h b/runtime/vm/assembler_mips.h
index 2236b7fc3d8b6fe6766d4731c71a057ecbdede2f..117f8f9188ea6b113fcbea99baf1ba2454460f22 100644
--- a/runtime/vm/assembler_mips.h
+++ b/runtime/vm/assembler_mips.h
@@ -177,6 +177,12 @@ class Condition : public ValueObject {
bits_ = RelOpBits::update(value, bits_);
}
+ void SetToInvalidState() {
Vyacheslav Egorov (Google) 2017/06/15 11:32:46 Maybe this method should be private?
erikcorry 2017/06/19 07:15:08 Done.
+ bits_ = RelOpBits::update(INVALID_RELATION, bits_);
+ }
+
+ bool IsValid() { return rel_op() != INVALID_RELATION; }
+
// Uninitialized condition.
Condition() : ValueObject(), bits_(0) {}
Vyacheslav Egorov (Google) 2017/06/15 11:32:46 I would suggest that this one sets bits_ to invali
erikcorry 2017/06/19 07:15:09 Done.
@@ -200,7 +206,11 @@ class Condition : public ValueObject {
ASSERT((imm != 0) == ((left == IMM) || (right == IMM)));
set_left(left);
set_right(right);
- set_rel_op(rel_op);
+ if (rel_op == INVALID_RELATION) {
Vyacheslav Egorov (Google) 2017/06/15 11:32:46 ... and here ASSERT(rel_op != INVALID_RELATION)
erikcorry 2017/06/19 07:15:09 I put the assert in the getters for the register n
+ SetToInvalidState();
+ } else {
+ set_rel_op(rel_op);
+ }
set_imm(imm);
}
« no previous file with comments | « no previous file | runtime/vm/constants_arm.h » ('j') | runtime/vm/constants_arm.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698