From 411b7d18f6ab4ce3b1e538712a4ebed5a3095069 Mon Sep 17 00:00:00 2001 From: "ager@chromium.org" Date: Thu, 26 Feb 2009 07:05:53 +0000 Subject: [PATCH] Fix lint issues found by tools/presubmit.py. TBR=mikhail.naganov Review URL: http://codereview.chromium.org/28178 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1371 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/log.h | 4 ++-- test/cctest/test-log-ia32.cc | 25 ++++++++++++++++--------- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/src/log.h b/src/log.h index 8f60173..aceb282 100644 --- a/src/log.h +++ b/src/log.h @@ -275,8 +275,8 @@ class Logger { // 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_; diff --git a/test/cctest/test-log-ia32.cc b/test/cctest/test-log-ia32.cc index 07ba07b..6446a30 100644 --- a/test/cctest/test-log-ia32.cc +++ b/test/cctest/test-log-ia32.cc @@ -51,7 +51,7 @@ static void CFuncDoTrace() { #ifdef __GNUC__ fp = reinterpret_cast(__builtin_frame_address(0)); #elif defined _MSC_VER - __asm mov [fp], ebp + __asm mov [fp], ebp // NOLINT #endif DoTrace(fp); } @@ -75,7 +75,7 @@ static void CheckRetAddrIsInFunction(unsigned int ret_addr, #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 void SetGlobalProperty(const char* name, Local value) { } -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(memchr(from, *original, to - from)); CHECK(from != NULL); if (memcmp(original, from, patch_len) == 0) { memcpy(from, patch, patch_len); @@ -194,8 +198,10 @@ TEST(PureJSStackTrace) { 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 @@ TEST(PureJSStackTrace) { Handle js_trace(JSFunction::cast(*(v8::Utils::OpenHandle( *GetGlobalProperty("JSTrace"))))); v8::internal::Code* js_trace_code = js_trace->code(); - CheckRetAddrIsInFunction(reinterpret_cast(sample.stack[0]), - reinterpret_cast(js_trace_code->instruction_start()), - js_trace_code->instruction_size()); + CheckRetAddrIsInFunction( + reinterpret_cast(sample.stack[0]), + reinterpret_cast(js_trace_code->instruction_start()), + js_trace_code->instruction_size()); CHECK_EQ(0, sample.stack[1]); } -- 2.7.4