Fix place where linter complains about lonely {
authorerik.corry@gmail.com <erik.corry@gmail.com@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 3 Nov 2008 12:08:01 +0000 (12:08 +0000)
committererik.corry@gmail.com <erik.corry@gmail.com@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 3 Nov 2008 12:08:01 +0000 (12:08 +0000)
Fix place where ARM compiler loses track of whether variables were initialized.
Review URL: http://codereview.chromium.org/9244

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@678 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/objects-inl.h
src/objects.h
src/runtime.cc

index 0532be3aca48723c09f66c1e58c1dd1b5b573983..97c68198ca1d2085da6d69e41891a39212307ec5 100644 (file)
@@ -185,31 +185,22 @@ bool Object::IsSlicedString() {
 
 
 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);
 }
 
index 2fcf131b64d6bb794b6d542e43351cee18f9dedc..a29182264e6a70564b92adf09ce783e80dca2714 100644 (file)
@@ -3060,7 +3060,10 @@ class StringShape BASE_EMBEDDED {
  private:
   uint32_t type_;
 #ifdef DEBUG
+  inline void set_valid() { valid_ = true; }
   bool valid_;
+#else
+  inline void set_valid() { }
 #endif
 };
 
index 7dc2871d27fe79d9e5d7316d7fd7449dce0f3699..6d9f2a3bed710b8ff7904f63a95a634838883584 100644 (file)
@@ -2258,7 +2258,8 @@ static inline int Unescape(String* source,
                            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' &&