Reviewers: Christian Plesner Hansen,

Description:
Fix place where linter complains about lonely {
Fix place where ARM compiler loses track of whether variables were
initialized.

Please review this at http://codereview.chromium.org/9244

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

Affected files:
   M     src/objects-inl.h
   M     src/objects.h
   M     src/runtime.cc


Index: src/runtime.cc
===================================================================
--- src/runtime.cc      (revision 676)
+++ src/runtime.cc      (working copy)
@@ -2258,7 +2258,8 @@
                             int length,
                             int* step) {
    uint16_t character = source->Get(shape, i);
-  int32_t hi, lo;
+  int32_t hi = 0;
+  int32_t lo = 0;
    if (character == '%' &&
        i <= length - 6 &&
        source->Get(shape, i + 1) == 'u' &&
Index: src/objects.h
===================================================================
--- src/objects.h       (revision 676)
+++ src/objects.h       (working copy)
@@ -3060,7 +3060,10 @@
   private:
    uint32_t type_;
  #ifdef DEBUG
+  inline void set_valid() { valid_ = true; }
    bool valid_;
+#else
+  inline void set_valid() { }
  #endif
  };

Index: src/objects-inl.h
===================================================================
--- src/objects-inl.h   (revision 676)
+++ src/objects-inl.h   (working copy)
@@ -185,31 +185,22 @@


  StringShape::StringShape(String* str)
-  : type_(str->map()->instance_type())
-#ifdef DEBUG
-    , valid_(true)
-#endif  // def DEBUG
-  {
+  : type_(str->map()->instance_type()) {
+  set_valid();
    ASSERT((type_ & kIsNotStringMask) == kStringTag);
  }


  StringShape::StringShape(Map* map)
-  : type_(map->instance_type())
-#ifdef DEBUG
-    , valid_(true)
-#endif  // def DEBUG
-  {
+  : type_(map->instance_type()) {
+  set_valid();
    ASSERT((type_ & kIsNotStringMask) == kStringTag);
  }


  StringShape::StringShape(InstanceType t)
-  : type_(static_cast<uint32_t>(t))
-#ifdef DEBUG
-    , valid_(true)
-#endif  // def DEBUG
-  {
+  : type_(static_cast<uint32_t>(t)) {
+  set_valid();
    ASSERT((type_ & kIsNotStringMask) == kStringTag);
  }




--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to