Revision: 21222
Author:   [email protected]
Date:     Fri May  9 12:59:24 2014 UTC
Log:      Presubmit checks recover:
1) runtime/references checks temporarily disabled (56 items left)
2) other errors fixed

[email protected]

Review URL: https://codereview.chromium.org/277913002
http://code.google.com/p/v8/source/detail?r=21222

Modified:
 /branches/bleeding_edge/include/v8-profiler.h
 /branches/bleeding_edge/include/v8-util.h
 /branches/bleeding_edge/include/v8.h
 /branches/bleeding_edge/src/allocation-site-scopes.h
 /branches/bleeding_edge/src/arm/constants-arm.h
 /branches/bleeding_edge/src/arm/simulator-arm.cc
 /branches/bleeding_edge/src/arm/simulator-arm.h
 /branches/bleeding_edge/src/arm64/constants-arm64.h
 /branches/bleeding_edge/src/arm64/cpu-arm64.cc
 /branches/bleeding_edge/src/arm64/cpu-arm64.h
 /branches/bleeding_edge/src/arm64/lithium-arm64.h
 /branches/bleeding_edge/src/assembler.h
 /branches/bleeding_edge/src/counters.h
 /branches/bleeding_edge/src/elements.cc
 /branches/bleeding_edge/src/full-codegen.h
 /branches/bleeding_edge/src/hydrogen-instructions.h
 /branches/bleeding_edge/src/ia32/assembler-ia32.h
 /branches/bleeding_edge/src/mips/assembler-mips.h
 /branches/bleeding_edge/src/mips/constants-mips.cc
 /branches/bleeding_edge/src/mips/constants-mips.h
 /branches/bleeding_edge/src/mips/disasm-mips.cc
 /branches/bleeding_edge/src/mips/macro-assembler-mips.cc
 /branches/bleeding_edge/src/mips/macro-assembler-mips.h
 /branches/bleeding_edge/src/mips/simulator-mips.cc
 /branches/bleeding_edge/src/objects.h
 /branches/bleeding_edge/src/preparse-data.h
 /branches/bleeding_edge/src/regexp-macro-assembler-tracer.cc
 /branches/bleeding_edge/src/x64/assembler-x64.h
 /branches/bleeding_edge/test/cctest/test-api.cc
 /branches/bleeding_edge/test/cctest/test-semaphore.cc
 /branches/bleeding_edge/test/cctest/test-spaces.cc
 /branches/bleeding_edge/tools/presubmit.py

=======================================
--- /branches/bleeding_edge/include/v8-profiler.h Tue Apr 29 06:42:26 2014 UTC +++ /branches/bleeding_edge/include/v8-profiler.h Fri May 9 12:59:24 2014 UTC
@@ -292,7 +292,7 @@
    */
virtual WriteResult WriteHeapStatsChunk(HeapStatsUpdate* data, int count) {
     return kAbort;
-  };
+  }
 };


