diff options
author | Peter Varga <pvarga@inf.u-szeged.hu> | 2012-02-24 13:51:58 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-03-01 12:03:31 +0100 |
commit | 6ea7510e6eb4d425c0b639cb3f95556324342f89 (patch) | |
tree | 057e88aa2ee48a2d96e19faf658ba714646df32f /src/3rdparty/v8/test | |
parent | 19f67820a0ca91f98d3a4a8f1cde53f0f5ccfdb5 (diff) | |
download | qtjsbackend-6ea7510e6eb4d425c0b639cb3f95556324342f89.tar.gz |
Updated V8 from git://github.com/v8/v8.git to 06e55bc22bcb8ddb0a602e54e11971576f2d9d8a
* Implement VirtualMemory on FreeBSD to fix build (issue 1807).
* Fix error handling in Date.prototype.toISOString (issue 1792).
* Crankshaft for MIPS
* Bug fixes (mostly for MIPS)
* Use placement-new for zone-allocation in the Lithium classes.
Change-Id: I70ceacc4f7010cec58f73eb1826cbc06dd31149e
Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com>
Diffstat (limited to 'src/3rdparty/v8/test')
-rw-r--r-- | src/3rdparty/v8/test/cctest/test-api.cc | 134 | ||||
-rw-r--r-- | src/3rdparty/v8/test/cctest/test-compiler.cc | 4 | ||||
-rw-r--r-- | src/3rdparty/v8/test/cctest/test-debug.cc | 99 | ||||
-rw-r--r-- | src/3rdparty/v8/test/cctest/test-deoptimization.cc | 2 | ||||
-rw-r--r-- | src/3rdparty/v8/test/cctest/test-heap.cc | 21 | ||||
-rwxr-xr-x | src/3rdparty/v8/test/cctest/test-parsing.cc | 31 | ||||
-rw-r--r-- | src/3rdparty/v8/test/mjsunit/date.js | 10 | ||||
-rw-r--r-- | src/3rdparty/v8/test/mjsunit/debug-setbreakpoint.js | 12 | ||||
-rw-r--r-- | src/3rdparty/v8/test/mjsunit/elements-kind-depends.js (renamed from src/3rdparty/v8/test/mjsunit/regress/regress-221.js) | 50 | ||||
-rw-r--r-- | src/3rdparty/v8/test/mjsunit/eval.js | 49 | ||||
-rw-r--r-- | src/3rdparty/v8/test/mjsunit/mjsunit.js | 2 | ||||
-rw-r--r-- | src/3rdparty/v8/test/mjsunit/mjsunit.status | 1 | ||||
-rw-r--r-- | src/3rdparty/v8/test/mjsunit/strict-mode-implicit-receiver.js | 7 | ||||
-rw-r--r-- | src/3rdparty/v8/test/mjsunit/unbox-double-arrays.js | 55 | ||||
-rw-r--r-- | src/3rdparty/v8/test/test262/test262.status | 111 |
15 files changed, 260 insertions, 328 deletions
diff --git a/src/3rdparty/v8/test/cctest/test-api.cc b/src/3rdparty/v8/test/cctest/test-api.cc index 5081a64..b394e95 100644 --- a/src/3rdparty/v8/test/cctest/test-api.cc +++ b/src/3rdparty/v8/test/cctest/test-api.cc @@ -1189,9 +1189,9 @@ THREADED_TEST(GlobalPrototype) { templ->Set("x", v8_num(200)); templ->SetAccessor(v8_str("m"), GetM); LocalContext env(0, templ); - v8::Handle<v8::Object> obj = env->Global(); - v8::Handle<Script> script = v8_compile("dummy()"); - v8::Handle<Value> result = script->Run(); + v8::Handle<v8::Object> obj(env->Global()); + v8::Handle<Script> script(v8_compile("dummy()")); + v8::Handle<Value> result(script->Run()); CHECK_EQ(13.4, result->NumberValue()); CHECK_EQ(200, v8_compile("x")->Run()->Int32Value()); CHECK_EQ(876, v8_compile("m")->Run()->Int32Value()); @@ -1765,7 +1765,7 @@ THREADED_TEST(DeepCrossLanguageRecursion) { env->Global()->Set(v8_str("depth"), v8::Integer::New(0)); call_recursively_script = v8_compile("callScriptRecursively()"); - v8::Handle<Value> result = call_recursively_script->Run(); + v8::Handle<Value> result(call_recursively_script->Run()); call_recursively_script = v8::Handle<Script>(); env->Global()->Set(v8_str("depth"), v8::Integer::New(0)); @@ -4384,7 +4384,7 @@ THREADED_TEST(ExtensibleOnUndetectable) { source = v8_str("undetectable.y = 2000;"); script = Script::Compile(source); - Local<Value> result = script->Run(); + Local<Value> result(script->Run()); ExpectBoolean("undetectable.y == undefined", true); } @@ -4736,7 +4736,7 @@ THREADED_TEST(NativeFunctionDeclarationError) { "native\nfunction foo();")); const char* extension_names[] = { name }; v8::ExtensionConfiguration extensions(1, extension_names); - v8::Handle<Context> context = Context::New(&extensions); + v8::Handle<Context> context(Context::New(&extensions)); ASSERT(context.IsEmpty()); } @@ -4750,7 +4750,7 @@ THREADED_TEST(NativeFunctionDeclarationErrorEscape) { "nativ\\u0065 function foo();")); const char* extension_names[] = { name }; v8::ExtensionConfiguration extensions(1, extension_names); - v8::Handle<Context> context = Context::New(&extensions); + v8::Handle<Context> context(Context::New(&extensions)); ASSERT(context.IsEmpty()); } @@ -4917,7 +4917,7 @@ TEST(RegexpOutOfMemory) { Local<Script> script = Script::Compile(String::New(js_code_causing_huge_string_flattening)); last_location = NULL; - Local<Value> result = script->Run(); + Local<Value> result(script->Run()); CHECK(false); // Should not return. } @@ -5695,7 +5695,7 @@ THREADED_TEST(ErrorConstruction) { v8::Handle<String> message = v8_str("message"); v8::Handle<Value> range_error = v8::Exception::RangeError(foo); CHECK(range_error->IsObject()); - v8::Handle<v8::Object> range_obj = range_error.As<v8::Object>(); + v8::Handle<v8::Object> range_obj(range_error.As<v8::Object>()); CHECK(range_error.As<v8::Object>()->Get(message)->Equals(foo)); v8::Handle<Value> reference_error = v8::Exception::ReferenceError(foo); CHECK(reference_error->IsObject()); @@ -7265,7 +7265,7 @@ THREADED_TEST(CallKnownGlobalReceiver) { // Create new environment reusing the global object. LocalContext env(NULL, instance_template, global_object); env->Global()->Set(v8_str("foo"), foo); - Local<Value> value = Script::Compile(v8_str("foo()"))->Run(); + Local<Value> value(Script::Compile(v8_str("foo()"))->Run()); } } @@ -7536,7 +7536,7 @@ THREADED_TEST(Constructor) { Local<Function> cons = templ->GetFunction(); context->Global()->Set(v8_str("Fun"), cons); Local<v8::Object> inst = cons->NewInstance(); - i::Handle<i::JSObject> obj = v8::Utils::OpenHandle(*inst); + i::Handle<i::JSObject> obj(v8::Utils::OpenHandle(*inst)); Local<Value> value = CompileRun("(new Fun()).constructor === Fun"); CHECK(value->BooleanValue()); } @@ -7787,9 +7787,11 @@ THREADED_TEST(EvalAliasedDynamic) { " var bar = 2;" " with (x) { return eval('bar'); }" "}" - "f(this)")); + "result4 = f(this)")); script->Run(); - CHECK(try_catch.HasCaught()); + CHECK(!try_catch.HasCaught()); + CHECK_EQ(2, current->Global()->Get(v8_str("result4"))->Int32Value()); + try_catch.Reset(); } @@ -8005,7 +8007,7 @@ THREADED_TEST(CallAsFunction) { } { Local<v8::FunctionTemplate> t = v8::FunctionTemplate::New(); - Local<ObjectTemplate> instance_template = t->InstanceTemplate(); + Local<ObjectTemplate> instance_template(t->InstanceTemplate()); Local<v8::Object> instance = t->GetFunction()->NewInstance(); context->Global()->Set(v8_str("obj2"), instance); v8::TryCatch try_catch; @@ -8110,7 +8112,7 @@ static int Recurse(int depth, int iterations) { v8::HandleScope scope; if (depth == 0) return CountHandles(); for (int i = 0; i < iterations; i++) { - Local<v8::Number> n = v8::Integer::New(42); + Local<v8::Number> n(v8::Integer::New(42)); } return Recurse(depth - 1, iterations); } @@ -8124,7 +8126,7 @@ THREADED_TEST(HandleIteration) { v8::HandleScope scope1; CHECK_EQ(0, CountHandles()); for (int i = 0; i < kIterations; i++) { - Local<v8::Number> n = v8::Integer::New(42); + Local<v8::Number> n(v8::Integer::New(42)); CHECK_EQ(i + 1, CountHandles()); } @@ -8132,7 +8134,7 @@ THREADED_TEST(HandleIteration) { { v8::HandleScope scope2; for (int j = 0; j < kIterations; j++) { - Local<v8::Number> n = v8::Integer::New(42); + Local<v8::Number> n(v8::Integer::New(42)); CHECK_EQ(j + 1 + kIterations, CountHandles()); } } @@ -8635,10 +8637,10 @@ THREADED_TEST(InterceptorStoreIC) { 0, 0, 0, v8_str("data")); LocalContext context; context->Global()->Set(v8_str("o"), templ->NewInstance()); - v8::Handle<Value> value = CompileRun( + v8::Handle<Value> value(CompileRun( "for (var i = 0; i < 1000; i++) {" " o.x = 42;" - "}"); + "}")); } @@ -9064,11 +9066,11 @@ THREADED_TEST(InterceptorCallICFastApi_TrivialSignature) { v8::Handle<v8::Function> fun = fun_templ->GetFunction(); GenerateSomeGarbage(); context->Global()->Set(v8_str("o"), fun->NewInstance()); - v8::Handle<Value> value = CompileRun( + v8::Handle<Value> value(CompileRun( "var result = 0;" "for (var i = 0; i < 100; i++) {" " result = o.method(41);" - "}"); + "}")); CHECK_EQ(42, context->Global()->Get(v8_str("result"))->Int32Value()); CHECK_EQ(100, interceptor_call_count); } @@ -9091,14 +9093,14 @@ THREADED_TEST(InterceptorCallICFastApi_SimpleSignature) { v8::Handle<v8::Function> fun = fun_templ->GetFunction(); GenerateSomeGarbage(); context->Global()->Set(v8_str("o"), fun->NewInstance()); - v8::Handle<Value> value = CompileRun( + v8::Handle<Value> value(CompileRun( "o.foo = 17;" "var receiver = {};" "receiver.__proto__ = o;" "var result = 0;" "for (var i = 0; i < 100; i++) {" " result = receiver.method(41);" - "}"); + "}")); CHECK_EQ(42, context->Global()->Get(v8_str("result"))->Int32Value()); CHECK_EQ(100, interceptor_call_count); } @@ -9121,7 +9123,7 @@ THREADED_TEST(InterceptorCallICFastApi_SimpleSignature_Miss1) { v8::Handle<v8::Function> fun = fun_templ->GetFunction(); GenerateSomeGarbage(); context->Global()->Set(v8_str("o"), fun->NewInstance()); - v8::Handle<Value> value = CompileRun( + v8::Handle<Value> value(CompileRun( "o.foo = 17;" "var receiver = {};" "receiver.__proto__ = o;" @@ -9133,7 +9135,7 @@ THREADED_TEST(InterceptorCallICFastApi_SimpleSignature_Miss1) { " saved_result = result;" " receiver = {method: function(x) { return x - 1 }};" " }" - "}"); + "}")); CHECK_EQ(40, context->Global()->Get(v8_str("result"))->Int32Value()); CHECK_EQ(42, context->Global()->Get(v8_str("saved_result"))->Int32Value()); CHECK_GE(interceptor_call_count, 50); @@ -9157,7 +9159,7 @@ THREADED_TEST(InterceptorCallICFastApi_SimpleSignature_Miss2) { v8::Handle<v8::Function> fun = fun_templ->GetFunction(); GenerateSomeGarbage(); context->Global()->Set(v8_str("o"), fun->NewInstance()); - v8::Handle<Value> value = CompileRun( + v8::Handle<Value> value(CompileRun( "o.foo = 17;" "var receiver = {};" "receiver.__proto__ = o;" @@ -9169,7 +9171,7 @@ THREADED_TEST(InterceptorCallICFastApi_SimpleSignature_Miss2) { " saved_result = result;" " o.method = function(x) { return x - 1 };" " }" - "}"); + "}")); CHECK_EQ(40, context->Global()->Get(v8_str("result"))->Int32Value()); CHECK_EQ(42, context->Global()->Get(v8_str("saved_result"))->Int32Value()); CHECK_GE(interceptor_call_count, 50); @@ -9194,7 +9196,7 @@ THREADED_TEST(InterceptorCallICFastApi_SimpleSignature_Miss3) { GenerateSomeGarbage(); context->Global()->Set(v8_str("o"), fun->NewInstance()); v8::TryCatch try_catch; - v8::Handle<Value> value = CompileRun( + v8::Handle<Value> value(CompileRun( "o.foo = 17;" "var receiver = {};" "receiver.__proto__ = o;" @@ -9206,7 +9208,7 @@ THREADED_TEST(InterceptorCallICFastApi_SimpleSignature_Miss3) { " saved_result = result;" " receiver = 333;" " }" - "}"); + "}")); CHECK(try_catch.HasCaught()); CHECK_EQ(v8_str("TypeError: Object 333 has no method 'method'"), try_catch.Exception()->ToString()); @@ -9233,7 +9235,7 @@ THREADED_TEST(InterceptorCallICFastApi_SimpleSignature_TypeError) { GenerateSomeGarbage(); context->Global()->Set(v8_str("o"), fun->NewInstance()); v8::TryCatch try_catch; - v8::Handle<Value> value = CompileRun( + v8::Handle<Value> value(CompileRun( "o.foo = 17;" "var receiver = {};" "receiver.__proto__ = o;" @@ -9245,7 +9247,7 @@ THREADED_TEST(InterceptorCallICFastApi_SimpleSignature_TypeError) { " saved_result = result;" " receiver = {method: receiver.method};" " }" - "}"); + "}")); CHECK(try_catch.HasCaught()); CHECK_EQ(v8_str("TypeError: Illegal invocation"), try_catch.Exception()->ToString()); @@ -9262,16 +9264,16 @@ THREADED_TEST(CallICFastApi_TrivialSignature) { v8::Handle<v8::Signature>()); v8::Handle<v8::ObjectTemplate> proto_templ = fun_templ->PrototypeTemplate(); proto_templ->Set(v8_str("method"), method_templ); - v8::Handle<v8::ObjectTemplate> templ = fun_templ->InstanceTemplate(); + v8::Handle<v8::ObjectTemplate> templ(fun_templ->InstanceTemplate()); LocalContext context; v8::Handle<v8::Function> fun = fun_templ->GetFunction(); GenerateSomeGarbage(); context->Global()->Set(v8_str("o"), fun->NewInstance()); - v8::Handle<Value> value = CompileRun( + v8::Handle<Value> value(CompileRun( "var result = 0;" "for (var i = 0; i < 100; i++) {" " result = o.method(41);" - "}"); + "}")); CHECK_EQ(42, context->Global()->Get(v8_str("result"))->Int32Value()); } @@ -9285,19 +9287,19 @@ THREADED_TEST(CallICFastApi_SimpleSignature) { v8::Signature::New(fun_templ)); v8::Handle<v8::ObjectTemplate> proto_templ = fun_templ->PrototypeTemplate(); proto_templ->Set(v8_str("method"), method_templ); - v8::Handle<v8::ObjectTemplate> templ = fun_templ->InstanceTemplate(); + v8::Handle<v8::ObjectTemplate> templ(fun_templ->InstanceTemplate()); LocalContext context; v8::Handle<v8::Function> fun = fun_templ->GetFunction(); GenerateSomeGarbage(); context->Global()->Set(v8_str("o"), fun->NewInstance()); - v8::Handle<Value> value = CompileRun( + v8::Handle<Value> value(CompileRun( "o.foo = 17;" "var receiver = {};" "receiver.__proto__ = o;" "var result = 0;" "for (var i = 0; i < 100; i++) {" " result = receiver.method(41);" - "}"); + "}")); CHECK_EQ(42, context->Global()->Get(v8_str("result"))->Int32Value()); } @@ -9311,12 +9313,12 @@ THREADED_TEST(CallICFastApi_SimpleSignature_Miss1) { v8::Signature::New(fun_templ)); v8::Handle<v8::ObjectTemplate> proto_templ = fun_templ->PrototypeTemplate(); proto_templ->Set(v8_str("method"), method_templ); - v8::Handle<v8::ObjectTemplate> templ = fun_templ->InstanceTemplate(); + v8::Handle<v8::ObjectTemplate> templ(fun_templ->InstanceTemplate()); LocalContext context; v8::Handle<v8::Function> fun = fun_templ->GetFunction(); GenerateSomeGarbage(); context->Global()->Set(v8_str("o"), fun->NewInstance()); - v8::Handle<Value> value = CompileRun( + v8::Handle<Value> value(CompileRun( "o.foo = 17;" "var receiver = {};" "receiver.__proto__ = o;" @@ -9328,7 +9330,7 @@ THREADED_TEST(CallICFastApi_SimpleSignature_Miss1) { " saved_result = result;" " receiver = {method: function(x) { return x - 1 }};" " }" - "}"); + "}")); CHECK_EQ(40, context->Global()->Get(v8_str("result"))->Int32Value()); CHECK_EQ(42, context->Global()->Get(v8_str("saved_result"))->Int32Value()); } @@ -9342,13 +9344,13 @@ THREADED_TEST(CallICFastApi_SimpleSignature_Miss2) { v8::Signature::New(fun_templ)); v8::Handle<v8::ObjectTemplate> proto_templ = fun_templ->PrototypeTemplate(); proto_templ->Set(v8_str("method"), method_templ); - v8::Handle<v8::ObjectTemplate> templ = fun_templ->InstanceTemplate(); + v8::Handle<v8::ObjectTemplate> templ(fun_templ->InstanceTemplate()); LocalContext context; v8::Handle<v8::Function> fun = fun_templ->GetFunction(); GenerateSomeGarbage(); context->Global()->Set(v8_str("o"), fun->NewInstance()); v8::TryCatch try_catch; - v8::Handle<Value> value = CompileRun( + v8::Handle<Value> value(CompileRun( "o.foo = 17;" "var receiver = {};" "receiver.__proto__ = o;" @@ -9360,7 +9362,7 @@ THREADED_TEST(CallICFastApi_SimpleSignature_Miss2) { " saved_result = result;" " receiver = 333;" " }" - "}"); + "}")); CHECK(try_catch.HasCaught()); CHECK_EQ(v8_str("TypeError: Object 333 has no method 'method'"), try_catch.Exception()->ToString()); @@ -9388,7 +9390,7 @@ THREADED_TEST(InterceptorKeyedCallICKeyChange1) { templ->SetNamedPropertyHandler(NoBlockGetterX); LocalContext context; context->Global()->Set(v8_str("o"), templ->NewInstance()); - v8::Handle<Value> value = CompileRun( + v8::Handle<Value> value(CompileRun( "proto = new Object();" "proto.y = function(x) { return x + 1; };" "proto.z = function(x) { return x - 1; };" @@ -9398,7 +9400,7 @@ THREADED_TEST(InterceptorKeyedCallICKeyChange1) { "for (var i = 0; i < 10; i++) {" " if (i == 5) { method = 'z'; };" " result += o[method](41);" - "}"); + "}")); CHECK_EQ(42*5 + 40*5, context->Global()->Get(v8_str("result"))->Int32Value()); } @@ -9414,7 +9416,7 @@ THREADED_TEST(InterceptorKeyedCallICKeyChange2) { context->Global()->Set(v8_str("proto1"), templ->NewInstance()); keyed_call_ic_function = v8_compile("function f(x) { return x - 1; }; f")->Run(); - v8::Handle<Value> value = CompileRun( + v8::Handle<Value> value(CompileRun( "o = new Object();" "proto2 = new Object();" "o.y = function(x) { return x + 1; };" @@ -9426,7 +9428,7 @@ THREADED_TEST(InterceptorKeyedCallICKeyChange2) { "for (var i = 0; i < 10; i++) {" " if (i == 5) { method = 'y'; };" " result += o[method](41);" - "}"); + "}")); CHECK_EQ(42*5 + 40*5, context->Global()->Get(v8_str("result"))->Int32Value()); } @@ -9439,7 +9441,7 @@ THREADED_TEST(InterceptorKeyedCallICKeyChangeOnGlobal) { templ->SetNamedPropertyHandler(NoBlockGetterX); LocalContext context; context->Global()->Set(v8_str("o"), templ->NewInstance()); - v8::Handle<Value> value = CompileRun( + v8::Handle<Value> value(CompileRun( "function inc(x) { return x + 1; };" "inc(1);" "function dec(x) { return x - 1; };" @@ -9452,7 +9454,7 @@ THREADED_TEST(InterceptorKeyedCallICKeyChangeOnGlobal) { "for (var i = 0; i < 10; i++) {" " if (i == 5) { method = 'y'; };" " result += o[method](41);" - "}"); + "}")); CHECK_EQ(42*5 + 40*5, context->Global()->Get(v8_str("result"))->Int32Value()); } @@ -9465,7 +9467,7 @@ THREADED_TEST(InterceptorKeyedCallICFromGlobal) { LocalContext context; context->Global()->Set(v8_str("o"), templ_o->NewInstance()); - v8::Handle<Value> value = CompileRun( + v8::Handle<Value> value(CompileRun( "function len(x) { return x.length; };" "o.__proto__ = this;" "var m = 'parseFloat';" @@ -9476,7 +9478,7 @@ THREADED_TEST(InterceptorKeyedCallICFromGlobal) { " saved_result = result;" " };" " result = o[m]('239');" - "}"); + "}")); CHECK_EQ(3, context->Global()->Get(v8_str("result"))->Int32Value()); CHECK_EQ(239, context->Global()->Get(v8_str("saved_result"))->Int32Value()); } @@ -9489,7 +9491,7 @@ THREADED_TEST(InterceptorKeyedCallICMapChangeBefore) { LocalContext context; context->Global()->Set(v8_str("proto"), templ_o->NewInstance()); - v8::Handle<Value> value = CompileRun( + v8::Handle<Value> value(CompileRun( "var o = new Object();" "o.__proto__ = proto;" "o.method = function(x) { return x + 1; };" @@ -9498,7 +9500,7 @@ THREADED_TEST(InterceptorKeyedCallICMapChangeBefore) { "for (var i = 0; i < 10; i++) {" " if (i == 5) { o.method = function(x) { return x - 1; }; };" " result += o[m](41);" - "}"); + "}")); CHECK_EQ(42*5 + 40*5, context->Global()->Get(v8_str("result"))->Int32Value()); } @@ -9511,7 +9513,7 @@ THREADED_TEST(InterceptorKeyedCallICMapChangeAfter) { LocalContext context; context->Global()->Set(v8_str("o"), templ_o->NewInstance()); - v8::Handle<Value> value = CompileRun( + v8::Handle<Value> value(CompileRun( "var proto = new Object();" "o.__proto__ = proto;" "proto.method = function(x) { return x + 1; };" @@ -9520,7 +9522,7 @@ THREADED_TEST(InterceptorKeyedCallICMapChangeAfter) { "for (var i = 0; i < 10; i++) {" " if (i == 5) { proto.method = function(x) { return x - 1; }; };" " result += o[m](41);" - "}"); + "}")); CHECK_EQ(42*5 + 40*5, context->Global()->Get(v8_str("result"))->Int32Value()); } @@ -10436,7 +10438,7 @@ THREADED_TEST(NestedHandleScopeAndContexts) { v8::Persistent<Context> env = Context::New(); env->Enter(); v8::Handle<Value> value = NestedScope(env); - v8::Handle<String> str = value->ToString(); + v8::Handle<String> str(value->ToString()); env->Exit(); env.Dispose(); } @@ -10444,7 +10446,7 @@ THREADED_TEST(NestedHandleScopeAndContexts) { THREADED_TEST(ExternalAllocatedMemory) { v8::HandleScope outer; - v8::Persistent<Context> env = Context::New(); + v8::Persistent<Context> env(Context::New()); const int kSize = 1024*1024; CHECK_EQ(v8::V8::AdjustAmountOfExternalAllocatedMemory(kSize), kSize); CHECK_EQ(v8::V8::AdjustAmountOfExternalAllocatedMemory(-kSize), 0); @@ -10782,7 +10784,7 @@ THREADED_TEST(AccessControlRepeatedContextCreation) { i::Handle<i::FunctionTemplateInfo> constructor( i::FunctionTemplateInfo::cast(internal_template->constructor())); CHECK(!constructor->access_check_info()->IsUndefined()); - v8::Persistent<Context> context0 = Context::New(NULL, global_template); + v8::Persistent<Context> context0(Context::New(NULL, global_template)); CHECK(!constructor->access_check_info()->IsUndefined()); } @@ -12858,11 +12860,11 @@ static void ExternalArrayTestHelper(v8::ExternalArrayType array_type, const int kLargeElementCount = kXSize * kYSize * 4; ElementType* large_array_data = static_cast<ElementType*>(malloc(kLargeElementCount * element_size)); - i::Handle<ExternalArrayClass> large_array = + i::Handle<ExternalArrayClass> large_array( i::Handle<ExternalArrayClass>::cast( FACTORY->NewExternalArray(kLargeElementCount, - array_type, - array_data)); + array_type, + array_data))); v8::Handle<v8::Object> large_obj = v8::Object::New(); // Set the elements to be the external array. large_obj->SetIndexedPropertiesToExternalArrayData(large_array_data, @@ -13261,8 +13263,8 @@ TEST(CaptureStackTrace) { "}\n" "var x;eval('new foo();');"; v8::Handle<v8::String> overview_src = v8::String::New(overview_source); - v8::Handle<Value> overview_result = - v8::Script::New(overview_src, origin)->Run(); + v8::Handle<Value> overview_result( + v8::Script::New(overview_src, origin)->Run()); ASSERT(!overview_result.IsEmpty()); ASSERT(overview_result->IsObject()); @@ -13282,7 +13284,7 @@ TEST(CaptureStackTrace) { v8::ScriptOrigin detailed_origin(origin, line_offset, column_offset); v8::Handle<v8::Script> detailed_script( v8::Script::New(detailed_src, &detailed_origin)); - v8::Handle<Value> detailed_result = detailed_script->Run(); + v8::Handle<Value> detailed_result(detailed_script->Run()); ASSERT(!detailed_result.IsEmpty()); ASSERT(detailed_result->IsObject()); } @@ -13584,7 +13586,7 @@ THREADED_TEST(QuietSignalingNaNs) { static v8::Handle<Value> SpaghettiIncident(const v8::Arguments& args) { v8::HandleScope scope; v8::TryCatch tc; - v8::Handle<v8::String> str = args[0]->ToString(); + v8::Handle<v8::String> str(args[0]->ToString()); if (tc.HasCaught()) return tc.ReThrow(); return v8::Undefined(); @@ -14847,7 +14849,7 @@ TEST(RegExp) { // RegExps are objects on which you can set properties. re->Set(v8_str("property"), v8::Integer::New(32)); - v8::Handle<v8::Value> value = CompileRun("re.property"); + v8::Handle<v8::Value> value(CompileRun("re.property")); ASSERT_EQ(32, value->Int32Value()); v8::TryCatch try_catch; diff --git a/src/3rdparty/v8/test/cctest/test-compiler.cc b/src/3rdparty/v8/test/cctest/test-compiler.cc index f5c01e6..7f63ebc 100644 --- a/src/3rdparty/v8/test/cctest/test-compiler.cc +++ b/src/3rdparty/v8/test/cctest/test-compiler.cc @@ -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()); diff --git a/src/3rdparty/v8/test/cctest/test-debug.cc b/src/3rdparty/v8/test/cctest/test-debug.cc index 7e51c34..a9e2836 100644 --- a/src/3rdparty/v8/test/cctest/test-debug.cc +++ b/src/3rdparty/v8/test/cctest/test-debug.cc @@ -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); } @@ -2305,65 +2305,6 @@ TEST(ScriptBreakPointTopLevelCrash) { CheckDebuggerUnloaded(); } -// Test that breakpoint_relocation flag is honored -TEST(ScriptBreakPointNoRelocation) { - i::FLAG_breakpoint_relocation = false; - - v8::HandleScope scope; - DebugLocalContext env; - env.ExposeDebug(); - - // Create a function for checking the function when hitting a break point. - frame_function_name = CompileFunction(&env, - frame_function_name_source, - "frame_function_name"); - - v8::Debug::SetDebugEventListener(DebugEventBreakPointHitCount, - v8::Undefined()); - - v8::Local<v8::String> script1 = v8::String::New( - "a = 0 // line 0\n" - " // line 1\n" - " // line 2\n" - " // line 3\n" - "function f() { // line 4\n" - " return 0; // line 5\n" - "} // line 6"); - - // Set the script break point on the empty line - SetScriptBreakPointByNameFromJS("test.html", 2, -1); - - // Compile the script and call the function. - v8::ScriptOrigin origin(v8::String::New("test.html"), v8::Integer::New(0)); - v8::Script::Compile(script1, &origin)->Run(); - v8::Local<v8::Function> f - = v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("f"))); - f->Call(env->Global(), 0, NULL); - - // Check that a break point was not hit - CHECK_EQ(0, break_point_hit_count); - - v8::Local<v8::String> script2 = v8::String::New( - "a = 0 // line 0\n" - "function g() { // line 1\n" - " return 0; // line 2\n" - "} // line 3\n" - "function f() { // line 4\n" - " return 0; // line 5\n" - "} // line 6"); - - // Compile the script and call the new function - v8::Script::Compile(script2, &origin)->Run(); - v8::Local<v8::Function> g - = v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("g"))); - g->Call(env->Global(), 0, NULL); - - // Check that a break point was not hit - CHECK_EQ(1, break_point_hit_count); - - v8::Debug::SetDebugEventListener(NULL); - CheckDebuggerUnloaded(); -} // Test that it is possible to remove the last break point for a function // inside the break handling of that break point. @@ -3810,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) {};}", @@ -5606,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); @@ -6086,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 @@ -6734,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) { @@ -6745,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) { diff --git a/src/3rdparty/v8/test/cctest/test-deoptimization.cc b/src/3rdparty/v8/test/cctest/test-deoptimization.cc index 056c981..c713b02 100644 --- a/src/3rdparty/v8/test/cctest/test-deoptimization.cc +++ b/src/3rdparty/v8/test/cctest/test-deoptimization.cc @@ -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)); } diff --git a/src/3rdparty/v8/test/cctest/test-heap.cc b/src/3rdparty/v8/test/cctest/test-heap.cc index 8ed5bf7..d6b3c80 100644 --- a/src/3rdparty/v8/test/cctest/test-heap.cc +++ b/src/3rdparty/v8/test/cctest/test-heap.cc @@ -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)); diff --git a/src/3rdparty/v8/test/cctest/test-parsing.cc b/src/3rdparty/v8/test/cctest/test-parsing.cc index 8cfd5f7..00d200a 100755 --- a/src/3rdparty/v8/test/cctest/test-parsing.cc +++ b/src/3rdparty/v8/test/cctest/test-parsing.cc @@ -63,7 +63,7 @@ TEST(ScanKeywords) { CHECK(static_cast<int>(sizeof(buffer)) >= length); { i::Utf8ToUC16CharacterStream stream(keyword, length); - i::JavaScriptScanner scanner(&unicode_cache); + i::Scanner scanner(&unicode_cache); // The scanner should parse 'let' as Token::LET for this test. scanner.SetHarmonyScoping(true); scanner.Initialize(&stream); @@ -73,7 +73,7 @@ TEST(ScanKeywords) { // Removing characters will make keyword matching fail. { i::Utf8ToUC16CharacterStream stream(keyword, length - 1); - i::JavaScriptScanner scanner(&unicode_cache); + i::Scanner scanner(&unicode_cache); scanner.Initialize(&stream); CHECK_EQ(i::Token::IDENTIFIER, scanner.Next()); CHECK_EQ(i::Token::EOS, scanner.Next()); @@ -84,7 +84,7 @@ TEST(ScanKeywords) { memmove(buffer, keyword, length); buffer[length] = chars_to_append[j]; i::Utf8ToUC16CharacterStream stream(buffer, length + 1); - i::JavaScriptScanner scanner(&unicode_cache); + i::Scanner scanner(&unicode_cache); scanner.Initialize(&stream); CHECK_EQ(i::Token::IDENTIFIER, scanner.Next()); CHECK_EQ(i::Token::EOS, scanner.Next()); @@ -94,7 +94,7 @@ TEST(ScanKeywords) { memmove(buffer, keyword, length); buffer[length - 1] = '_'; i::Utf8ToUC16CharacterStream stream(buffer, length); - i::JavaScriptScanner scanner(&unicode_cache); + i::Scanner scanner(&unicode_cache); scanner.Initialize(&stream); CHECK_EQ(i::Token::IDENTIFIER, scanner.Next()); CHECK_EQ(i::Token::EOS, scanner.Next()); @@ -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); } @@ -257,7 +257,7 @@ TEST(StandAlonePreParser) { reinterpret_cast<const i::byte*>(program), static_cast<unsigned>(strlen(program))); i::CompleteParserRecorder log; - i::JavaScriptScanner scanner(i::Isolate::Current()->unicode_cache()); + i::Scanner scanner(i::Isolate::Current()->unicode_cache()); scanner.Initialize(&stream); int flags = i::kAllowLazy | i::kAllowNativesSyntax; @@ -293,7 +293,7 @@ TEST(StandAlonePreParserNoNatives) { reinterpret_cast<const i::byte*>(program), static_cast<unsigned>(strlen(program))); i::CompleteParserRecorder log; - i::JavaScriptScanner scanner(i::Isolate::Current()->unicode_cache()); + i::Scanner scanner(i::Isolate::Current()->unicode_cache()); scanner.Initialize(&stream); // Flags don't allow natives syntax. @@ -394,7 +394,7 @@ TEST(PreParseOverflow) { reinterpret_cast<const i::byte*>(*program), static_cast<unsigned>(kProgramSize)); i::CompleteParserRecorder log; - i::JavaScriptScanner scanner(i::Isolate::Current()->unicode_cache()); + i::Scanner scanner(i::Isolate::Current()->unicode_cache()); scanner.Initialize(&stream); @@ -612,7 +612,7 @@ void TestStreamScanner(i::UC16CharacterStream* stream, i::Token::Value* expected_tokens, int skip_pos = 0, // Zero means not skipping. int skip_to = 0) { - i::JavaScriptScanner scanner(i::Isolate::Current()->unicode_cache()); + i::Scanner scanner(i::Isolate::Current()->unicode_cache()); scanner.Initialize(stream); int i = 0; @@ -693,7 +693,7 @@ void TestScanRegExp(const char* re_source, const char* expected) { i::Utf8ToUC16CharacterStream stream( reinterpret_cast<const i::byte*>(re_source), static_cast<unsigned>(strlen(re_source))); - i::JavaScriptScanner scanner(i::Isolate::Current()->unicode_cache()); + i::Scanner scanner(i::Isolate::Current()->unicode_cache()); scanner.Initialize(&stream); i::Token::Value start = scanner.peek(); @@ -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( diff --git a/src/3rdparty/v8/test/mjsunit/date.js b/src/3rdparty/v8/test/mjsunit/date.js index a7f6cfa..fa43cbb 100644 --- a/src/3rdparty/v8/test/mjsunit/date.js +++ b/src/3rdparty/v8/test/mjsunit/date.js @@ -157,7 +157,7 @@ testToLocaleTimeString(); // Test that -0 is treated correctly in MakeDay. var d = new Date(); assertDoesNotThrow("d.setDate(-0)"); -assertDoesNotThrow("new Date(-0, -0, -0, -0, -0, -0. -0)"); +assertDoesNotThrow("new Date(-0, -0, -0, -0, -0, -0, -0)"); assertDoesNotThrow("new Date(0x40000000, 0x40000000, 0x40000000," + "0x40000000, 0x40000000, 0x40000000, 0x40000000)") assertDoesNotThrow("new Date(-0x40000001, -0x40000001, -0x40000001," + @@ -178,7 +178,7 @@ assertTrue(isNaN(Date.UTC(-271821, 3, 19, 23, 59, 59, 999))); assertTrue(isNaN(Date.UTC(-271821, 3, 19))); -// Test creation of large date values. +// Test creation with large date values. d = new Date(1969, 12, 1, 99999999999); assertTrue(isNaN(d.getTime())); d = new Date(1969, 12, 1, -99999999999); @@ -188,6 +188,12 @@ assertTrue(isNaN(d.getTime())); d = new Date(1969, 12, 1, -Infinity); assertTrue(isNaN(d.getTime())); + +// Test creation with obscure date values. +assertEquals(8640000000000000, Date.UTC(1970, 0, 1 + 100000001, -24)); +assertEquals(-8640000000000000, Date.UTC(1970, 0, 1 - 100000001, 24)); + + // Parsing ES5 ISO-8601 dates. // When TZ is omitted, it defaults to 'Z' meaning UTC. diff --git a/src/3rdparty/v8/test/mjsunit/debug-setbreakpoint.js b/src/3rdparty/v8/test/mjsunit/debug-setbreakpoint.js index 03ba28e..90dfcd1 100644 --- a/src/3rdparty/v8/test/mjsunit/debug-setbreakpoint.js +++ b/src/3rdparty/v8/test/mjsunit/debug-setbreakpoint.js @@ -49,17 +49,14 @@ function safeEval(code) { } } -function testArguments(dcp, arguments, success, is_script, is_script_reg_exp) { +function testArguments(dcp, arguments, success, is_script) { var request = '{' + base_request + ',"arguments":' + arguments + '}' var json_response = dcp.processDebugJSONRequest(request); var response = safeEval(json_response); if (success) { assertTrue(response.success, request + ' -> ' + json_response); if (is_script) { - if (is_script_reg_exp) - assertEquals('scriptRegExp', response.body.type, request + ' -> ' + json_response); - else - assertEquals('scriptName', response.body.type, request + ' -> ' + json_response); + assertEquals('scriptName', response.body.type, request + ' -> ' + json_response); } else { assertEquals('scriptId', response.body.type, request + ' -> ' + json_response); } @@ -111,11 +108,6 @@ function listener(event, exec_state, event_data, data) { testArguments(dcp, '{"type":"script","target":"test","line":1}', true, true); testArguments(dcp, '{"type":"script","target":"test","column":1}', true, true); - testArguments(dcp, '{"type":"scriptRegExp","target":"test"}', true, true, true); - testArguments(dcp, '{"type":"scriptRegExp","target":"test"}', true, true, true); - testArguments(dcp, '{"type":"scriptRegExp","target":"test","line":1}', true, true, true); - testArguments(dcp, '{"type":"scriptRegExp","target":"test","column":1}', true, true, true); - testArguments(dcp, '{"type":"scriptId","target":' + f_script_id + ',"line":' + f_line + '}', true, false); testArguments(dcp, '{"type":"scriptId","target":' + g_script_id + ',"line":' + g_line + '}', true, false); testArguments(dcp, '{"type":"scriptId","target":' + h_script_id + ',"line":' + h_line + '}', true, false); diff --git a/src/3rdparty/v8/test/mjsunit/regress/regress-221.js b/src/3rdparty/v8/test/mjsunit/elements-kind-depends.js index d3f2e35..82f188b 100644 --- a/src/3rdparty/v8/test/mjsunit/regress/regress-221.js +++ b/src/3rdparty/v8/test/mjsunit/elements-kind-depends.js @@ -1,4 +1,4 @@ -// Copyright 2009 the V8 project authors. All rights reserved. +// Copyright 2011 the V8 project authors. All rights reserved. // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: @@ -25,10 +25,50 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// Test that direct eval calls handle the case where eval has been -// deleted correctly. +// Flags: --allow-natives-syntax --smi-only-arrays -// See http://code.google.com/p/v8/issues/detail?id=221 +function burn() { + var a = new Array(3); + a[0] = 10; + a[1] = 15.5; + a[2] = 20; + return a; +} -assertThrows('eval(delete eval)'); +function check(a) { + assertEquals(10, a[0]); + assertEquals(15.5, a[1]); + assertEquals(20, a[2]); +} +var b; +for (var i = 0; i < 3; ++i) { + b = burn(); + check(b); // all OK +} +%OptimizeFunctionOnNextCall(burn); +b = burn(); +check(b); // fails + + +function loop_test(x) { + for (i=0;i<3;i++) { + x[i] = (i+1) * 0.5; + } +} + +function check2(b) { + assertEquals(0.5, b[0]); + assertEquals(1.0, b[1]); + assertEquals(1.5, b[2]); +} + +for (var i = 0; i < 3; ++i) { + b = [0,1,2]; + loop_test(b); + check2(b); +} +%OptimizeFunctionOnNextCall(loop_test); +b = [0,1,2]; +loop_test(b); +check2(b); diff --git a/src/3rdparty/v8/test/mjsunit/eval.js b/src/3rdparty/v8/test/mjsunit/eval.js index b6284ba..100f216 100644 --- a/src/3rdparty/v8/test/mjsunit/eval.js +++ b/src/3rdparty/v8/test/mjsunit/eval.js @@ -39,7 +39,7 @@ assertEquals(1, count); try { eval('hest 7 &*^*&^'); - assertTrue(false, 'Did not throw on syntax error.'); + assertUnreachable('Did not throw on syntax error.'); } catch (e) { assertEquals('SyntaxError', e.name); } @@ -108,6 +108,7 @@ foo = 0; result = (function() { var foo = 2; + // Should be non-direct call. return x.eval('foo'); })(); assertEquals(0, result); @@ -115,12 +116,33 @@ assertEquals(0, result); foo = 0; result = (function() { + var foo = 2; + // Should be non-direct call. + return (1,eval)('foo'); + })(); +assertEquals(0, result); + +foo = 0; +result = + (function() { var eval = function(x) { return x; }; var foo = eval(2); + // Should be non-direct call. return e('foo'); })(); assertEquals(0, result); +foo = 0; +result = + (function() { + var foo = 2; + // Should be direct call. + with ({ eval : e }) { + return eval('foo'); + } + })(); +assertEquals(2, result); + result = (function() { var eval = function(x) { return 2 * x; }; @@ -135,19 +157,17 @@ result = })(); assertEquals(this, result); -result = - (function() { - var obj = { f: function(eval) { return eval("this"); } }; - return obj.f(eval); - })(); -assertEquals(this, result); +(function() { + var obj = { f: function(eval) { return eval("this"); } }; + result = obj.f(eval); + assertEquals(obj, result); +})(); -result = - (function() { - var obj = { f: function(eval) { arguments; return eval("this"); } }; - return obj.f(eval); - })(); -assertEquals(this, result); +(function() { + var obj = { f: function(eval) { arguments; return eval("this"); } }; + result = obj.f(eval); + assertEquals(obj, result); +})(); eval = function(x) { return 2 * x; }; result = @@ -156,6 +176,9 @@ result = })(); assertEquals(4, result); + + + // Regression test: calling a function named eval found in a context that is // not the global context should get the global object as receiver. result = diff --git a/src/3rdparty/v8/test/mjsunit/mjsunit.js b/src/3rdparty/v8/test/mjsunit/mjsunit.js index faa5a43..6f6e323 100644 --- a/src/3rdparty/v8/test/mjsunit/mjsunit.js +++ b/src/3rdparty/v8/test/mjsunit/mjsunit.js @@ -223,7 +223,7 @@ var assertUnreachable; assertSame = function assertSame(expected, found, name_opt) { if (found === expected) { if (expected !== 0 || (1 / expected) == (1 / found)) return; - } else if (isNaN(expected) && isNaN(found)) { + } else if ((expected !== expected) && (found !== found)) { return; } fail(PrettyPrint(expected), found, name_opt); diff --git a/src/3rdparty/v8/test/mjsunit/mjsunit.status b/src/3rdparty/v8/test/mjsunit/mjsunit.status index 941e0e8..32989c2 100644 --- a/src/3rdparty/v8/test/mjsunit/mjsunit.status +++ b/src/3rdparty/v8/test/mjsunit/mjsunit.status @@ -32,6 +32,7 @@ bugs: FAIL ############################################################################## # Fails. +harmony/proxies-function: FAIL regress/regress-1119: FAIL ############################################################################## diff --git a/src/3rdparty/v8/test/mjsunit/strict-mode-implicit-receiver.js b/src/3rdparty/v8/test/mjsunit/strict-mode-implicit-receiver.js index 338f6d1..8284edd 100644 --- a/src/3rdparty/v8/test/mjsunit/strict-mode-implicit-receiver.js +++ b/src/3rdparty/v8/test/mjsunit/strict-mode-implicit-receiver.js @@ -168,12 +168,7 @@ outer_eval_conversion3(return_this, 'object'); outer_eval_conversion3(strict_eval, 'undefined'); outer_eval_conversion3(non_strict_eval, 'object'); -// TODO(ager): I'm not sure this is in accordance with the spec. At -// the moment, any call to eval where eval is not bound in the global -// context is treated as an indirect call to eval which means that the -// global context is used and the global object is passed as the -// receiver. -outer_eval_conversion3(eval, 'object'); +outer_eval_conversion3(eval, 'undefined'); function test_constant_function() { var o = { f: function() { "use strict"; return this; } }; diff --git a/src/3rdparty/v8/test/mjsunit/unbox-double-arrays.js b/src/3rdparty/v8/test/mjsunit/unbox-double-arrays.js index feecaec..fd7db28 100644 --- a/src/3rdparty/v8/test/mjsunit/unbox-double-arrays.js +++ b/src/3rdparty/v8/test/mjsunit/unbox-double-arrays.js @@ -77,8 +77,6 @@ function testOneArrayType(allocator) { assertEquals(value_6, a[6]); assertEquals(value_6, a[computed_6()]); // Test non-constant key assertEquals(value_7, a[7]); - assertEquals(undefined, a[large_array_size-1]); - assertEquals(undefined, a[-1]); assertEquals(large_array_size, a.length); assertTrue(%HasFastDoubleElements(a)); } @@ -89,8 +87,6 @@ function testOneArrayType(allocator) { assertEquals(value_6, a[6]); assertEquals(value_6, a[computed_6()]); // Test non-constant key assertEquals(value_7, a[7]); - assertEquals(undefined, a[large_array_size-1]); - assertEquals(undefined, a[-1]); assertEquals(large_array_size, a.length); assertTrue(%HasFastDoubleElements(a)); } @@ -101,8 +97,6 @@ function testOneArrayType(allocator) { assertEquals(value_6, a[6]); assertEquals(value_6, a[computed_6()]); // Test non-constant key assertEquals(value_7, a[7]); - assertEquals(undefined, a[large_array_size-1]); - assertEquals(undefined, a[-1]); assertEquals(large_array_size, a.length); assertTrue(%HasFastDoubleElements(a)); } @@ -113,32 +107,40 @@ function testOneArrayType(allocator) { assertEquals(value_6, a[6]); assertEquals(value_6, a[computed_6()]); // Test non-constant key assertEquals(value_7, a[7]); - assertEquals(undefined, a[large_array_size-1]); - assertEquals(undefined, a[-1]); assertEquals(large_array_size, a.length); assertTrue(%HasFastDoubleElements(a)); } function test_various_loads5(a, value_5, value_6, value_7) { assertTrue(%HasFastDoubleElements(a)); + if (value_5 != undefined) { + assertEquals(value_5, a[5]); + }; + if (value_6 != undefined) { + assertEquals(value_6, a[6]); + assertEquals(value_6, a[computed_6()]); // Test non-constant key + } + assertEquals(value_7, a[7]); + assertEquals(large_array_size, a.length); + assertTrue(%HasFastDoubleElements(a)); + } + + function test_various_loads6(a, value_5, value_6, value_7) { + assertTrue(%HasFastDoubleElements(a)); assertEquals(value_5, a[5]); assertEquals(value_6, a[6]); assertEquals(value_6, a[computed_6()]); // Test non-constant key assertEquals(value_7, a[7]); - assertEquals(undefined, a[large_array_size-1]); - assertEquals(undefined, a[-1]); assertEquals(large_array_size, a.length); assertTrue(%HasFastDoubleElements(a)); } - function test_various_loads6(a, value_5, value_6, value_7) { + function test_various_loads7(a, value_5, value_6, value_7) { assertTrue(%HasFastDoubleElements(a)); assertEquals(value_5, a[5]); assertEquals(value_6, a[6]); assertEquals(value_6, a[computed_6()]); // Test non-constant key assertEquals(value_7, a[7]); - assertEquals(undefined, a[large_array_size-1]); - assertEquals(undefined, a[-1]); assertEquals(large_array_size, a.length); assertTrue(%HasFastDoubleElements(a)); } @@ -248,6 +250,8 @@ function testOneArrayType(allocator) { expected_array_value(7)); // Make sure Crankshaft code handles the hole correctly (bailout) + var large_array = new allocator(large_array_size); + force_to_fast_double_array(large_array); test_various_stores(large_array, expected_array_value(5), expected_array_value(6), @@ -273,7 +277,12 @@ function testOneArrayType(allocator) { undefined, expected_array_value(7)); + %DeoptimizeFunction(test_various_loads6); + gc(); + // Test stores for non-NaN. + var large_array = new allocator(large_array_size); + force_to_fast_double_array(large_array); %OptimizeFunctionOnNextCall(test_various_stores); test_various_stores(large_array, expected_array_value(5), @@ -285,7 +294,19 @@ function testOneArrayType(allocator) { expected_array_value(6), expected_array_value(7)); - test_various_loads6(large_array, + test_various_loads7(large_array, + expected_array_value(5), + expected_array_value(6), + expected_array_value(7)); + + test_various_loads7(large_array, + expected_array_value(5), + expected_array_value(6), + expected_array_value(7)); + + %OptimizeFunctionOnNextCall(test_various_loads7); + + test_various_loads7(large_array, expected_array_value(5), expected_array_value(6), expected_array_value(7)); @@ -301,7 +322,7 @@ function testOneArrayType(allocator) { -NaN, expected_array_value(7)); - test_various_loads6(large_array, + test_various_loads7(large_array, NaN, -NaN, expected_array_value(7)); @@ -317,7 +338,7 @@ function testOneArrayType(allocator) { -Infinity, expected_array_value(7)); - test_various_loads6(large_array, + test_various_loads7(large_array, Infinity, -Infinity, expected_array_value(7)); @@ -434,7 +455,6 @@ large_array3[3] = Infinity; large_array3[4] = -Infinity; function call_apply() { - assertTrue(%HasFastDoubleElements(large_array3)); called_by_apply.apply({}, large_array3); } @@ -449,7 +469,6 @@ call_apply(); function test_for_in() { // Due to previous tests, keys 0..25 and 95 should be present. next_expected = 0; - assertTrue(%HasFastDoubleElements(large_array3)); for (x in large_array3) { assertTrue(next_expected++ == x); if (next_expected == 25) { diff --git a/src/3rdparty/v8/test/test262/test262.status b/src/3rdparty/v8/test/test262/test262.status index bfd68fb..4bdd6c1 100644 --- a/src/3rdparty/v8/test/test262/test262.status +++ b/src/3rdparty/v8/test/test262/test262.status @@ -121,6 +121,20 @@ S15.3.3.1_A4: FAIL 15.2.3.7-6-a-176: FAIL 15.2.3.7-6-a-177: FAIL +# V8 Bug: http://code.google.com/p/v8/issues/detail?id=1772 +15.2.3.6-4-292-1: FAIL +15.2.3.6-4-293-2: FAIL +15.2.3.6-4-293-3: FAIL +15.2.3.6-4-294-1: FAIL +15.2.3.6-4-295-1: FAIL +15.2.3.6-4-296-1: FAIL +15.2.3.6-4-333-11: FAIL +15.2.3.7-6-a-281: FAIL +15.2.3.7-6-a-282: FAIL +15.2.3.7-6-a-283: FAIL +15.2.3.7-6-a-284: FAIL +15.2.3.7-6-a-285: FAIL + # V8 Bug: http://code.google.com/p/v8/issues/detail?id=1790 15.4.4.22-9-9: FAIL @@ -131,12 +145,6 @@ S15.3_A3_T3: FAIL ##################### DELIBERATE INCOMPATIBILITIES ##################### -# 15.9.5.43-0-9 and 15.9.5.43-0-10. V8 doesn't throw RangeError -# from Date.prototype.toISOString when string is not a finite number. -# This is compatible with Firefox and Safari. -15.9.5.43-0-9: PASS || FAIL -15.9.5.43-0-10: PASS || FAIL - # We deliberately treat arguments to parseInt() with a leading zero as # octal numbers in order to not break the web. S15.1.2.2_A5.1_T1: FAIL_OK @@ -319,48 +327,6 @@ S15.4.4.3_A2_T1: FAIL_OK ######################### UNANALYZED FAILURES ########################## -# Bug? Object.defineProperty - 'O' is an Arguments object of a function that has -# formal parameters, 'name' is own property of 'O' which is also defined in -# [[ParameterMap]] of 'O', and 'desc' is data descriptor, test updating -# multiple attribute values of 'name' (10.6 [[DefineOwnProperty]] step 3 -# and 5.b) -15.2.3.6-4-292-1: FAIL -# Bug? Object.defineProperty - 'O' is an Arguments object of a function that has -# formal parameters, 'name' is own data property of 'O' which is also -# defined in [[ParameterMap]] of 'O', test TypeError is thrown when -# updating the [[Value]] attribute value of 'name' which is defined as -# unwritable and non-configurable (10.6 [[DefineOwnProperty]] step 4 and -# step 5b) -15.2.3.6-4-293-2: FAIL -# Bug? Object.defineProperty - 'O' is an Arguments object of a function that has -# formal parameters, 'name' is own data property of 'O' which is also -# defined in [[ParameterMap]] of 'O', test TypeError is not thrown when -# updating the [[Value]] attribute value of 'name' which is defined as -# non-writable and configurable (10.6 [[DefineOwnProperty]] step 3 and step -# 5.b) -15.2.3.6-4-293-3: FAIL -# Bug? Object.defineProperty - 'O' is an Arguments object of a function that has -# formal parameters, 'name' is own data property of 'O' which is also -# defined in [[ParameterMap]] of 'O', test TypeError is thrown when -# updating the [[Writable]] attribute value of 'name' which is defined as -# non-configurable (10.6 [[DefineOwnProperty]] step 4 and 5b) -15.2.3.6-4-294-1: FAIL -# Bug? Object.defineProperty - 'O' is an Arguments object of a function that has -# formal parameters, 'name' is own data property of 'O' which is also -# defined in [[ParameterMap]] of 'O', test TypeError is thrown when -# updating the [[Enumerable]] attribute value of 'name' which is defined as -# non-configurable (10.6 [[DefineOwnProperty]] step 4 and step 5b) -15.2.3.6-4-295-1: FAIL -# Bug? Object.defineProperty - 'O' is an Arguments object of a function that has -# formal parameters, 'name' is own data property of 'O' which is also -# defined in [[ParameterMap]] of 'O', test TypeError is thrown when -# updating the [[Configurable]] attribute value of 'name' which is defined -# as non-configurable (10.6 [[DefineOwnProperty]] step 4 and step 5b) -15.2.3.6-4-296-1: FAIL -# Bug? ES5 Attributes - indexed property 'P' with attributes [[Writable]]: true, -# [[Enumerable]]: true, [[Configurable]]: false is writable using simple -# assignment, 'O' is an Arguments object -15.2.3.6-4-333-11: FAIL # Bug? ES5 Attributes - Updating indexed data property 'P' whose attributes are # [[Writable]]: false, [[Enumerable]]: true, [[Configurable]]: true to an # accessor property, 'A' is an Array object (8.12.9 - step 9.b.i) @@ -373,9 +339,6 @@ S15.4.4.3_A2_T1: FAIL_OK # [[Writable]]: false, [[Enumerable]]: true, [[Configurable]]: true to an # accessor property, 'O' is the global object (8.12.9 - step 9.b.i) 15.2.3.6-4-360-7: FAIL -# Bug? ES5 Attributes - [[Value]] attribute of data property is the activex host -# object -15.2.3.6-4-401: FAIL # Bug? ES5 Attributes - Failed to add a property to an object when the object's # object has a property with same name and [[Writable]] attribute is set to # false (Number instance) @@ -417,34 +380,6 @@ S15.4.4.3_A2_T1: FAIL_OK 15.2.3.6-4-623: FAIL # Bug? ES5 Attributes - all attributes in Date.prototype.toJSON are correct 15.2.3.6-4-624: FAIL -# Bug? Object.defineProperties - 'O' is an Arguments object, 'P' is own data -# property of 'O' which is also defined in [[ParameterMap]] of 'O', and -# 'desc' is data descriptor, test updating multiple attribute values of 'P' -# (10.6 [[DefineOwnProperty]] step 3) -15.2.3.7-6-a-281: FAIL -# Bug? Object.defineProperties - 'O' is an Arguments object, 'P' is own data -# property of 'O' which is also defined in [[ParameterMap]] of 'O', test -# TypeError is thrown when updating the [[Value]] attribute value of 'P' -# whose writable and configurable attributes are false (10.6 -# [[DefineOwnProperty]] step 4) -15.2.3.7-6-a-282: FAIL -# Bug? Object.defineProperties - 'O' is an Arguments object, 'P' is own data -# property of 'O' which is also defined in [[ParameterMap]] of 'O', test -# TypeError is thrown when updating the [[Writable]] attribute value of 'P' -# which is defined as non-configurable (10.6 [[DefineOwnProperty]] step 4) -15.2.3.7-6-a-283: FAIL -# Bug? Object.defineProperties - 'O' is an Arguments object, 'P' is own data -# property of 'O' which is also defined in [[ParameterMap]] of 'O', test -# TypeError is thrown when updating the [[Enumerable]] attribute value of -# 'P' which is defined as non-configurable (10.6 [[DefineOwnProperty]] step -# 4) -15.2.3.7-6-a-284: FAIL -# Bug? Object.defineProperties - 'O' is an Arguments object, 'P' is own data -# property of 'O' which is also defined in [[ParameterMap]] of 'O', test -# TypeError is thrown when updating the [[Configurable]] attribute value of -# 'P' which is defined as non-configurable (10.6 [[DefineOwnProperty]] step -# 4) -15.2.3.7-6-a-285: FAIL # Bug? Array.prototype.indexOf - decreasing length of array does not delete # non-configurable properties 15.4.4.14-9-a-19: FAIL @@ -478,24 +413,6 @@ S15.4.4.3_A2_T1: FAIL_OK # Bug? Array.prototype.reduceRight - decreasing length of array does not delete # non-configurable properties 15.4.4.22-9-b-29: FAIL -# Bug? Date.prototype.toISOString - RangeError is thrown when value of date is -# Date(1970, 0, -99999999, 0, 0, 0, -1), the time zone is UTC(0) -15.9.5.43-0-8: FAIL -# Bug? Date.prototype.toISOString - RangeError is not thrown when value of date -# is Date(1970, 0, 100000001, 0, 0, 0, -1), the time zone is UTC(0) -15.9.5.43-0-11: FAIL -# Bug? Date.prototype.toISOString - RangeError is not thrown when value of date -# is Date(1970, 0, 100000001, 0, 0, 0, 0), the time zone is UTC(0) -15.9.5.43-0-12: FAIL -# Bug? Date.prototype.toISOString - RangeError is thrown when value of date is -# Date(1970, 0, 100000001, 0, 0, 0, 1), the time zone is UTC(0) -15.9.5.43-0-13: FAIL -# Bug? Date.prototype.toISOString - when value of year is -Infinity -# Date.prototype.toISOString throw the RangeError -15.9.5.43-0-14: FAIL -# Bug? Date.prototype.toISOString - value of year is Infinity -# Date.prototype.toISOString throw the RangeError -15.9.5.43-0-15: FAIL ############################ SKIPPED TESTS ############################# |