Reviewers: Jakob,

Description:
Add some ASSERTS to lithium.h

BUG=

Please review this at https://codereview.chromium.org/181553002/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files (+4, -1 lines):
  M src/lithium.h


Index: src/lithium.h
diff --git a/src/lithium.h b/src/lithium.h
index 754f88da82184816de334a89daf09a86a55c1231..ae4db51f6fe44e4d98d81247380f542da6636297 100644
--- a/src/lithium.h
+++ b/src/lithium.h
@@ -71,6 +71,7 @@ class LOperand : public ZoneObject {

   void PrintTo(StringStream* stream);
   void ConvertTo(Kind kind, int index) {
+    if (kind == REGISTER) ASSERT(index >= 0);
     value_ = KindField::encode(kind);
     value_ |= index << kKindFieldWidth;
     ASSERT(this->index() == index);
@@ -424,7 +425,9 @@ class LRegister V8_FINAL : public LOperand {
   static LRegister* cache;

   LRegister() : LOperand() { }
-  explicit LRegister(int index) : LOperand(REGISTER, index) { }
+  explicit LRegister(int index) : LOperand(REGISTER, index) {
+    ASSERT(index >= 0);
+  }
 };




--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to