=======================================
--- /branches/bleeding_edge/include/v8-util.h   Tue Apr 29 06:42:26 2014 UTC
+++ /branches/bleeding_edge/include/v8-util.h   Fri May  9 12:59:24 2014 UTC
@@ -422,7 +422,7 @@
    */
   void Append(UniquePersistent<V> persistent) {
     Traits::Append(&impl_, ClearAndLeak(&persistent));
-  };
+  }

   /**
    * Are there any values in the vector?
=======================================
--- /branches/bleeding_edge/include/v8.h        Fri May  9 12:33:29 2014 UTC
+++ /branches/bleeding_edge/include/v8.h        Fri May  9 12:59:24 2014 UTC
@@ -1039,7 +1039,7 @@
     int length;
     BufferPolicy buffer_policy;

-  private:
+   private:
      // Prevent copying. Not implemented.
      CachedData(const CachedData&);
      CachedData& operator=(const CachedData&);
=======================================
--- /branches/bleeding_edge/src/allocation-site-scopes.h Tue Apr 29 06:42:26 2014 UTC +++ /branches/bleeding_edge/src/allocation-site-scopes.h Fri May 9 12:59:24 2014 UTC
@@ -20,7 +20,7 @@
  public:
   explicit AllocationSiteContext(Isolate* isolate) {
     isolate_ = isolate;
-  };
+  }

   Handle<AllocationSite> top() { return top_; }
   Handle<AllocationSite> current() { return current_; }
=======================================
--- /branches/bleeding_edge/src/arm/constants-arm.h Tue Apr 29 06:42:26 2014 UTC +++ /branches/bleeding_edge/src/arm/constants-arm.h Fri May 9 12:59:24 2014 UTC
@@ -110,7 +110,7 @@
       return ge;
     default:
       return cond;
-  };
+  }
 }


=======================================
--- /branches/bleeding_edge/src/arm/simulator-arm.cc Tue Apr 29 06:42:26 2014 UTC +++ /branches/bleeding_edge/src/arm/simulator-arm.cc Fri May 9 12:59:24 2014 UTC
@@ -694,9 +694,9 @@
char* cached_line = cache_page->CachedData(offset & ~CachePage::kLineMask);
   if (cache_hit) {
     // Check that the data in memory matches the contents of the I-cache.
-    CHECK(memcmp(reinterpret_cast<void*>(instr),
-                 cache_page->CachedData(offset),
-                 Instruction::kInstrSize) == 0);
+    CHECK_EQ(0, memcmp(reinterpret_cast<void*>(instr),
+                       cache_page->CachedData(offset),
+                       Instruction::kInstrSize));
   } else {
     // Cache miss.  Load memory into the cache.
     OS::MemCopy(cached_line, line, CachePage::kLineLength);
=======================================
--- /branches/bleeding_edge/src/arm/simulator-arm.h Tue Apr 29 06:42:26 2014 UTC +++ /branches/bleeding_edge/src/arm/simulator-arm.h Fri May 9 12:59:24 2014 UTC
@@ -265,7 +265,7 @@

   inline int GetCarry() {
     return c_flag_ ? 1 : 0;
-  };
+  }

   // Support for VFP.
   void Compute_FPSCR_Flags(double val1, double val2);
=======================================
--- /branches/bleeding_edge/src/arm64/constants-arm64.h Tue May 6 11:00:28 2014 UTC +++ /branches/bleeding_edge/src/arm64/constants-arm64.h Fri May 9 12:59:24 2014 UTC
@@ -293,7 +293,7 @@
       // 'mi' for instance).
       UNREACHABLE();
       return nv;
-  };
+  }
 }

 enum FlagsUpdate {
=======================================
--- /branches/bleeding_edge/src/arm64/cpu-arm64.cc Fri May 9 12:51:52 2014 UTC +++ /branches/bleeding_edge/src/arm64/cpu-arm64.cc Fri May 9 12:59:24 2014 UTC
@@ -32,7 +32,7 @@
     __asm__ __volatile__ ("mrs %[ctr], ctr_el0"  // NOLINT
                           : [ctr] "=r" (cache_type_register_));
 #endif
-  };
+  }

   uint32_t icache_line_size() const { return ExtractCacheLineSize(0); }
   uint32_t dcache_line_size() const { return ExtractCacheLineSize(16); }
=======================================
--- /branches/bleeding_edge/src/arm64/cpu-arm64.h Fri May 9 12:51:52 2014 UTC +++ /branches/bleeding_edge/src/arm64/cpu-arm64.h Fri May 9 12:59:24 2014 UTC
@@ -25,7 +25,7 @@
   static bool IsSupported(CpuFeature f) {
     ASSERT(initialized_);
     return Check(f, supported_);
-  };
+  }

   static bool IsSafeForSnapshot(Isolate* isolate, CpuFeature f) {
     return IsSupported(f);
=======================================
--- /branches/bleeding_edge/src/arm64/lithium-arm64.h Fri May 9 08:28:25 2014 UTC +++ /branches/bleeding_edge/src/arm64/lithium-arm64.h Fri May 9 12:59:24 2014 UTC
@@ -2452,7 +2452,7 @@
                       LOperand* temp) :
       LStoreKeyed<1>(elements, key, value) {
     temps_[0] = temp;
-  };
+  }

   LOperand* temp() { return temps_[0]; }

@@ -2466,7 +2466,7 @@
                    LOperand* temp) :
       LStoreKeyed<1>(elements, key, value) {
     temps_[0] = temp;
-  };
+  }

   LOperand* temp() { return temps_[0]; }

@@ -2480,7 +2480,7 @@
                          LOperand* temp) :
       LStoreKeyed<1>(elements, key, value) {
     temps_[0] = temp;
-  };
+  }

   LOperand* temp() { return temps_[0]; }

=======================================
--- /branches/bleeding_edge/src/assembler.h     Tue May  6 11:25:37 2014 UTC
+++ /branches/bleeding_edge/src/assembler.h     Fri May  9 12:59:24 2014 UTC
@@ -116,7 +116,7 @@
   }
   ~DontEmitDebugCodeScope() {
     assembler_->set_emit_debug_code(old_value_);
-  };
+  }
  private:
   AssemblerBase* assembler_;
   bool old_value_;
=======================================
--- /branches/bleeding_edge/src/counters.h      Wed May  7 07:15:24 2014 UTC
+++ /branches/bleeding_edge/src/counters.h      Fri May  9 12:59:24 2014 UTC
@@ -265,11 +265,12 @@
     } else {
       timer_->Start();
     }
+  }
 #else
       : timer_(timer) {
     timer_->Start();
-#endif
   }
+#endif
   ~HistogramTimerScope() {
 #ifdef DEBUG
     if (!skipped_timer_start_) {
@@ -279,6 +280,7 @@
     timer_->Stop();
 #endif
   }
+
  private:
   HistogramTimer* timer_;
 #ifdef DEBUG
=======================================
--- /branches/bleeding_edge/src/elements.cc     Tue Apr 29 13:18:27 2014 UTC
+++ /branches/bleeding_edge/src/elements.cc     Fri May  9 12:59:24 2014 UTC
@@ -112,7 +112,7 @@

 #define ELEMENTS_TRAITS(Class, KindParam, Store)               \
 template<> class ElementsKindTraits<KindParam> {               \
-  public:                                                      \
+ public:   /* NOLINT */                                        \
   static const ElementsKind Kind = KindParam;                  \
   typedef Store BackingStore;                                  \
 };
