Commit 80d1b898 authored by keuchel@chromium.org's avatar keuchel@chromium.org

Fix gcc-4.6 warnings.

BUG=v8:1806

Review URL: http://codereview.chromium.org/8386072

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9867 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 224bbad4
......@@ -11218,18 +11218,14 @@ class ScopeIterator {
// Global code
CompilationInfo info(script);
info.MarkAsGlobal();
bool result = ParserApi::Parse(&info);
ASSERT(result);
result = Scope::Analyze(&info);
ASSERT(result);
CHECK(ParserApi::Parse(&info));
CHECK(Scope::Analyze(&info));
scope = info.function()->scope();
} else {
// Function code
CompilationInfo info(shared_info);
bool result = ParserApi::Parse(&info);
ASSERT(result);
result = Scope::Analyze(&info);
ASSERT(result);
CHECK(ParserApi::Parse(&info));
CHECK(Scope::Analyze(&info));
scope = info.function()->scope();
}
......
This diff is collapsed.
......@@ -270,8 +270,8 @@ TEST(UncaughtThrow) {
CHECK(!fun.is_null());
bool has_pending_exception;
Handle<JSObject> global(Isolate::Current()->context()->global());
Handle<Object> result =
Execution::Call(fun, global, 0, NULL, &has_pending_exception);
Handle<Object> result(
Execution::Call(fun, global, 0, NULL, &has_pending_exception));
CHECK(has_pending_exception);
CHECK_EQ(42.0, Isolate::Current()->pending_exception()->
ToObjectChecked()->Number());
......
......@@ -856,7 +856,7 @@ static void DebugEventRemoveBreakPoint(v8::DebugEvent event,
if (event == v8::Break) {
break_point_hit_count++;
v8::Handle<v8::Function> fun = v8::Handle<v8::Function>::Cast(data);
v8::Handle<v8::Function> fun(v8::Handle<v8::Function>::Cast(data));
ClearBreakPoint(debug_event_remove_break_point);
}
}
......@@ -1447,8 +1447,8 @@ TEST(BreakPointSurviveGC) {
// Test IC store break point with garbage collection.
{
v8::Local<v8::Function> bar =
CompileFunction(&env, "function foo(){}", "foo");
v8::Local<v8::Function> bar(
CompileFunction(&env, "function foo(){}", "foo"));
foo = CompileFunction(&env, "function foo(){bar=0;}", "foo");
SetBreakPoint(foo, 0);
}
......@@ -1456,8 +1456,8 @@ TEST(BreakPointSurviveGC) {
// Test IC load break point with garbage collection.
{
v8::Local<v8::Function> bar =
CompileFunction(&env, "function foo(){}", "foo");
v8::Local<v8::Function> bar(
CompileFunction(&env, "function foo(){}", "foo"));
foo = CompileFunction(&env, "bar=1;function foo(){var x=bar;}", "foo");
SetBreakPoint(foo, 0);
}
......@@ -1465,8 +1465,8 @@ TEST(BreakPointSurviveGC) {
// Test IC call break point with garbage collection.
{
v8::Local<v8::Function> bar =
CompileFunction(&env, "function foo(){}", "foo");
v8::Local<v8::Function> bar(
CompileFunction(&env, "function foo(){}", "foo"));
foo = CompileFunction(&env,
"function bar(){};function foo(){bar();}",
"foo");
......@@ -1476,8 +1476,8 @@ TEST(BreakPointSurviveGC) {
// Test return break point with garbage collection.
{
v8::Local<v8::Function> bar =
CompileFunction(&env, "function foo(){}", "foo");
v8::Local<v8::Function> bar(
CompileFunction(&env, "function foo(){}", "foo"));
foo = CompileFunction(&env, "function foo(){}", "foo");
SetBreakPoint(foo, 0);
}
......@@ -1485,8 +1485,8 @@ TEST(BreakPointSurviveGC) {
// Test non IC break point with garbage collection.
{
v8::Local<v8::Function> bar =
CompileFunction(&env, "function foo(){}", "foo");
v8::Local<v8::Function> bar(
CompileFunction(&env, "function foo(){}", "foo"));
foo = CompileFunction(&env, "function foo(){var bar=0;}", "foo");
SetBreakPoint(foo, 0);
}
......@@ -3751,8 +3751,8 @@ TEST(BreakOnException) {
v8::internal::Isolate::Current()->TraceException(false);
// Create functions for testing break on exception.
v8::Local<v8::Function> throws =
CompileFunction(&env, "function throws(){throw 1;}", "throws");
v8::Local<v8::Function> throws(
CompileFunction(&env, "function throws(){throw 1;}", "throws"));
v8::Local<v8::Function> caught =
CompileFunction(&env,
"function caught(){try {throws();} catch(e) {};}",
......@@ -5547,10 +5547,10 @@ TEST(DebuggerUnload) {
v8::HandleScope scope;
// Get the test functions again.
v8::Local<v8::Function> foo =
v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("foo")));
v8::Local<v8::Function> bar =
v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("foo")));
v8::Local<v8::Function> foo(v8::Local<v8::Function>::Cast(
env->Global()->Get(v8::String::New("foo"))));
v8::Local<v8::Function> bar(v8::Local<v8::Function>::Cast(
env->Global()->Get(v8::String::New("foo"))));
foo->Call(env->Global(), 0, NULL);
CHECK_EQ(0, break_point_hit_count);
......@@ -6027,7 +6027,7 @@ TEST(DebugGetLoadedScripts) {
EmptyExternalStringResource source_ext_str;
v8::Local<v8::String> source = v8::String::NewExternal(&source_ext_str);
v8::Handle<v8::Script> evil_script = v8::Script::Compile(source);
v8::Handle<v8::Script> evil_script(v8::Script::Compile(source));
Handle<i::ExternalTwoByteString> i_source(
i::ExternalTwoByteString::cast(*v8::Utils::OpenHandle(*source)));
// This situation can happen if source was an external string disposed
......@@ -6675,7 +6675,7 @@ static void BreakMessageHandler(const v8::Debug::Message& message) {
break_point_hit_count++;
v8::HandleScope scope;
v8::Handle<v8::String> json = message.GetJSON();
v8::Handle<v8::String> json(message.GetJSON());
SendContinueCommand();
} else if (message.IsEvent() && message.GetEvent() == v8::AfterCompile) {
......@@ -6686,7 +6686,7 @@ static void BreakMessageHandler(const v8::Debug::Message& message) {
isolate->stack_guard()->DebugBreak();
// Force serialization to trigger some internal JS execution.
v8::Handle<v8::String> json = message.GetJSON();
v8::Handle<v8::String> json(message.GetJSON());
// Restore previous state.
if (is_debug_break) {
......
......@@ -237,7 +237,7 @@ TEST(DeoptimizeRecursive) {
v8::Local<v8::Function> fun =
v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("f")));
Handle<v8::internal::JSFunction> f = v8::Utils::OpenHandle(*fun);
Handle<v8::internal::JSFunction> f(v8::Utils::OpenHandle(*fun));
}
......
......@@ -667,23 +667,23 @@ TEST(JSArray) {
Handle<JSObject> object = FACTORY->NewJSObject(function);
Handle<JSArray> array = Handle<JSArray>::cast(object);
// We just initialized the VM, no heap allocation failure yet.
Object* ok = array->Initialize(0)->ToObjectChecked();
array->Initialize(0)->ToObjectChecked();
// Set array length to 0.
ok = array->SetElementsLength(Smi::FromInt(0))->ToObjectChecked();
array->SetElementsLength(Smi::FromInt(0))->ToObjectChecked();
CHECK_EQ(Smi::FromInt(0), array->length());
// Must be in fast mode.
CHECK(array->HasFastTypeElements());
// array[length] = name.
ok = array->SetElement(0, *name, kNonStrictMode, true)->ToObjectChecked();
array->SetElement(0, *name, kNonStrictMode, true)->ToObjectChecked();
CHECK_EQ(Smi::FromInt(1), array->length());
CHECK_EQ(array->GetElement(0), *name);
// Set array length with larger than smi value.
Handle<Object> length =
FACTORY->NewNumberFromUint(static_cast<uint32_t>(Smi::kMaxValue) + 1);
ok = array->SetElementsLength(*length)->ToObjectChecked();
array->SetElementsLength(*length)->ToObjectChecked();
uint32_t int_length = 0;
CHECK(length->ToArrayIndex(&int_length));
......@@ -691,8 +691,7 @@ TEST(JSArray) {
CHECK(array->HasDictionaryElements()); // Must be in slow mode.
// array[length] = name.
ok = array->SetElement(
int_length, *name, kNonStrictMode, true)->ToObjectChecked();
array->SetElement(int_length, *name, kNonStrictMode, true)->ToObjectChecked();
uint32_t new_int_length = 0;
CHECK(array->length()->ToArrayIndex(&new_int_length));
CHECK_EQ(static_cast<double>(int_length), new_int_length - 1);
......@@ -719,10 +718,8 @@ TEST(JSObjectCopy) {
obj->SetProperty(
*second, Smi::FromInt(2), NONE, kNonStrictMode)->ToObjectChecked();
Object* ok =
obj->SetElement(0, *first, kNonStrictMode, true)->ToObjectChecked();
ok = obj->SetElement(1, *second, kNonStrictMode, true)->ToObjectChecked();
obj->SetElement(0, *first, kNonStrictMode, true)->ToObjectChecked();
obj->SetElement(1, *second, kNonStrictMode, true)->ToObjectChecked();
// Make the clone.
Handle<JSObject> clone = Copy(obj);
......@@ -740,8 +737,8 @@ TEST(JSObjectCopy) {
clone->SetProperty(
*second, Smi::FromInt(1), NONE, kNonStrictMode)->ToObjectChecked();
ok = clone->SetElement(0, *second, kNonStrictMode, true)->ToObjectChecked();
ok = clone->SetElement(1, *first, kNonStrictMode, true)->ToObjectChecked();
clone->SetElement(0, *second, kNonStrictMode, true)->ToObjectChecked();
clone->SetElement(1, *first, kNonStrictMode, true)->ToObjectChecked();
CHECK_EQ(obj->GetElement(1), clone->GetElement(0));
CHECK_EQ(obj->GetElement(0), clone->GetElement(1));
......
......@@ -229,7 +229,7 @@ TEST(Preparsing) {
CHECK_EQ(11, error_location.end_pos);
// Should not crash.
const char* message = pre_impl->BuildMessage();
i::Vector<const char*> args = pre_impl->BuildArgs();
i::Vector<const char*> args(pre_impl->BuildArgs());
CHECK_GT(strlen(message), 0);
}
......@@ -844,12 +844,11 @@ TEST(ScopePositions) {
int kSuffixLen = i::StrLength(source_data[i].outer_suffix);
int kProgramSize = kPrefixLen + kInnerLen + kSuffixLen;
i::Vector<char> program = i::Vector<char>::New(kProgramSize + 1);
int length;
length = i::OS::SNPrintF(program, "%s%s%s",
source_data[i].outer_prefix,
source_data[i].inner_source,
source_data[i].outer_suffix);
ASSERT(length == kProgramSize);
int length = i::OS::SNPrintF(program, "%s%s%s",
source_data[i].outer_prefix,
source_data[i].inner_source,
source_data[i].outer_suffix);
CHECK(length == kProgramSize);
// Parse program source.
i::Handle<i::String> source(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment