Author: [email protected]
Date: Wed Feb 25 23:05:53 2009
New Revision: 1371

Modified:
    branches/bleeding_edge/src/log.h
    branches/bleeding_edge/test/cctest/test-log-ia32.cc

Log:
Fix lint issues found by tools/presubmit.py.

TBR=mikhail.naganov
Review URL: http://codereview.chromium.org/28178

Modified: branches/bleeding_edge/src/log.h
==============================================================================
--- branches/bleeding_edge/src/log.h    (original)
+++ branches/bleeding_edge/src/log.h    Wed Feb 25 23:05:53 2009
@@ -275,8 +275,8 @@
  // Class that extracts stack trace, used for profiling
  class StackTracer BASE_EMBEDDED {
   public:
-  StackTracer(unsigned int low_stack_bound):  
low_stack_bound_(low_stack_bound) {
-  }
+  explicit StackTracer(unsigned int low_stack_bound)
+      : low_stack_bound_(low_stack_bound) { }
    void Trace(TickSample* sample);
   private:
    unsigned int low_stack_bound_;

Modified: branches/bleeding_edge/test/cctest/test-log-ia32.cc
==============================================================================
--- branches/bleeding_edge/test/cctest/test-log-ia32.cc (original)
+++ branches/bleeding_edge/test/cctest/test-log-ia32.cc Wed Feb 25 23:05:53  
2009
@@ -51,7 +51,7 @@
  #ifdef __GNUC__
    fp = reinterpret_cast<unsigned int>(__builtin_frame_address(0));
  #elif defined _MSC_VER
-  __asm mov [fp], ebp
+  __asm mov [fp], ebp  // NOLINT
  #endif
    DoTrace(fp);
  }
@@ -75,7 +75,7 @@


  #ifdef DEBUG
-static const int kMaxCFuncLen = 0x40; // seems enough for a small C  
function
+static const int kMaxCFuncLen = 0x40;  // seems enough for a small C  
function

  static void CheckRetAddrIsInCFunction(unsigned int ret_addr,
                                        unsigned int func_start_addr) {
@@ -166,10 +166,14 @@
  }


-static bool Patch(byte* from, size_t num, byte* original, byte* patch,  
size_t patch_len) {
+static bool Patch(byte* from,
+                  size_t num,
+                  byte* original,
+                  byte* patch,
+                  size_t patch_len) {
    byte* to = from + num;
    do {
-    from = (byte*)memchr(from, *original, to - from);
+    from = static_cast<byte*>(memchr(from, *original, to - from));
      CHECK(from != NULL);
      if (memcmp(original, from, patch_len) == 0) {
        memcpy(from, patch, patch_len);
@@ -194,8 +198,10 @@
    v8::internal::Code* call_trace_code = call_trace->code();
    CHECK(call_trace_code->IsCode());

-  byte original[] = { 0x68, 0xcc, 0xcc, 0x00, 0x00 }; // push 0xcccc (=  
0x6666 << 1)
-  byte patch[] = { 0x89, 0xe8, 0xd1, 0xe8, 0x50 }; // mov eax,ebp; shr  
eax; push eax;
+  // push 0xcccc (= 0x6666 << 1)
+  byte original[] = { 0x68, 0xcc, 0xcc, 0x00, 0x00 };
+  // mov eax,ebp; shr eax; push eax;
+  byte patch[] = { 0x89, 0xe8, 0xd1, 0xe8, 0x50 };
    // Patch generated code to replace pushing of a constant with
    // pushing of ebp contents in a Smi
    CHECK(Patch(call_trace_code->instruction_start(),
@@ -212,8 +218,9 @@
    Handle<JSFunction> js_trace(JSFunction::cast(*(v8::Utils::OpenHandle(
        *GetGlobalProperty("JSTrace")))));
    v8::internal::Code* js_trace_code = js_trace->code();
-  CheckRetAddrIsInFunction(reinterpret_cast<unsigned int>(sample.stack[0]),
-                           reinterpret_cast<unsigned  
int>(js_trace_code->instruction_start()),
-                           js_trace_code->instruction_size());
+  CheckRetAddrIsInFunction(
+      reinterpret_cast<unsigned int>(sample.stack[0]),
+      reinterpret_cast<unsigned int>(js_trace_code->instruction_start()),
+      js_trace_code->instruction_size());
    CHECK_EQ(0, sample.stack[1]);
  }

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

Reply via email to