=======================================
--- /branches/bleeding_edge/src/full-codegen.h  Wed Apr 30 14:33:35 2014 UTC
+++ /branches/bleeding_edge/src/full-codegen.h  Fri May  9 12:59:24 2014 UTC
@@ -216,7 +216,7 @@
         ++(*context_length);
       }
       return previous_;
-    };
+    }
   };

   // The try block of a try/catch statement.
=======================================
--- /branches/bleeding_edge/src/hydrogen-instructions.h Fri May 9 12:06:48 2014 UTC +++ /branches/bleeding_edge/src/hydrogen-instructions.h Fri May 9 12:59:24 2014 UTC
@@ -6406,7 +6406,7 @@
   virtual int MaxIndexOffsetBits() = 0;
   virtual bool IsDehoisted() = 0;
   virtual void SetDehoisted(bool is_dehoisted) = 0;
-  virtual ~ArrayInstructionInterface() { };
+  virtual ~ArrayInstructionInterface() { }

   static Representation KeyedAccessIndexRequirement(Representation r) {
     return r.IsInteger32() || SmiValuesAre32Bits()
=======================================
--- /branches/bleeding_edge/src/ia32/assembler-ia32.h Mon May 5 09:52:03 2014 UTC +++ /branches/bleeding_edge/src/ia32/assembler-ia32.h Fri May 9 12:59:24 2014 UTC
@@ -331,7 +331,7 @@
       return greater_equal;
     default:
       return cc;
-  };
+  }
 }


=======================================
--- /branches/bleeding_edge/src/mips/assembler-mips.h Mon May 5 09:52:03 2014 UTC +++ /branches/bleeding_edge/src/mips/assembler-mips.h Fri May 9 12:59:24 2014 UTC
@@ -896,10 +896,10 @@
       assem_->EndBlockGrowBuffer();
     }

-    private:
-     Assembler* assem_;
+   private:
+    Assembler* assem_;

-     DISALLOW_IMPLICIT_CONSTRUCTORS(BlockGrowBufferScope);
+    DISALLOW_IMPLICIT_CONSTRUCTORS(BlockGrowBufferScope);
   };

   // Debugging.
=======================================
--- /branches/bleeding_edge/src/mips/constants-mips.cc Tue Apr 29 06:42:26 2014 UTC +++ /branches/bleeding_edge/src/mips/constants-mips.cc Fri May 9 12:59:24 2014 UTC
@@ -151,7 +151,7 @@
           return true;
         default:
           return false;
-      };
+      }
       break;
     case SPECIAL:
       switch (FunctionFieldRaw()) {
@@ -160,11 +160,11 @@
           return true;
         default:
           return false;
-      };
+      }
       break;
     default:
       return false;
-  };
+  }
 }


@@ -180,17 +180,17 @@
           return true;
       default:
         return false;
-      };
+      }
     case SPECIAL:
       switch (FunctionFieldRaw()) {
         case JALR:
           return true;
         default:
           return false;
-      };
+      }
     default:
       return false;
-  };
+  }
 }


@@ -209,7 +209,7 @@
         return true;
       default:
         return false;
-    };
+    }
   }
 }

@@ -255,7 +255,7 @@
           return kRegisterType;
         default:
           return kUnsupported;
-      };
+      }
       break;
     case SPECIAL2:
       switch (FunctionFieldRaw()) {
@@ -264,7 +264,7 @@
           return kRegisterType;
         default:
           return kUnsupported;
-      };
+      }
       break;
     case SPECIAL3:
       switch (FunctionFieldRaw()) {
@@ -273,7 +273,7 @@
           return kRegisterType;
         default:
           return kUnsupported;
-      };
+      }
       break;
     case COP1:    // Coprocessor instructions.
       switch (RsFieldRawNoAssert()) {
@@ -281,7 +281,7 @@
           return kImmediateType;
         default:
           return kRegisterType;
-      };
+      }
       break;
     case COP1X:
       return kRegisterType;
