From 47e03a0000905f7fb17cdf7c4d05520b0a92a44b Mon Sep 17 00:00:00 2001 From: "whesse@chromium.org" Date: Wed, 20 Jul 2011 08:09:58 +0000 Subject: [PATCH] fix -Wunused-but-set-variable for gcc-4.6 on x64 * src/third_party/valgrind/valgrind.h: Update from upstream valgrind r11899, so as to get around some unused value warnings. Also adds support for darwin. This version of valgrind.h differs from the original in that all instances of "unsigned long long int" have been replaced with "uint64_t", as the former is not allowed in ISO C++ 89. See https://bugs.kde.org/show_bug.cgi?id=211926 for the upstream bug report. * src/x64/cpu-x64.cc: * src/builtins.cc: * src/conversions-inl.h: * src/debug.cc: * src/frames.cc: * src/full-codegen.cc: * src/jsregexp.cc: * src/objects.cc: * src/parser.cc: * src/platform-linux.cc: * src/x64/code-stubs-x64.cc: * src/x64/deoptimizer-x64.cc: * src/x64/full-codegen-x64.cc: * src/x64/lithium-codegen-x64.cc: * src/x64/regexp-macro-assembler-x64.cc: * src/x64/stub-cache-x64.cc: Remove a number of assigned but unreferenced variables. * SConstruct (CCTEST_EXTRA_FLAGS): Punt on -Wunused-but-set-variable for the test suite. BUG=1291 TEST=A build and tools/test.py passes. Review URL: http://codereview.chromium.org/7400023 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8688 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- SConstruct | 3 ++- src/builtins.cc | 4 ++-- src/conversions-inl.h | 7 ++----- src/debug.cc | 14 ++++++-------- src/frames.cc | 1 - src/full-codegen.cc | 1 - src/jsregexp.cc | 8 +------- src/objects.cc | 3 +-- src/parser.cc | 2 -- src/platform-linux.cc | 1 + src/x64/code-stubs-x64.cc | 1 + src/x64/deoptimizer-x64.cc | 8 ++++++++ src/x64/full-codegen-x64.cc | 2 -- src/x64/lithium-codegen-x64.cc | 1 - src/x64/regexp-macro-assembler-x64.cc | 2 -- src/x64/stub-cache-x64.cc | 7 ++----- 16 files changed, 26 insertions(+), 39 deletions(-) diff --git a/SConstruct b/SConstruct index 03a615c9a4..4902fecff8 100644 --- a/SConstruct +++ b/SConstruct @@ -398,7 +398,8 @@ CCTEST_EXTRA_FLAGS = { 'gcc': { 'all': { 'LIBPATH': [abspath('.')], - 'CCFLAGS': ['$DIALECTFLAGS', '$WARNINGFLAGS'], + 'CCFLAGS': ['$DIALECTFLAGS', '$WARNINGFLAGS', + '-Wno-unused-but-set-variable'], 'CXXFLAGS': ['-fno-rtti', '-fno-exceptions'], 'LINKFLAGS': ['$CCFLAGS'], }, diff --git a/src/builtins.cc b/src/builtins.cc index 6a44d8cae5..d403a951cf 100644 --- a/src/builtins.cc +++ b/src/builtins.cc @@ -1202,10 +1202,10 @@ MUST_USE_RESULT static MaybeObject* HandleApiCallAsFunctionOrConstructor( ASSERT(!CalledAsConstructor(isolate)); Heap* heap = isolate->heap(); - Handle receiver = args.at(0); + Handle receiver = args.receiver(); // Get the object called. - JSObject* obj = JSObject::cast(*args.receiver()); + JSObject* obj = JSObject::cast(*receiver); // Get the invocation callback from the function descriptor that was // used to create the called object. diff --git a/src/conversions-inl.h b/src/conversions-inl.h index f1f526ffc0..b828638568 100644 --- a/src/conversions-inl.h +++ b/src/conversions-inl.h @@ -454,7 +454,6 @@ static double InternalStringToDouble(UnicodeCache* unicode_cache, int significant_digits = 0; int insignificant_digits = 0; bool nonzero_digit_dropped = false; - bool fractional_part = false; bool negative = false; @@ -557,10 +556,8 @@ static double InternalStringToDouble(UnicodeCache* unicode_cache, } } - // We don't emit a '.', but adjust the exponent instead. - fractional_part = true; - - // There is a fractional part. + // There is a fractional part. We don't emit a '.', but adjust the exponent + // instead. while (*current >= '0' && *current <= '9') { if (significant_digits < kMaxSignificantDigits) { ASSERT(buffer_pos < kBufferSize); diff --git a/src/debug.cc b/src/debug.cc index c48e514ab8..aecbb463b5 100644 --- a/src/debug.cc +++ b/src/debug.cc @@ -772,9 +772,9 @@ bool Debug::CompileDebuggerScript(int index) { bool caught_exception = false; Handle function = factory->NewFunctionFromSharedFunctionInfo(function_info, context); - Handle result = - Execution::TryCall(function, Handle(context->global()), - 0, NULL, &caught_exception); + + Execution::TryCall(function, Handle(context->global()), + 0, NULL, &caught_exception); // Check for caught exceptions. if (caught_exception) { @@ -1886,8 +1886,7 @@ void Debug::ClearMirrorCache() { *function_name)); ASSERT(fun->IsJSFunction()); bool caught_exception; - Handle js_object = Execution::TryCall( - Handle::cast(fun), + Execution::TryCall(Handle::cast(fun), Handle(Debug::debug_context()->global()), 0, NULL, &caught_exception); } @@ -2252,8 +2251,7 @@ void Debugger::OnAfterCompile(Handle