@@ -326,7 +326,7 @@
       return kJumpType;
     default:
       return kUnsupported;
-  };
+  }
   return kUnsupported;
 }

=======================================
--- /branches/bleeding_edge/src/mips/constants-mips.h Tue Apr 29 06:42:26 2014 UTC +++ /branches/bleeding_edge/src/mips/constants-mips.h Fri May 9 12:59:24 2014 UTC
@@ -524,7 +524,7 @@
       return greater_equal;
     default:
       return cc;
-  };
+  }
 }


=======================================
--- /branches/bleeding_edge/src/mips/disasm-mips.cc Tue Apr 29 06:42:26 2014 UTC +++ /branches/bleeding_edge/src/mips/disasm-mips.cc Fri May 9 12:59:24 2014 UTC
@@ -277,7 +277,7 @@
     }
     default:  // Not a break or trap instruction.
     break;
-  };
+  }
 }


@@ -407,7 +407,7 @@
       PrintCc(instr);
       return 2;
     }
-  };
+  }
   UNREACHABLE();
   return -1;
 }
@@ -603,7 +603,7 @@
           break;
         default:
           UNREACHABLE();
-      };
+      }
       break;
     case SPECIAL:
       switch (instr->FunctionFieldRaw()) {
@@ -796,7 +796,7 @@
           break;
         default:
           UNREACHABLE();
-      };
+      }
       break;  // Case COP1.
     case REGIMM:
       switch (instr->RtFieldRaw()) {
@@ -909,7 +909,7 @@
     default:
       UNREACHABLE();
       break;
-  };
+  }
 }


=======================================
--- /branches/bleeding_edge/src/mips/macro-assembler-mips.cc Tue May 6 19:24:11 2014 UTC +++ /branches/bleeding_edge/src/mips/macro-assembler-mips.cc Fri May 9 12:59:24 2014 UTC
@@ -1194,7 +1194,7 @@
         break;
       default:
         CHECK(0);
-    };
+    }
   }

   if (bd == PROTECT) {
=======================================
--- /branches/bleeding_edge/src/mips/macro-assembler-mips.h Tue May 6 19:24:11 2014 UTC +++ /branches/bleeding_edge/src/mips/macro-assembler-mips.h Fri May 9 12:59:24 2014 UTC
@@ -734,7 +734,7 @@
                       FPURegister cmp1,
                       FPURegister cmp2) {
     BranchF(target, nan, cc, cmp1, cmp2, bd);
-  };
+  }

// Truncates a double using a specific rounding mode, and writes the value
   // to the result register.
=======================================
--- /branches/bleeding_edge/src/mips/simulator-mips.cc Tue Apr 29 06:42:26 2014 UTC +++ /branches/bleeding_edge/src/mips/simulator-mips.cc Fri May 9 12:59:24 2014 UTC
@@ -840,9 +840,9 @@
char* cached_line = cache_page->CachedData(offset & ~CachePage::kLineMask);
   if (cache_hit) {
     // Check that the data in memory matches the contents of the I-cache.
-    CHECK(memcmp(reinterpret_cast<void*>(instr),
-                 cache_page->CachedData(offset),
-                 Instruction::kInstrSize) == 0);
+    CHECK_EQ(0, memcmp(reinterpret_cast<void*>(instr),
+                       cache_page->CachedData(offset),
+                       Instruction::kInstrSize));
   } else {
     // Cache miss.  Load memory into the cache.
     OS::MemCopy(cached_line, line, CachePage::kLineLength);
@@ -1762,7 +1762,7 @@
           break;
         default:
           UNIMPLEMENTED_MIPS();
-      };
+      }
       break;
     case COP1X:
       break;
@@ -1899,7 +1899,7 @@
           break;
         default:
           UNREACHABLE();
-      };
+      }
       break;
     case SPECIAL2:
       switch (instr->FunctionFieldRaw()) {
@@ -1915,7 +1915,7 @@
           break;
         default:
           UNREACHABLE();
-      };
+      }
       break;
     case SPECIAL3:
       switch (instr->FunctionFieldRaw()) {
@@ -1941,11 +1941,11 @@
         }
         default:
           UNREACHABLE();
-      };
+      }
       break;
     default:
       UNREACHABLE();
-  };
+  }
 }


@@ -2204,7 +2204,7 @@
               break;
             default:
               UNREACHABLE();
-          };
+          }
           break;
         case L:
           switch (instr->FunctionFieldRaw()) {
@@ -2226,7 +2226,7 @@
           break;
         default:
           UNREACHABLE();
-      };
+      }
       break;
     case COP1X:
       switch (instr->FunctionFieldRaw()) {
@@ -2239,7 +2239,7 @@
           break;
         default:
           UNREACHABLE();
-      };
+      }
       break;
     case SPECIAL:
       switch (instr->FunctionFieldRaw()) {
@@ -2320,7 +2320,7 @@
           break;
         default:  // For other special opcodes we do the default operation.
           set_register(rd_reg, alu_out);
-      };
+      }
       break;
     case SPECIAL2:
       switch (instr->FunctionFieldRaw()) {
@@ -2346,14 +2346,14 @@
           break;
         default:
           UNREACHABLE();
-      };
+      }
       break;
// Unimplemented opcodes raised an error in the configuration step before, // so we can use the default here to set the destination register in common
     // cases.
     default:
       set_register(rd_reg, alu_out);
-  };
+  }
 }


@@ -2414,7 +2414,7 @@
           break;
         default:
           UNREACHABLE();
-      };
+      }
       break;
     // ------------- REGIMM class.
     case REGIMM:
@@ -2433,7 +2433,7 @@
           break;
         default:
           UNREACHABLE();
-      };
+      }
       switch (instr->RtFieldRaw()) {
         case BLTZ:
         case BLTZAL:
@@ -2452,7 +2452,7 @@
           }
         default:
           break;
-        };
+        }
     break;  // case REGIMM.
     // ------------- Branch instructions.
// When comparing to zero, the encoding of rt field is always 0, so we don't
@@ -2585,7 +2585,7 @@
       break;
     default:
       UNREACHABLE();
-  };
+  }

   // ---------- Raise exceptions triggered.
   SignalExceptions();
@@ -2661,7 +2661,7 @@
       break;
     default:
       break;
-  };
+  }


   if (execute_branch_delay_instruction) {
=======================================
--- /branches/bleeding_edge/src/objects.h       Fri May  9 08:28:25 2014 UTC
+++ /branches/bleeding_edge/src/objects.h       Fri May  9 12:59:24 2014 UTC
@@ -5086,13 +5086,13 @@

#define FIXED_TYPED_ARRAY_TRAITS(Type, type, TYPE, elementType, size) \ class Type##ArrayTraits { \ - public: \ - typedef elementType ElementType; \ - static const InstanceType kInstanceType = FIXED_##TYPE##_ARRAY_TYPE; \ - static const char* Designator() { return #type " array"; } \ - static inline Handle<Object> ToHandle(Isolate* isolate, \ - elementType scalar); \ - static inline elementType defaultValue(); \ + public: /* NOLINT */ \ + typedef elementType ElementType; \ + static const InstanceType kInstanceType = FIXED_##TYPE##_ARRAY_TYPE; \ + static const char* Designator() { return #type " array"; } \ + static inline Handle<Object> ToHandle(Isolate* isolate, \ + elementType scalar); \ + static inline elementType defaultValue(); \ }; \ \
   typedef FixedTypedArray<Type##ArrayTraits> Fixed##Type##Array;
=======================================
--- /branches/bleeding_edge/src/preparse-data.h Mon May  5 14:55:13 2014 UTC
+++ /branches/bleeding_edge/src/preparse-data.h Fri May  9 12:59:24 2014 UTC
@@ -58,7 +58,7 @@
     literals_ = literals;
     properties_ = properties;
     strict_mode_ = strict_mode;
-  };
+  }

   // Logs an error message and marks the log as containing an error.
   // Further logging will be ignored, and ExtractData will return a vector
=======================================
--- /branches/bleeding_edge/src/regexp-macro-assembler-tracer.cc Tue Apr 29 06:42:26 2014 UTC +++ /branches/bleeding_edge/src/regexp-macro-assembler-tracer.cc Fri May 9 12:59:24 2014 UTC
@@ -192,7 +192,7 @@
       buffer_[0] = '\0';
     }
     return &buffer_[0];
-  };
+  }

  private:
   uc16 character_;
=======================================
--- /branches/bleeding_edge/src/x64/assembler-x64.h Mon May 5 09:52:03 2014 UTC +++ /branches/bleeding_edge/src/x64/assembler-x64.h Fri May 9 12:59:24 2014 UTC
@@ -347,7 +347,7 @@
       return greater_equal;
     default:
       return cc;
-  };
+  }
 }


=======================================
--- /branches/bleeding_edge/test/cctest/test-api.cc Fri May 9 08:40:18 2014 UTC +++ /branches/bleeding_edge/test/cctest/test-api.cc Fri May 9 12:59:24 2014 UTC
@@ -22148,152 +22148,152 @@
     info.GetReturnValue().Set(v8_str("returned"));
   }

-  public:
-    enum SignatureType {
-      kNoSignature,
-      kSignatureOnReceiver,
-      kSignatureOnPrototype
-    };
+ public:
+  enum SignatureType {
+    kNoSignature,
+    kSignatureOnReceiver,
+    kSignatureOnPrototype
+  };

-    void RunAll() {
-      SignatureType signature_types[] =
-        {kNoSignature, kSignatureOnReceiver, kSignatureOnPrototype};
-      for (unsigned i = 0; i < ARRAY_SIZE(signature_types); i++) {
-        SignatureType signature_type = signature_types[i];
-        for (int j = 0; j < 2; j++) {
-          bool global = j == 0;
-          int key = signature_type +
-              ARRAY_SIZE(signature_types) * (global ? 1 : 0);
-          Run(signature_type, global, key);
-        }
+  void RunAll() {
+    SignatureType signature_types[] =
+      {kNoSignature, kSignatureOnReceiver, kSignatureOnPrototype};
+    for (unsigned i = 0; i < ARRAY_SIZE(signature_types); i++) {
+      SignatureType signature_type = signature_types[i];
+      for (int j = 0; j < 2; j++) {
+        bool global = j == 0;
+        int key = signature_type +
+            ARRAY_SIZE(signature_types) * (global ? 1 : 0);
+        Run(signature_type, global, key);
       }
     }
+  }

-    void Run(SignatureType signature_type, bool global, int key) {
-      v8::Isolate* isolate = CcTest::isolate();
-      v8::HandleScope scope(isolate);
-      // Build a template for signature checks.
-      Local<v8::ObjectTemplate> signature_template;
-      Local<v8::Signature> signature;
-      {
-        Local<v8::FunctionTemplate> parent_template =
-          FunctionTemplate::New(isolate);
-        parent_template->SetHiddenPrototype(true);
-        Local<v8::FunctionTemplate> function_template
-            = FunctionTemplate::New(isolate);
-        function_template->Inherit(parent_template);
-        switch (signature_type) {
-          case kNoSignature:
-            break;
-          case kSignatureOnReceiver:
-            signature = v8::Signature::New(isolate, function_template);
-            break;
-          case kSignatureOnPrototype:
-            signature = v8::Signature::New(isolate, parent_template);
-            break;
-        }
-        signature_template = function_template->InstanceTemplate();
+  void Run(SignatureType signature_type, bool global, int key) {
+    v8::Isolate* isolate = CcTest::isolate();
+    v8::HandleScope scope(isolate);
+    // Build a template for signature checks.
+    Local<v8::ObjectTemplate> signature_template;
+    Local<v8::Signature> signature;
+    {
+      Local<v8::FunctionTemplate> parent_template =
+        FunctionTemplate::New(isolate);
+      parent_template->SetHiddenPrototype(true);
+      Local<v8::FunctionTemplate> function_template
+          = FunctionTemplate::New(isolate);
+      function_template->Inherit(parent_template);
+      switch (signature_type) {
+        case kNoSignature:
+          break;
+        case kSignatureOnReceiver:
+          signature = v8::Signature::New(isolate, function_template);
+          break;
+        case kSignatureOnPrototype:
+          signature = v8::Signature::New(isolate, parent_template);
+          break;
       }
-      // Global object must pass checks.
-      Local<v8::Context> context =
-          v8::Context::New(isolate, NULL, signature_template);
-      v8::Context::Scope context_scope(context);
-      // Install regular object that can pass signature checks.
-      Local<Object> function_receiver = signature_template->NewInstance();
- context->Global()->Set(v8_str("function_receiver"), function_receiver);
-      // Get the holder objects.
-      Local<Object> inner_global =
-          Local<Object>::Cast(context->Global()->GetPrototype());
-      // Install functions on hidden prototype object if there is one.
-      data = Object::New(isolate);
-      Local<FunctionTemplate> function_template = FunctionTemplate::New(
-          isolate, OptimizationCallback, data, signature);
-      Local<Function> function = function_template->GetFunction();
-      Local<Object> global_holder = inner_global;
-      Local<Object> function_holder = function_receiver;
-      if (signature_type == kSignatureOnPrototype) {
- function_holder = Local<Object>::Cast(function_holder->GetPrototype());
-        global_holder = Local<Object>::Cast(global_holder->GetPrototype());
-      }
-      global_holder->Set(v8_str("g_f"), function);
- global_holder->SetAccessorProperty(v8_str("g_acc"), function, function);
-      function_holder->Set(v8_str("f"), function);
- function_holder->SetAccessorProperty(v8_str("acc"), function, function);
-      // Initialize expected values.
-      callee = function;
-      count = 0;
-      if (global) {
-        receiver = context->Global();
-        holder = inner_global;
-      } else {
-        holder = function_receiver;
- // If not using a signature, add something else to the prototype chain
-        // to test the case that holder != receiver
-        if (signature_type == kNoSignature) {
-          receiver = Local<Object>::Cast(CompileRun(
-              "var receiver_subclass = {};\n"
-              "receiver_subclass.__proto__ = function_receiver;\n"
-              "receiver_subclass"));
-        } else {
-          receiver = Local<Object>::Cast(CompileRun(
-            "var receiver_subclass = function_receiver;\n"
+      signature_template = function_template->InstanceTemplate();
+    }
+    // Global object must pass checks.
+    Local<v8::Context> context =
+        v8::Context::New(isolate, NULL, signature_template);
+    v8::Context::Scope context_scope(context);
+    // Install regular object that can pass signature checks.
+    Local<Object> function_receiver = signature_template->NewInstance();
+    context->Global()->Set(v8_str("function_receiver"), function_receiver);
+    // Get the holder objects.
+    Local<Object> inner_global =
+        Local<Object>::Cast(context->Global()->GetPrototype());
+    // Install functions on hidden prototype object if there is one.
+    data = Object::New(isolate);
+    Local<FunctionTemplate> function_template = FunctionTemplate::New(
+        isolate, OptimizationCallback, data, signature);
+    Local<Function> function = function_template->GetFunction();
+    Local<Object> global_holder = inner_global;
+    Local<Object> function_holder = function_receiver;
+    if (signature_type == kSignatureOnPrototype) {
+ function_holder = Local<Object>::Cast(function_holder->GetPrototype());
+      global_holder = Local<Object>::Cast(global_holder->GetPrototype());
+    }
+    global_holder->Set(v8_str("g_f"), function);
+ global_holder->SetAccessorProperty(v8_str("g_acc"), function, function);
+    function_holder->Set(v8_str("f"), function);
+ function_holder->SetAccessorProperty(v8_str("acc"), function, function);
+    // Initialize expected values.
+    callee = function;
+    count = 0;
+    if (global) {
+      receiver = context->Global();
+      holder = inner_global;
+    } else {
+      holder = function_receiver;
+ // If not using a signature, add something else to the prototype chain
+      // to test the case that holder != receiver
+      if (signature_type == kNoSignature) {
+        receiver = Local<Object>::Cast(CompileRun(
+            "var receiver_subclass = {};\n"
+            "receiver_subclass.__proto__ = function_receiver;\n"
             "receiver_subclass"));
-        }
-      }
-      // With no signature, the holder is not set.
-      if (signature_type == kNoSignature) holder = receiver;
-      // build wrap_function
-      i::ScopedVector<char> wrap_function(200);
-      if (global) {
-        i::OS::SNPrintF(
-            wrap_function,
-            "function wrap_f_%d() { var f = g_f; return f(); }\n"
-            "function wrap_get_%d() { return this.g_acc; }\n"
-            "function wrap_set_%d() { return this.g_acc = 1; }\n",
-            key, key, key);
       } else {
-        i::OS::SNPrintF(
-            wrap_function,
-            "function wrap_f_%d() { return receiver_subclass.f(); }\n"
-            "function wrap_get_%d() { return receiver_subclass.acc; }\n"
- "function wrap_set_%d() { return receiver_subclass.acc = 1; }\n",
-            key, key, key);
+        receiver = Local<Object>::Cast(CompileRun(
+          "var receiver_subclass = function_receiver;\n"
+          "receiver_subclass"));
       }
-      // build source string
-      i::ScopedVector<char> source(1000);
+    }
+    // With no signature, the holder is not set.
+    if (signature_type == kNoSignature) holder = receiver;
+    // build wrap_function
+    i::ScopedVector<char> wrap_function(200);
+    if (global) {
+      i::OS::SNPrintF(
+          wrap_function,
+          "function wrap_f_%d() { var f = g_f; return f(); }\n"
+          "function wrap_get_%d() { return this.g_acc; }\n"
+          "function wrap_set_%d() { return this.g_acc = 1; }\n",
+          key, key, key);
+    } else {
       i::OS::SNPrintF(
-          source,
-          "%s\n"  // wrap functions
-          "function wrap_f() { return wrap_f_%d(); }\n"
-          "function wrap_get() { return wrap_get_%d(); }\n"
-          "function wrap_set() { return wrap_set_%d(); }\n"
-          "check = function(returned) {\n"
-          "  if (returned !== 'returned') { throw returned; }\n"
-          "}\n"
-          "\n"
-          "check(wrap_f());\n"
-          "check(wrap_f());\n"
-          "%%OptimizeFunctionOnNextCall(wrap_f_%d);\n"
-          "check(wrap_f());\n"
-          "\n"
-          "check(wrap_get());\n"
-          "check(wrap_get());\n"
-          "%%OptimizeFunctionOnNextCall(wrap_get_%d);\n"
-          "check(wrap_get());\n"
-          "\n"
-          "check = function(returned) {\n"
-          "  if (returned !== 1) { throw returned; }\n"
-          "}\n"
-          "check(wrap_set());\n"
-          "check(wrap_set());\n"
-          "%%OptimizeFunctionOnNextCall(wrap_set_%d);\n"
-          "check(wrap_set());\n",
-          wrap_function.start(), key, key, key, key, key, key);
-      v8::TryCatch try_catch;
-      CompileRun(source.start());
-      ASSERT(!try_catch.HasCaught());
-      CHECK_EQ(9, count);
+          wrap_function,
+          "function wrap_f_%d() { return receiver_subclass.f(); }\n"
+          "function wrap_get_%d() { return receiver_subclass.acc; }\n"
+          "function wrap_set_%d() { return receiver_subclass.acc = 1; }\n",
+          key, key, key);
     }
+    // build source string
+    i::ScopedVector<char> source(1000);
+    i::OS::SNPrintF(
+        source,
+        "%s\n"  // wrap functions
+        "function wrap_f() { return wrap_f_%d(); }\n"
+        "function wrap_get() { return wrap_get_%d(); }\n"
+        "function wrap_set() { return wrap_set_%d(); }\n"
+        "check = function(returned) {\n"
+        "  if (returned !== 'returned') { throw returned; }\n"
+        "}\n"
+        "\n"
+        "check(wrap_f());\n"
+        "check(wrap_f());\n"
+        "%%OptimizeFunctionOnNextCall(wrap_f_%d);\n"
+        "check(wrap_f());\n"
+        "\n"
+        "check(wrap_get());\n"
+        "check(wrap_get());\n"
+        "%%OptimizeFunctionOnNextCall(wrap_get_%d);\n"
+        "check(wrap_get());\n"
+        "\n"
+        "check = function(returned) {\n"
+        "  if (returned !== 1) { throw returned; }\n"
+        "}\n"
+        "check(wrap_set());\n"
+        "check(wrap_set());\n"
+        "%%OptimizeFunctionOnNextCall(wrap_set_%d);\n"
+        "check(wrap_set());\n",
+        wrap_function.start(), key, key, key, key, key, key);
+    v8::TryCatch try_catch;
+    CompileRun(source.start());
+    ASSERT(!try_catch.HasCaught());
+    CHECK_EQ(9, count);
+  }
 };


=======================================
--- /branches/bleeding_edge/test/cctest/test-semaphore.cc Mon Sep 2 12:36:08 2013 UTC +++ /branches/bleeding_edge/test/cctest/test-semaphore.cc Fri May 9 12:59:24 2014 UTC
@@ -37,7 +37,7 @@


 class WaitAndSignalThread V8_FINAL : public Thread {
-  public:
+ public:
   explicit WaitAndSignalThread(Semaphore* semaphore)
       : Thread("WaitAndSignalThread"), semaphore_(semaphore) {}
   virtual ~WaitAndSignalThread() {}
@@ -52,7 +52,7 @@
     }
   }

-  private:
+ private:
   Semaphore* semaphore_;
 };

@@ -115,7 +115,7 @@


 class ProducerThread V8_FINAL : public Thread {
-  public:
+ public:
   ProducerThread() : Thread("ProducerThread") {}
   virtual ~ProducerThread() {}

@@ -130,7 +130,7 @@


 class ConsumerThread V8_FINAL : public Thread {
-  public:
+ public:
   ConsumerThread() : Thread("ConsumerThread") {}
   virtual ~ConsumerThread() {}

=======================================
--- /branches/bleeding_edge/test/cctest/test-spaces.cc Fri May 9 12:51:52 2014 UTC +++ /branches/bleeding_edge/test/cctest/test-spaces.cc Fri May 9 12:59:24 2014 UTC
@@ -393,7 +393,7 @@
       if (allocation.IsRetry()) break;
     }
     CHECK(lo->Available() < available);
-  };
+  }

   CHECK(!lo->IsEmpty());

=======================================
--- /branches/bleeding_edge/tools/presubmit.py  Thu Jan  2 15:06:27 2014 UTC
+++ /branches/bleeding_edge/tools/presubmit.py  Fri May  9 12:59:24 2014 UTC
@@ -48,6 +48,8 @@
 # Disabled LINT rules and reason.
 # build/include_what_you_use: Started giving false positives for variables
# named "string" and "map" assuming that you needed to include STL headers.
+# runtime/references: Started giving a lot of positives after depot-tools
+#  update. To be fixed soon: v8:3326.

 ENABLED_LINT_RULES = """
 build/class
@@ -80,7 +82,6 @@
 runtime/nonconf
 runtime/printf
 runtime/printf_format
-runtime/references
 runtime/rtti
 runtime/sizeof
 runtime/string

--
--
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/d/optout.

Reply via email to