diff options
author | isaacs <i@izs.me> | 2012-06-07 11:45:30 -0700 |
---|---|---|
committer | isaacs <i@izs.me> | 2012-06-07 17:54:21 -0700 |
commit | 46b09e419039d2fbfde4029606de3d3aaef7af25 (patch) | |
tree | eeb80d063bef102429991d9cf1ca21bbe8768d09 /deps/v8/test | |
parent | 3116522e7c33c579bbb8ac0ee12c27ff3ff9825c (diff) | |
download | node-46b09e419039d2fbfde4029606de3d3aaef7af25.tar.gz |
Roll V8 back to 3.10.8.13
Diffstat (limited to 'deps/v8/test')
37 files changed, 181 insertions, 943 deletions
diff --git a/deps/v8/test/cctest/cctest.status b/deps/v8/test/cctest/cctest.status index 3cbc3bc45..af28be19d 100644 --- a/deps/v8/test/cctest/cctest.status +++ b/deps/v8/test/cctest/cctest.status @@ -27,7 +27,6 @@ prefix cctest -# All tests prefixed with 'Bug' are expected to fail. test-api/Bug*: FAIL ############################################################################## diff --git a/deps/v8/test/cctest/test-func-name-inference.cc b/deps/v8/test/cctest/test-func-name-inference.cc index 762cc9f0f..8f405b726 100644 --- a/deps/v8/test/cctest/test-func-name-inference.cc +++ b/deps/v8/test/cctest/test-func-name-inference.cc @@ -400,41 +400,3 @@ TEST(AssignmentAndCall) { // See MultipleAssignments test. CheckFunctionName(script, "return 2", "Enclosing.Bar"); } - - -TEST(MethodAssignmentInAnonymousFunctionCall) { - InitializeVM(); - v8::HandleScope scope; - - v8::Handle<v8::Script> script = Compile( - "(function () {\n" - " var EventSource = function () { };\n" - " EventSource.prototype.addListener = function () {\n" - " return 2012;\n" - " };\n" - " this.PublicEventSource = EventSource;\n" - "})();"); - CheckFunctionName(script, "return 2012", "EventSource.addListener"); -} - - -TEST(ReturnAnonymousFunction) { - InitializeVM(); - v8::HandleScope scope; - - v8::Handle<v8::Script> script = Compile( - "(function() {\n" - " function wrapCode() {\n" - " return function () {\n" - " return 2012;\n" - " };\n" - " };\n" - " var foo = 10;\n" - " function f() {\n" - " return wrapCode();\n" - " }\n" - " this.ref = f;\n" - "})()"); - script->Run(); - CheckFunctionName(script, "return 2012", ""); -} diff --git a/deps/v8/test/cctest/test-heap-profiler.cc b/deps/v8/test/cctest/test-heap-profiler.cc index c405b334c..3ac17414a 100644 --- a/deps/v8/test/cctest/test-heap-profiler.cc +++ b/deps/v8/test/cctest/test-heap-profiler.cc @@ -7,7 +7,6 @@ #include "v8.h" #include "cctest.h" -#include "hashmap.h" #include "heap-profiler.h" #include "snapshot.h" #include "debug.h" @@ -28,30 +27,22 @@ class NamedEntriesDetector { if (strcmp(entry->name(), "C2") == 0) has_C2 = true; } - static bool AddressesMatch(void* key1, void* key2) { - return key1 == key2; - } - void CheckAllReachables(i::HeapEntry* root) { - i::HashMap visited(AddressesMatch); i::List<i::HeapEntry*> list(10); list.Add(root); + root->paint(); CheckEntry(root); while (!list.is_empty()) { i::HeapEntry* entry = list.RemoveLast(); - i::Vector<i::HeapGraphEdge*> children = entry->children(); + i::Vector<i::HeapGraphEdge> children = entry->children(); for (int i = 0; i < children.length(); ++i) { - if (children[i]->type() == i::HeapGraphEdge::kShortcut) continue; - i::HeapEntry* child = children[i]->to(); - i::HashMap::Entry* entry = visited.Lookup( - reinterpret_cast<void*>(child), - static_cast<uint32_t>(reinterpret_cast<uintptr_t>(child)), - true); - if (entry->value) - continue; - entry->value = reinterpret_cast<void*>(1); - list.Add(child); - CheckEntry(child); + if (children[i].type() == i::HeapGraphEdge::kShortcut) continue; + i::HeapEntry* child = children[i].to(); + if (!child->painted()) { + list.Add(child); + child->paint(); + CheckEntry(child); + } } } } @@ -114,6 +105,9 @@ TEST(HeapSnapshot) { "var c2 = new C2(a2);"); const v8::HeapSnapshot* snapshot_env2 = v8::HeapProfiler::TakeSnapshot(v8_str("env2")); + i::HeapSnapshot* i_snapshot_env2 = + const_cast<i::HeapSnapshot*>( + reinterpret_cast<const i::HeapSnapshot*>(snapshot_env2)); const v8::HeapGraphNode* global_env2 = GetGlobalObject(snapshot_env2); // Verify, that JS global object of env2 has '..2' properties. @@ -126,7 +120,9 @@ TEST(HeapSnapshot) { NULL, GetProperty(global_env2, v8::HeapGraphEdge::kProperty, "b2_2")); CHECK_NE(NULL, GetProperty(global_env2, v8::HeapGraphEdge::kProperty, "c2")); + // Paint all nodes reachable from global object. NamedEntriesDetector det; + i_snapshot_env2->ClearPaint(); det.CheckAllReachables(const_cast<i::HeapEntry*>( reinterpret_cast<const i::HeapEntry*>(global_env2))); CHECK(det.has_A2); @@ -160,9 +156,9 @@ TEST(HeapSnapshotObjectSizes) { CHECK_NE(NULL, x2); // Test sizes. - CHECK_NE(0, x->GetSelfSize()); - CHECK_NE(0, x1->GetSelfSize()); - CHECK_NE(0, x2->GetSelfSize()); + CHECK_EQ(x->GetSelfSize() * 3, x->GetRetainedSize()); + CHECK_EQ(x1->GetSelfSize(), x1->GetRetainedSize()); + CHECK_EQ(x2->GetSelfSize(), x2->GetRetainedSize()); } @@ -481,6 +477,66 @@ TEST(HeapSnapshotRootPreservedAfterSorting) { } +TEST(HeapEntryDominator) { + // The graph looks like this: + // + // -> node1 + // a |^ + // -> node5 ba + // a v| + // node6 -> node2 + // b a |^ + // -> node4 ba + // b v| + // -> node3 + // + // The dominator for all nodes is node6. + + v8::HandleScope scope; + LocalContext env; + + CompileRun( + "function X(a, b) { this.a = a; this.b = b; }\n" + "node6 = new X(new X(new X()), new X(new X(),new X()));\n" + "(function(){\n" + "node6.a.a.b = node6.b.a; // node1 -> node2\n" + "node6.b.a.a = node6.a.a; // node2 -> node1\n" + "node6.b.a.b = node6.b.b; // node2 -> node3\n" + "node6.b.b.a = node6.b.a; // node3 -> node2\n" + "})();"); + + const v8::HeapSnapshot* snapshot = + v8::HeapProfiler::TakeSnapshot(v8_str("dominators")); + + const v8::HeapGraphNode* global = GetGlobalObject(snapshot); + CHECK_NE(NULL, global); + const v8::HeapGraphNode* node6 = + GetProperty(global, v8::HeapGraphEdge::kProperty, "node6"); + CHECK_NE(NULL, node6); + const v8::HeapGraphNode* node5 = + GetProperty(node6, v8::HeapGraphEdge::kProperty, "a"); + CHECK_NE(NULL, node5); + const v8::HeapGraphNode* node4 = + GetProperty(node6, v8::HeapGraphEdge::kProperty, "b"); + CHECK_NE(NULL, node4); + const v8::HeapGraphNode* node3 = + GetProperty(node4, v8::HeapGraphEdge::kProperty, "b"); + CHECK_NE(NULL, node3); + const v8::HeapGraphNode* node2 = + GetProperty(node4, v8::HeapGraphEdge::kProperty, "a"); + CHECK_NE(NULL, node2); + const v8::HeapGraphNode* node1 = + GetProperty(node5, v8::HeapGraphEdge::kProperty, "a"); + CHECK_NE(NULL, node1); + + CHECK_EQ(node6, node1->GetDominatorNode()); + CHECK_EQ(node6, node2->GetDominatorNode()); + CHECK_EQ(node6, node3->GetDominatorNode()); + CHECK_EQ(node6, node4->GetDominatorNode()); + CHECK_EQ(node6, node5->GetDominatorNode()); +} + + namespace { class TestJSONStream : public v8::OutputStream { diff --git a/deps/v8/test/cctest/test-heap.cc b/deps/v8/test/cctest/test-heap.cc index 33aaed334..72079dc2a 100644 --- a/deps/v8/test/cctest/test-heap.cc +++ b/deps/v8/test/cctest/test-heap.cc @@ -673,7 +673,7 @@ TEST(JSArray) { array->SetElementsLength(Smi::FromInt(0))->ToObjectChecked(); CHECK_EQ(Smi::FromInt(0), array->length()); // Must be in fast mode. - CHECK(array->HasFastSmiOrObjectElements()); + CHECK(array->HasFastTypeElements()); // array[length] = name. array->SetElement(0, *name, NONE, kNonStrictMode)->ToObjectChecked(); @@ -811,9 +811,7 @@ TEST(Iteration) { // Allocate a JS array to OLD_POINTER_SPACE and NEW_SPACE objs[next_objs_index++] = FACTORY->NewJSArray(10); - objs[next_objs_index++] = FACTORY->NewJSArray(10, - FAST_HOLEY_ELEMENTS, - TENURED); + objs[next_objs_index++] = FACTORY->NewJSArray(10, FAST_ELEMENTS, TENURED); // Allocate a small string to OLD_DATA_SPACE and NEW_SPACE objs[next_objs_index++] = @@ -1597,7 +1595,7 @@ TEST(PrototypeTransitionClearing) { Handle<JSObject> prototype; PagedSpace* space = HEAP->old_pointer_space(); do { - prototype = FACTORY->NewJSArray(32 * KB, FAST_HOLEY_ELEMENTS, TENURED); + prototype = FACTORY->NewJSArray(32 * KB, FAST_ELEMENTS, TENURED); } while (space->FirstPage() == space->LastPage() || !space->LastPage()->Contains(prototype->address())); @@ -1737,60 +1735,3 @@ TEST(OptimizedAllocationAlwaysInNewSpace) { CHECK(HEAP->InNewSpace(*o)); } - - -static int CountMapTransitions(Map* map) { - int result = 0; - DescriptorArray* descs = map->instance_descriptors(); - for (int i = 0; i < descs->number_of_descriptors(); i++) { - if (descs->IsTransitionOnly(i)) { - result++; - } - } - return result; -} - - -// Test that map transitions are cleared and maps are collected with -// incremental marking as well. -TEST(Regress1465) { - i::FLAG_allow_natives_syntax = true; - i::FLAG_trace_incremental_marking = true; - InitializeVM(); - v8::HandleScope scope; - - #define TRANSITION_COUNT 256 - for (int i = 0; i < TRANSITION_COUNT; i++) { - EmbeddedVector<char, 64> buffer; - OS::SNPrintF(buffer, "var o = new Object; o.prop%d = %d;", i, i); - CompileRun(buffer.start()); - } - CompileRun("var root = new Object;"); - Handle<JSObject> root = - v8::Utils::OpenHandle( - *v8::Handle<v8::Object>::Cast( - v8::Context::GetCurrent()->Global()->Get(v8_str("root")))); - - // Count number of live transitions before marking. - int transitions_before = CountMapTransitions(root->map()); - CompileRun("%DebugPrint(root);"); - CHECK_EQ(TRANSITION_COUNT, transitions_before); - - // Go through all incremental marking steps in one swoop. - IncrementalMarking* marking = HEAP->incremental_marking(); - CHECK(marking->IsStopped()); - marking->Start(); - CHECK(marking->IsMarking()); - while (!marking->IsComplete()) { - marking->Step(MB, IncrementalMarking::NO_GC_VIA_STACK_GUARD); - } - CHECK(marking->IsComplete()); - HEAP->CollectAllGarbage(Heap::kNoGCFlags); - CHECK(marking->IsStopped()); - - // Count number of live transitions after marking. Note that one transition - // is left, because 'o' still holds an instance of one transition target. - int transitions_after = CountMapTransitions(root->map()); - CompileRun("%DebugPrint(root);"); - CHECK_EQ(1, transitions_after); -} diff --git a/deps/v8/test/cctest/test-list.cc b/deps/v8/test/cctest/test-list.cc index 4c78f02ce..7520b05fc 100644 --- a/deps/v8/test/cctest/test-list.cc +++ b/deps/v8/test/cctest/test-list.cc @@ -130,18 +130,6 @@ TEST(RemoveLast) { } -TEST(Allocate) { - List<int> list(4); - list.Add(1); - CHECK_EQ(1, list.length()); - list.Allocate(100); - CHECK_EQ(100, list.length()); - CHECK_LE(100, list.capacity()); - list[99] = 123; - CHECK_EQ(123, list[99]); -} - - TEST(Clear) { List<int> list(4); CHECK_EQ(0, list.length()); diff --git a/deps/v8/test/cctest/test-mark-compact.cc b/deps/v8/test/cctest/test-mark-compact.cc index 27123704b..83a576d36 100644 --- a/deps/v8/test/cctest/test-mark-compact.cc +++ b/deps/v8/test/cctest/test-mark-compact.cc @@ -531,18 +531,18 @@ TEST(BootUpMemoryUse) { // there we just skip the test. if (initial_memory >= 0) { InitializeVM(); - intptr_t delta = MemoryInUse() - initial_memory; + intptr_t booted_memory = MemoryInUse(); if (sizeof(initial_memory) == 8) { if (v8::internal::Snapshot::IsEnabled()) { - CHECK_LE(delta, 3600 * 1024); // 3396. + CHECK_LE(booted_memory - initial_memory, 3600 * 1024); // 3396. } else { - CHECK_LE(delta, 4000 * 1024); // 3948. + CHECK_LE(booted_memory - initial_memory, 3600 * 1024); // 3432. } } else { if (v8::internal::Snapshot::IsEnabled()) { - CHECK_LE(delta, 2600 * 1024); // 2484. + CHECK_LE(booted_memory - initial_memory, 2600 * 1024); // 2484. } else { - CHECK_LE(delta, 2950 * 1024); // 2844 + CHECK_LE(booted_memory - initial_memory, 2950 * 1024); // 2844 } } } diff --git a/deps/v8/test/cctest/test-regexp.cc b/deps/v8/test/cctest/test-regexp.cc index 9b4f905e2..e89e6cddc 100644 --- a/deps/v8/test/cctest/test-regexp.cc +++ b/deps/v8/test/cctest/test-regexp.cc @@ -1,4 +1,4 @@ -// Copyright 2012 the V8 project authors. All rights reserved. +// Copyright 2008 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: @@ -506,13 +506,8 @@ static RegExpNode* Compile(const char* input, bool multiline, bool is_ascii) { NewStringFromUtf8(CStrVector(input)); Handle<String> sample_subject = isolate->factory()->NewStringFromUtf8(CStrVector("")); - RegExpEngine::Compile(&compile_data, - false, - false, - multiline, - pattern, - sample_subject, - is_ascii); + RegExpEngine::Compile( + &compile_data, false, multiline, pattern, sample_subject, is_ascii); return compile_data.node; } @@ -725,7 +720,6 @@ static ArchRegExpMacroAssembler::Result Execute(Code* code, input_start, input_end, captures, - 0, Isolate::Current()); } @@ -1004,11 +998,11 @@ TEST(MacroAssemblerNativeBackReferenceUC16) { int output[4]; NativeRegExpMacroAssembler::Result result = Execute(*code, - *input, - 0, - start_adr, - start_adr + input->length() * 2, - output); + *input, + 0, + start_adr, + start_adr + input->length() * 2, + output); CHECK_EQ(NativeRegExpMacroAssembler::SUCCESS, result); CHECK_EQ(0, output[0]); diff --git a/deps/v8/test/cctest/testcfg.py b/deps/v8/test/cctest/testcfg.py index f1387e8a4..b2eabc44e 100644 --- a/deps/v8/test/cctest/testcfg.py +++ b/deps/v8/test/cctest/testcfg.py @@ -53,8 +53,6 @@ class CcTestCase(test.TestCase): serialization_file = join('obj', 'test', self.mode, 'serdes') else: serialization_file = join('obj', 'serdes') - if not exists(join(self.context.buildspace, 'obj')): - os.makedirs(join(self.context.buildspace, 'obj')) serialization_file += '_' + self.GetName() serialization_file = join(self.context.buildspace, serialization_file) serialization_file += ''.join(self.variant_flags).replace('-', '_') diff --git a/deps/v8/test/mjsunit/accessor-map-sharing.js b/deps/v8/test/mjsunit/accessor-map-sharing.js deleted file mode 100644 index 8bbcb4f5d..000000000 --- a/deps/v8/test/mjsunit/accessor-map-sharing.js +++ /dev/null @@ -1,176 +0,0 @@ -// Copyright 2012 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: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following -// disclaimer in the documentation and/or other materials provided -// with the distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived -// from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Flags: --allow-natives-syntax --fast-accessor-properties - -// Handy abbreviations. -var dp = Object.defineProperty; -var gop = Object.getOwnPropertyDescriptor; - -function getter() { return 111; } -function setter(x) { print(222); } -function anotherGetter() { return 333; } -function anotherSetter(x) { print(444); } -var obj1, obj2; - -// Two objects with the same getter. -obj1 = {}; -dp(obj1, "alpha", { get: getter }); -obj2 = {}; -dp(obj2, "alpha", { get: getter }); -assertTrue(%HaveSameMap(obj1, obj2)); - -// Two objects with the same getter, oldskool. -obj1 = {}; -obj1.__defineGetter__("bravo", getter); -assertEquals(getter, obj1.__lookupGetter__("bravo")); -obj2 = {}; -obj2.__defineGetter__("bravo", getter); -assertEquals(getter, obj2.__lookupGetter__("bravo")); -assertTrue(%HaveSameMap(obj1, obj2)); - -// Two objects with the same setter. -obj1 = {}; -dp(obj1, "charlie", { set: setter }); -obj2 = {}; -dp(obj2, "charlie", { set: setter }); -assertTrue(%HaveSameMap(obj1, obj2)); - -// Two objects with the same setter, oldskool. -obj1 = {}; -obj1.__defineSetter__("delta", setter); -assertEquals(setter, obj1.__lookupSetter__("delta")); -obj2 = {}; -obj2.__defineSetter__("delta", setter); -assertEquals(setter, obj2.__lookupSetter__("delta")); -assertTrue(%HaveSameMap(obj1, obj2)); - -// Two objects with the same getter and setter. -obj1 = {}; -dp(obj1, "foxtrot", { get: getter, set: setter }); -obj2 = {}; -dp(obj2, "foxtrot", { get: getter, set: setter }); -assertTrue(%HaveSameMap(obj1, obj2)); - -// Two objects with the same getter and setter, set separately. -obj1 = {}; -dp(obj1, "golf", { get: getter, configurable: true }); -dp(obj1, "golf", { set: setter, configurable: true }); -obj2 = {}; -dp(obj2, "golf", { get: getter, configurable: true }); -dp(obj2, "golf", { set: setter, configurable: true }); -assertTrue(%HaveSameMap(obj1, obj2)); - -// Two objects with the same getter and setter, set separately, oldskool. -obj1 = {}; -obj1.__defineGetter__("hotel", getter); -obj1.__defineSetter__("hotel", setter); -obj2 = {}; -obj2.__defineGetter__("hotel", getter); -obj2.__defineSetter__("hotel", setter); -assertTrue(%HaveSameMap(obj1, obj2)); - -// Attribute-only change, shouldn't affect previous descriptor properties. -obj1 = {}; -dp(obj1, "india", { get: getter, configurable: true, enumerable: true }); -assertEquals(getter, gop(obj1, "india").get); -assertTrue(gop(obj1, "india").configurable); -assertTrue(gop(obj1, "india").enumerable); -dp(obj1, "india", { enumerable: false }); -assertEquals(getter, gop(obj1, "india").get); -assertTrue(gop(obj1, "india").configurable); -assertFalse(gop(obj1, "india").enumerable); - -// Attribute-only change, shouldn't affect objects with previously shared maps. -obj1 = {}; -dp(obj1, "juliet", { set: setter, configurable: true, enumerable: false }); -assertEquals(setter, gop(obj1, "juliet").set); -assertTrue(gop(obj1, "juliet").configurable); -assertFalse(gop(obj1, "juliet").enumerable); -obj2 = {}; -dp(obj2, "juliet", { set: setter, configurable: true, enumerable: false }); -assertEquals(setter, gop(obj2, "juliet").set); -assertTrue(gop(obj2, "juliet").configurable); -assertFalse(gop(obj2, "juliet").enumerable); -dp(obj1, "juliet", { set: setter, configurable: false, enumerable: true }); -assertEquals(setter, gop(obj1, "juliet").set); -assertFalse(gop(obj1, "juliet").configurable); -assertTrue(gop(obj1, "juliet").enumerable); -assertEquals(setter, gop(obj2, "juliet").set); -assertTrue(gop(obj2, "juliet").configurable); -assertFalse(gop(obj2, "juliet").enumerable); - -// Two objects with the different getters. -obj1 = {}; -dp(obj1, "kilo", { get: getter }); -obj2 = {}; -dp(obj2, "kilo", { get: anotherGetter }); -assertEquals(getter, gop(obj1, "kilo").get); -assertEquals(anotherGetter, gop(obj2, "kilo").get); -assertFalse(%HaveSameMap(obj1, obj2)); - -// Two objects with the same getters and different setters. -obj1 = {}; -dp(obj1, "lima", { get: getter, set: setter }); -obj2 = {}; -dp(obj2, "lima", { get: getter, set: anotherSetter }); -assertEquals(setter, gop(obj1, "lima").set); -assertEquals(anotherSetter, gop(obj2, "lima").set); -assertFalse(%HaveSameMap(obj1, obj2)); - -// Even 'undefined' is a kind of getter. -obj1 = {}; -dp(obj1, "mike", { get: undefined }); -assertTrue("mike" in obj1); -assertEquals(undefined, gop(obj1, "mike").get); -assertEquals(undefined, obj1.__lookupGetter__("mike")); -assertEquals(undefined, gop(obj1, "mike").set); -assertEquals(undefined, obj1.__lookupSetter__("mike")); - -// Even 'undefined' is a kind of setter. -obj1 = {}; -dp(obj1, "november", { set: undefined }); -assertTrue("november" in obj1); -assertEquals(undefined, gop(obj1, "november").get); -assertEquals(undefined, obj1.__lookupGetter__("november")); -assertEquals(undefined, gop(obj1, "november").set); -assertEquals(undefined, obj1.__lookupSetter__("november")); - -// Redefining a data property. -obj1 = {}; -obj1.oscar = 12345; -dp(obj1, "oscar", { set: setter }); -assertEquals(setter, gop(obj1, "oscar").set); - -// Re-adding the same getter/attributes pair. -obj1 = {}; -dp(obj1, "papa", { get: getter, configurable: true }); -dp(obj1, "papa", { get: getter, set: setter, configurable: true }); -assertEquals(getter, gop(obj1, "papa").get); -assertEquals(setter, gop(obj1, "papa").set); -assertTrue(gop(obj1, "papa").configurable); -assertFalse(gop(obj1, "papa").enumerable); diff --git a/deps/v8/test/mjsunit/array-construct-transition.js b/deps/v8/test/mjsunit/array-construct-transition.js index f8d7c830e..577e321a5 100644 --- a/deps/v8/test/mjsunit/array-construct-transition.js +++ b/deps/v8/test/mjsunit/array-construct-transition.js @@ -27,13 +27,13 @@ // Flags: --allow-natives-syntax --smi-only-arrays -support_smi_only_arrays = %HasFastSmiElements(new Array(1,2,3,4,5,6)); +support_smi_only_arrays = %HasFastSmiOnlyElements(new Array(1,2,3,4,5,6,7,8)); if (support_smi_only_arrays) { var a = new Array(0, 1, 2); - assertTrue(%HasFastSmiElements(a)); + assertTrue(%HasFastSmiOnlyElements(a)); var b = new Array(0.5, 1.2, 2.3); assertTrue(%HasFastDoubleElements(b)); var c = new Array(0.5, 1.2, new Object()); - assertTrue(%HasFastObjectElements(c)); + assertTrue(%HasFastElements(c)); } diff --git a/deps/v8/test/mjsunit/array-literal-transitions.js b/deps/v8/test/mjsunit/array-literal-transitions.js index a96719d44..f657525eb 100644 --- a/deps/v8/test/mjsunit/array-literal-transitions.js +++ b/deps/v8/test/mjsunit/array-literal-transitions.js @@ -1,4 +1,4 @@ -// Copyright 2012 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: @@ -33,7 +33,7 @@ // in this test case. Depending on whether smi-only arrays are actually // enabled, this test takes the appropriate code path to check smi-only arrays. -support_smi_only_arrays = %HasFastSmiElements([1,2,3,4,5,6,7,8,9,10]); +support_smi_only_arrays = %HasFastSmiOnlyElements([1,2,3,4,5,6,7,8,9,10]); if (support_smi_only_arrays) { print("Tests include smi-only arrays."); @@ -46,14 +46,14 @@ function get(foo) { return foo; } // Used to generate dynamic values. function array_literal_test() { var a0 = [1, 2, 3]; - assertTrue(%HasFastSmiElements(a0)); + assertTrue(%HasFastSmiOnlyElements(a0)); var a1 = [get(1), get(2), get(3)]; - assertTrue(%HasFastSmiElements(a1)); + assertTrue(%HasFastSmiOnlyElements(a1)); var b0 = [1, 2, get("three")]; - assertTrue(%HasFastObjectElements(b0)); + assertTrue(%HasFastElements(b0)); var b1 = [get(1), get(2), get("three")]; - assertTrue(%HasFastObjectElements(b1)); + assertTrue(%HasFastElements(b1)); var c0 = [1, 2, get(3.5)]; assertTrue(%HasFastDoubleElements(c0)); @@ -75,7 +75,7 @@ function array_literal_test() { var object = new Object(); var d0 = [1, 2, object]; - assertTrue(%HasFastObjectElements(d0)); + assertTrue(%HasFastElements(d0)); assertEquals(object, d0[2]); assertEquals(2, d0[1]); assertEquals(1, d0[0]); @@ -87,7 +87,7 @@ function array_literal_test() { assertEquals(1, e0[0]); var f0 = [1, 2, [1, 2]]; - assertTrue(%HasFastObjectElements(f0)); + assertTrue(%HasFastElements(f0)); assertEquals([1,2], f0[2]); assertEquals(2, f0[1]); assertEquals(1, f0[0]); @@ -115,9 +115,9 @@ if (support_smi_only_arrays) { large = [ 0, 1, 2, 3, 4, 5, d(), d(), d(), d(), d(), d(), o(), o(), o(), o() ]; assertFalse(%HasDictionaryElements(large)); - assertFalse(%HasFastSmiElements(large)); + assertFalse(%HasFastSmiOnlyElements(large)); assertFalse(%HasFastDoubleElements(large)); - assertTrue(%HasFastObjectElements(large)); + assertTrue(%HasFastElements(large)); assertEquals(large, [0, 1, 2, 3, 4, 5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, new Object(), new Object(), new Object(), new Object()]); diff --git a/deps/v8/test/mjsunit/big-array-literal.js b/deps/v8/test/mjsunit/big-array-literal.js index 8e0ff8727..a0fad7c2e 100644 --- a/deps/v8/test/mjsunit/big-array-literal.js +++ b/deps/v8/test/mjsunit/big-array-literal.js @@ -25,9 +25,6 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// On MacOS, this test needs a stack size of at least 538 kBytes. -// Flags: --stack-size=600 - // Test that we can make large object literals that work. // Also test that we can attempt to make even larger object literals without // crashing. diff --git a/deps/v8/test/mjsunit/compiler/inline-construct.js b/deps/v8/test/mjsunit/compiler/inline-construct.js index 7a3f1e44b..af9e69c94 100644 --- a/deps/v8/test/mjsunit/compiler/inline-construct.js +++ b/deps/v8/test/mjsunit/compiler/inline-construct.js @@ -25,7 +25,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// Flags: --allow-natives-syntax --inline-construct +// Flags: --allow-natives-syntax --expose-gc --inline-construct // Test inlining of constructor calls. @@ -68,9 +68,7 @@ function TestInAllContexts(constructor) { %DeoptimizeFunction(value_context); %DeoptimizeFunction(test_context); %DeoptimizeFunction(effect_context); - %ClearFunctionTypeFeedback(value_context); - %ClearFunctionTypeFeedback(test_context); - %ClearFunctionTypeFeedback(effect_context); + gc(); // Makes V8 forget about type information for *_context. } diff --git a/deps/v8/test/mjsunit/debug-liveedit-stack-padding.js b/deps/v8/test/mjsunit/debug-liveedit-stack-padding.js deleted file mode 100644 index 36de35697..000000000 --- a/deps/v8/test/mjsunit/debug-liveedit-stack-padding.js +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 2012 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: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following -// disclaimer in the documentation and/or other materials provided -// with the distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived -// from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Flags: --expose-debug-as debug -// Get the Debug object exposed from the debug context global object. - -Debug = debug.Debug; - -SlimFunction = eval( - "(function() {\n " + - " return 'Cat';\n" + - "})\n" -); - -var script = Debug.findScript(SlimFunction); - -Debug.setScriptBreakPointById(script.id, 1, 0); - -var orig_animal = "'Cat'"; -var patch_pos = script.source.indexOf(orig_animal); -var new_animal_patch = "'Capybara'"; - -debugger_handler = (function() { - var already_called = false; - return function() { - if (already_called) { - return; - } - already_called = true; - - var change_log = new Array(); - try { - Debug.LiveEdit.TestApi.ApplySingleChunkPatch(script, patch_pos, - orig_animal.length, new_animal_patch, change_log); - } finally { - print("Change log: " + JSON.stringify(change_log) + "\n"); - } - }; -})(); - -var saved_exception = null; - -function listener(event, exec_state, event_data, data) { - if (event == Debug.DebugEvent.Break) { - try { - debugger_handler(); - } catch (e) { - saved_exception = e; - } - } else { - print("Other: " + event); - } -} - -Debug.setListener(listener); - -var animal = SlimFunction(); - -if (saved_exception) { - print("Exception: " + saved_exception); - assertUnreachable(); -} - -assertEquals("Capybara", animal); diff --git a/deps/v8/test/mjsunit/elements-kind.js b/deps/v8/test/mjsunit/elements-kind.js index 26b3c7807..4aa79de65 100644 --- a/deps/v8/test/mjsunit/elements-kind.js +++ b/deps/v8/test/mjsunit/elements-kind.js @@ -34,7 +34,7 @@ // in this test case. Depending on whether smi-only arrays are actually // enabled, this test takes the appropriate code path to check smi-only arrays. -support_smi_only_arrays = %HasFastSmiElements(new Array(1,2,3,4,5,6,7,8)); +support_smi_only_arrays = %HasFastSmiOnlyElements(new Array(1,2,3,4,5,6,7,8)); if (support_smi_only_arrays) { print("Tests include smi-only arrays."); @@ -59,8 +59,8 @@ var elements_kind = { } function getKind(obj) { - if (%HasFastSmiElements(obj)) return elements_kind.fast_smi_only; - if (%HasFastObjectElements(obj)) return elements_kind.fast; + if (%HasFastSmiOnlyElements(obj)) return elements_kind.fast_smi_only; + if (%HasFastElements(obj)) return elements_kind.fast; if (%HasFastDoubleElements(obj)) return elements_kind.fast_double; if (%HasDictionaryElements(obj)) return elements_kind.dictionary; // Every external kind is also an external array. @@ -116,7 +116,7 @@ if (support_smi_only_arrays) { assertKind(elements_kind.fast_smi_only, too); } -// Make sure the element kind transitions from smi when a non-smi is stored. +// Make sure the element kind transitions from smionly when a non-smi is stored. var you = new Array(); assertKind(elements_kind.fast_smi_only, you); for (var i = 0; i < 1337; i++) { diff --git a/deps/v8/test/mjsunit/elements-transition-hoisting.js b/deps/v8/test/mjsunit/elements-transition-hoisting.js index 50ca2a16e..5e78f10a0 100644 --- a/deps/v8/test/mjsunit/elements-transition-hoisting.js +++ b/deps/v8/test/mjsunit/elements-transition-hoisting.js @@ -1,4 +1,4 @@ -// Copyright 2012 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: @@ -31,7 +31,7 @@ // not hoisted) correctly, don't change the semantics programs and don't trigger // deopt through hoisting in important situations. -support_smi_only_arrays = %HasFastSmiElements(new Array(1,2,3,4,5,6)); +support_smi_only_arrays = %HasFastSmiOnlyElements(new Array(1,2,3,4,5,6)); if (support_smi_only_arrays) { print("Tests include smi-only arrays."); diff --git a/deps/v8/test/mjsunit/elements-transition.js b/deps/v8/test/mjsunit/elements-transition.js index 0dffd3723..60e051b3f 100644 --- a/deps/v8/test/mjsunit/elements-transition.js +++ b/deps/v8/test/mjsunit/elements-transition.js @@ -27,7 +27,7 @@ // Flags: --allow-natives-syntax --smi-only-arrays -support_smi_only_arrays = %HasFastSmiElements(new Array(1,2,3,4,5,6,7,8)); +support_smi_only_arrays = %HasFastSmiOnlyElements(new Array(1,2,3,4,5,6,7,8)); if (support_smi_only_arrays) { print("Tests include smi-only arrays."); @@ -44,8 +44,8 @@ if (support_smi_only_arrays) { var array_1 = new Array(length); var array_2 = new Array(length); - assertTrue(%HasFastSmiElements(array_1)); - assertTrue(%HasFastSmiElements(array_2)); + assertTrue(%HasFastSmiOnlyElements(array_1)); + assertTrue(%HasFastSmiOnlyElements(array_2)); for (var i = 0; i < length; i++) { if (i == length - 5 && test_double) { // Trigger conversion to fast double elements at length-5. @@ -57,8 +57,8 @@ if (support_smi_only_arrays) { // Trigger conversion to fast object elements at length-3. set(array_1, i, 'object'); set(array_2, i, 'object'); - assertTrue(%HasFastObjectElements(array_1)); - assertTrue(%HasFastObjectElements(array_2)); + assertTrue(%HasFastElements(array_1)); + assertTrue(%HasFastElements(array_2)); } else if (i != length - 7) { // Set the element to an integer but leave a hole at length-7. set(array_1, i, 2*i+1); diff --git a/deps/v8/test/mjsunit/error-constructors.js b/deps/v8/test/mjsunit/error-constructors.js index 107164df5..966a1629d 100644 --- a/deps/v8/test/mjsunit/error-constructors.js +++ b/deps/v8/test/mjsunit/error-constructors.js @@ -25,7 +25,39 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// Flags: --allow-natives-syntax +var e = new Error(); +assertFalse(e.hasOwnProperty('message')); +Error.prototype.toString = Object.prototype.toString; +assertEquals("[object Error]", Error.prototype.toString()); +assertEquals(Object.prototype, Error.prototype.__proto__); + +// Check that error construction does not call setters for the +// properties on error objects in prototypes. +function fail() { assertTrue(false); }; +ReferenceError.prototype.__defineSetter__('stack', fail); +ReferenceError.prototype.__defineSetter__('message', fail); +ReferenceError.prototype.__defineSetter__('type', fail); +ReferenceError.prototype.__defineSetter__('arguments', fail); +var e0 = new ReferenceError(); +var e1 = new ReferenceError('123'); +assertTrue(e1.hasOwnProperty('message')); +assertTrue(e0.hasOwnProperty('stack')); +assertTrue(e1.hasOwnProperty('stack')); +assertTrue(e0.hasOwnProperty('type')); +assertTrue(e1.hasOwnProperty('type')); +assertTrue(e0.hasOwnProperty('arguments')); +assertTrue(e1.hasOwnProperty('arguments')); + +// Check that the name property on error prototypes is read-only and +// dont-delete. This is not specified, but allowing overwriting the +// name property with a getter can leaks error objects from different +// script tags in the same context in a browser setting. We therefore +// disallow changes to the name property on error objects. +assertEquals("ReferenceError", ReferenceError.prototype.name); +delete ReferenceError.prototype.name; +assertEquals("ReferenceError", ReferenceError.prototype.name); +ReferenceError.prototype.name = "not a reference error"; +assertEquals("ReferenceError", ReferenceError.prototype.name); // Check that message and name are not enumerable on Error objects. var desc = Object.getOwnPropertyDescriptor(Error.prototype, 'name'); @@ -43,75 +75,8 @@ assertFalse(desc['enumerable']); desc = Object.getOwnPropertyDescriptor(e, 'stack'); assertFalse(desc['enumerable']); -var e = new Error(); -assertFalse(e.hasOwnProperty('message')); - // name is not tested above, but in addition we should have no enumerable // properties, so we simply assert that. for (var v in e) { assertUnreachable(); } - -// Check that error construction does not call setters for the -// properties on error objects in prototypes. -function fail() { assertUnreachable(); }; -ReferenceError.prototype.__defineSetter__('name', fail); -ReferenceError.prototype.__defineSetter__('message', fail); -ReferenceError.prototype.__defineSetter__('type', fail); -ReferenceError.prototype.__defineSetter__('arguments', fail); -ReferenceError.prototype.__defineSetter__('stack', fail); - -var e = new ReferenceError(); -assertTrue(e.hasOwnProperty('stack')); -assertTrue(e.hasOwnProperty('type')); -assertTrue(e.hasOwnProperty('arguments')); - -var e = new ReferenceError('123'); -assertTrue(e.hasOwnProperty('message')); -assertTrue(e.hasOwnProperty('stack')); -assertTrue(e.hasOwnProperty('type')); -assertTrue(e.hasOwnProperty('arguments')); - -var e = %MakeReferenceError("my_test_error", [0, 1]); -assertTrue(e.hasOwnProperty('stack')); -assertTrue(e.hasOwnProperty('type')); -assertTrue(e.hasOwnProperty('arguments')); -assertEquals("my_test_error", e.type) - -// Check that intercepting property access from toString is prevented for -// compiler errors. This is not specified, but allowing interception -// through a getter can leak error objects from different -// script tags in the same context in a browser setting. -var errors = [SyntaxError, ReferenceError, TypeError]; -for (var i in errors) { - var name = errors[i].prototype.toString(); - // Monkey-patch prototype. - var props = ["name", "message", "type", "arguments", "stack"]; - for (var j in props) { - errors[i].prototype.__defineGetter__(props[j], fail); - } - // String conversion should not invoke monkey-patched getters on prototype. - var e = new errors[i]; - assertEquals(name, e.toString()); - // Custom getters in actual objects are welcome. - e.__defineGetter__("name", function() { return "mine"; }); - assertEquals("mine", e.toString()); -} - -// Monkey-patching non-static errors should still be observable. -function MyError() {} -MyError.prototype = new Error; -var errors = [Error, RangeError, EvalError, URIError, MyError]; -for (var i in errors) { - errors[i].prototype.__defineGetter__("name", function() { return "my"; }); - errors[i].prototype.__defineGetter__("message", function() { return "moo"; }); - var e = new errors[i]; - assertEquals("my: moo", e.toString()); -} - - -Error.prototype.toString = Object.prototype.toString; -assertEquals("[object Error]", Error.prototype.toString()); -assertEquals(Object.prototype, Error.prototype.__proto__); -var e = new Error("foo"); -assertEquals("[object Error]", e.toString()); diff --git a/deps/v8/test/mjsunit/mjsunit.status b/deps/v8/test/mjsunit/mjsunit.status index ab5f2e3e7..a1b927097 100644 --- a/deps/v8/test/mjsunit/mjsunit.status +++ b/deps/v8/test/mjsunit/mjsunit.status @@ -64,7 +64,6 @@ regress/regress-524: (PASS || TIMEOUT), SKIP if $mode == debug # Stack manipulations in LiveEdit are buggy - see bug 915 debug-liveedit-check-stack: SKIP debug-liveedit-patch-positions-replace: SKIP -debug-liveedit-stack-padding: SKIP # Test Crankshaft compilation time. Expected to take too long in debug mode. regress/regress-1969: PASS, SKIP if $mode == debug diff --git a/deps/v8/test/mjsunit/packed-elements.js b/deps/v8/test/mjsunit/packed-elements.js deleted file mode 100644 index 7f333e56e..000000000 --- a/deps/v8/test/mjsunit/packed-elements.js +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright 2012 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: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following -// disclaimer in the documentation and/or other materials provided -// with the distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived -// from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Flags: --allow-natives-syntax --smi-only-arrays --packed-arrays - -var has_packed_elements = !%HasFastHoleyElements(Array()); - -function test1() { - var a = Array(8); - assertTrue(%HasFastSmiOrObjectElements(a)); - assertTrue(%HasFastHoleyElements(a)); -} - -function test2() { - var a = Array(); - assertTrue(%HasFastSmiOrObjectElements(a)); - assertFalse(%HasFastHoleyElements(a)); -} - -function test3() { - var a = Array(1,2,3,4,5,6,7); - assertTrue(%HasFastSmiOrObjectElements(a)); - assertFalse(%HasFastHoleyElements(a)); -} - -function test4() { - var a = [1, 2, 3, 4]; - assertTrue(%HasFastSmiElements(a)); - assertFalse(%HasFastHoleyElements(a)); - var b = [1, 2,, 4]; - assertTrue(%HasFastSmiElements(b)); - assertTrue(%HasFastHoleyElements(b)); -} - -function test5() { - var a = [1, 2, 3, 4.5]; - assertTrue(%HasFastDoubleElements(a)); - assertFalse(%HasFastHoleyElements(a)); - var b = [1,, 3.5, 4]; - assertTrue(%HasFastDoubleElements(b)); - assertTrue(%HasFastHoleyElements(b)); - var c = [1, 3.5,, 4]; - assertTrue(%HasFastDoubleElements(c)); - assertTrue(%HasFastHoleyElements(c)); -} - -function test6() { - var x = new Object(); - var a = [1, 2, 3.5, x]; - assertTrue(%HasFastObjectElements(a)); - assertFalse(%HasFastHoleyElements(a)); - assertEquals(1, a[0]); - assertEquals(2, a[1]); - assertEquals(3.5, a[2]); - assertEquals(x, a[3]); - var b = [1,, 3.5, x]; - assertTrue(%HasFastObjectElements(b)); - assertTrue(%HasFastHoleyElements(b)); - assertEquals(1, b[0]); - assertEquals(undefined, b[1]); - assertEquals(3.5, b[2]); - assertEquals(x, b[3]); - var c = [1, 3.5, x,,]; - assertTrue(%HasFastObjectElements(c)); - assertTrue(%HasFastHoleyElements(c)); - assertEquals(1, c[0]); - assertEquals(3.5, c[1]); - assertEquals(x, c[2]); - assertEquals(undefined, c[3]); -} - -function test_with_optimization(f) { - // Run tests in a loop to make sure that inlined Array() constructor runs out - // of new space memory and must fall back on runtime impl. - for (i = 0; i < 250000; ++i) f(); - %OptimizeFunctionOnNextCall(f); - for (i = 0; i < 250000; ++i) f(); // Make sure GC happens -} - -if (has_packed_elements) { - test_with_optimization(test1); - test_with_optimization(test2); - test_with_optimization(test3); - test_with_optimization(test4); - test_with_optimization(test5); - test_with_optimization(test6); -} - diff --git a/deps/v8/test/mjsunit/regexp-capture-3.js b/deps/v8/test/mjsunit/regexp-capture-3.js index 9bdd60059..b676f01c2 100644 --- a/deps/v8/test/mjsunit/regexp-capture-3.js +++ b/deps/v8/test/mjsunit/regexp-capture-3.js @@ -162,7 +162,6 @@ assertEquals("*foo * baz", a); // string we can test that the relevant node is removed by verifying that // there is no hang. function NoHang(re) { - print(re); "This is an ASCII string that could take forever".match(re); } @@ -216,3 +215,5 @@ regex10.exec(input0); var regex11 = /^(?:[^\u0000-\u0080]|[0-9a-z?,.!&\s#()])+$/i; regex11.exec(input0); +var regex12 = /u(\xf0{8}?\D*?|( ? !)$h??(|)*?(||)+?\6((?:\W\B|--\d-*-|)?$){0, }?|^Y( ? !1)\d+)+a/; +regex12.exec(""); diff --git a/deps/v8/test/mjsunit/regexp-capture.js b/deps/v8/test/mjsunit/regexp-capture.js index 8aae71795..307309482 100755 --- a/deps/v8/test/mjsunit/regexp-capture.js +++ b/deps/v8/test/mjsunit/regexp-capture.js @@ -56,3 +56,5 @@ assertEquals(["bbc", "b"], /^(b+|a){1,2}?bc/.exec("bbc")); assertEquals(["bbaa", "a", "", "a"], /((\3|b)\2(a)){2,}/.exec("bbaababbabaaaaabbaaaabba")); +// From crbug.com/128821 - don't hang: +"".match(/((a|i|A|I|u|o|U|O)(s|c|b|c|d|f|g|h|j|k|l|m|n|p|q|r|s|t|v|w|x|y|z|B|C|D|F|G|H|J|K|L|M|N|P|Q|R|S|T|V|W|X|Y|Z)*) de\/da([.,!?\s]|$)/); diff --git a/deps/v8/test/mjsunit/regexp-global.js b/deps/v8/test/mjsunit/regexp-global.js deleted file mode 100644 index 12f857859..000000000 --- a/deps/v8/test/mjsunit/regexp-global.js +++ /dev/null @@ -1,132 +0,0 @@ -// Copyright 2012 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: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following -// disclaimer in the documentation and/or other materials provided -// with the distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived -// from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (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 an optional capture is cleared between two matches. -var str = "ABX X"; -str = str.replace(/(\w)?X/g, function(match, capture) { - assertTrue(match.indexOf(capture) >= 0 || - capture === undefined); - return capture ? capture.toLowerCase() : "-"; - }); -assertEquals("Ab -", str); - -// Test zero-length matches. -str = "Als Gregor Samsa eines Morgens"; -str = str.replace(/\b/g, function(match, capture) { - return "/"; - }); -assertEquals("/Als/ /Gregor/ /Samsa/ /eines/ /Morgens/", str); - -// Test zero-length matches that have non-zero-length sub-captures. -str = "It was a pleasure to burn."; -str = str.replace(/(?=(\w+))\b/g, function(match, capture) { - return capture.length; - }); -assertEquals("2It 3was 1a 8pleasure 2to 4burn.", str); - -// Test multiple captures. -str = "Try not. Do, or do not. There is no try."; -str = str.replace(/(not?)|(do)|(try)/gi, - function(match, c1, c2, c3) { - assertTrue((c1 === undefined && c2 === undefined) || - (c2 === undefined && c3 === undefined) || - (c1 === undefined && c3 === undefined)); - if (c1) return "-"; - if (c2) return "+"; - if (c3) return "=" - }); -assertEquals("= -. +, or + -. There is - =.", str); - -// Test multiple alternate captures. -str = "FOUR LEGS GOOD, TWO LEGS BAD!"; -str = str.replace(/(FOUR|TWO) LEGS (GOOD|BAD)/g, - function(match, num_legs, likeability) { - assertTrue(num_legs !== undefined); - assertTrue(likeability !== undefined); - if (num_legs == "FOUR") assertTrue(likeability == "GOOD"); - if (num_legs == "TWO") assertTrue(likeability == "BAD"); - return match.length - 10; - }); -assertEquals("4, 2!", str); - - -// The same tests with UC16. - -//Test that an optional capture is cleared between two matches. -str = "AB\u1234 \u1234"; -str = str.replace(/(\w)?\u1234/g, - function(match, capture) { - assertTrue(match.indexOf(capture) >= 0 || - capture === undefined); - return capture ? capture.toLowerCase() : "-"; - }); -assertEquals("Ab -", str); - -// Test zero-length matches. -str = "Als \u2623\u2642 eines Morgens"; -str = str.replace(/\b/g, function(match, capture) { - return "/"; - }); -assertEquals("/Als/ \u2623\u2642 /eines/ /Morgens/", str); - -// Test zero-length matches that have non-zero-length sub-captures. -str = "It was a pleasure to \u70e7."; -str = str.replace(/(?=(\w+))\b/g, function(match, capture) { - return capture.length; - }); -assertEquals("2It 3was 1a 8pleasure 2to \u70e7.", str); - -// Test multiple captures. -str = "Try not. D\u26aa, or d\u26aa not. There is no try."; -str = str.replace(/(not?)|(d\u26aa)|(try)/gi, - function(match, c1, c2, c3) { - assertTrue((c1 === undefined && c2 === undefined) || - (c2 === undefined && c3 === undefined) || - (c1 === undefined && c3 === undefined)); - if (c1) return "-"; - if (c2) return "+"; - if (c3) return "=" - }); -assertEquals("= -. +, or + -. There is - =.", str); - -// Test multiple alternate captures. -str = "FOUR \u817f GOOD, TWO \u817f BAD!"; -str = str.replace(/(FOUR|TWO) \u817f (GOOD|BAD)/g, - function(match, num_legs, likeability) { - assertTrue(num_legs !== undefined); - assertTrue(likeability !== undefined); - if (num_legs == "FOUR") assertTrue(likeability == "GOOD"); - if (num_legs == "TWO") assertTrue(likeability == "BAD"); - return match.length - 7; - }); -assertEquals("4, 2!", str); - -// Test capture that is a real substring. -var str = "Beasts of England, beasts of Ireland"; -str = str.replace(/(.*)/g, function(match) { return '~'; }); -assertEquals("~~", str); diff --git a/deps/v8/test/mjsunit/regexp.js b/deps/v8/test/mjsunit/regexp.js index c2d92823b..ec82c96e0 100644 --- a/deps/v8/test/mjsunit/regexp.js +++ b/deps/v8/test/mjsunit/regexp.js @@ -705,14 +705,3 @@ assertThrows("RegExp('(?!*)')"); // Test trimmed regular expression for RegExp.test(). assertTrue(/.*abc/.test("abc")); assertFalse(/.*\d+/.test("q")); - -// Test that RegExp.prototype.toString() throws TypeError for -// incompatible receivers (ES5 section 15.10.6 and 15.10.6.4). -assertThrows("RegExp.prototype.toString.call(null)", TypeError); -assertThrows("RegExp.prototype.toString.call(0)", TypeError); -assertThrows("RegExp.prototype.toString.call('')", TypeError); -assertThrows("RegExp.prototype.toString.call(false)", TypeError); -assertThrows("RegExp.prototype.toString.call(true)", TypeError); -assertThrows("RegExp.prototype.toString.call([])", TypeError); -assertThrows("RegExp.prototype.toString.call({})", TypeError); -assertThrows("RegExp.prototype.toString.call(function(){})", TypeError); diff --git a/deps/v8/test/mjsunit/regress/regress-117409.js b/deps/v8/test/mjsunit/regress/regress-117409.js index 98aab5ac2..9222191ae 100644 --- a/deps/v8/test/mjsunit/regress/regress-117409.js +++ b/deps/v8/test/mjsunit/regress/regress-117409.js @@ -36,7 +36,7 @@ var literal = [1.2]; KeyedStoreIC(literal); KeyedStoreIC(literal); -// Truncate array to 0 elements, at which point backing store will be replaced +// Trruncate array to 0 elements, at which point backing store will be replaced // with empty fixed array. literal.length = 0; diff --git a/deps/v8/test/mjsunit/regress/regress-128146.js b/deps/v8/test/mjsunit/regress/regress-128146.js deleted file mode 100644 index 730dd9106..000000000 --- a/deps/v8/test/mjsunit/regress/regress-128146.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2012 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: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following -// disclaimer in the documentation and/or other materials provided -// with the distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived -// from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Define accessor properties, resulting in an AccessorPair with 2 transitions. -Object.defineProperty({},"foo",{set:function(){},configurable:false}); -Object.defineProperty({},"foo",{get:function(){},configurable:false}); - -// Define a data property under the same name. -Object.defineProperty({},"foo",{}); diff --git a/deps/v8/test/mjsunit/regress/regress-1639-2.js b/deps/v8/test/mjsunit/regress/regress-1639-2.js index 01f0dc204..c439dd8ff 100644 --- a/deps/v8/test/mjsunit/regress/regress-1639-2.js +++ b/deps/v8/test/mjsunit/regress/regress-1639-2.js @@ -1,4 +1,4 @@ -// Copyright 2012 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: @@ -28,7 +28,6 @@ // Flags: --expose-debug-as debug // Get the Debug object exposed from the debug context global object. Debug = debug.Debug -var exception = false; function sendCommand(state, cmd) { // Get the debug command processor in paused state. @@ -80,7 +79,6 @@ function listener(event, exec_state, event_data, data) { } } catch (e) { print(e); - exception = true; } } @@ -93,4 +91,3 @@ function a() { // Set a break point and call to invoke the debug event listener. Debug.setBreakPoint(a, 0, 0); a(); -assertFalse(exception); diff --git a/deps/v8/test/mjsunit/regress/regress-1639.js b/deps/v8/test/mjsunit/regress/regress-1639.js index 47cdbc43c..ed68c97df 100644 --- a/deps/v8/test/mjsunit/regress/regress-1639.js +++ b/deps/v8/test/mjsunit/regress/regress-1639.js @@ -1,4 +1,4 @@ -// Copyright 2012 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: @@ -29,7 +29,6 @@ // Get the Debug object exposed from the debug context global object. Debug = debug.Debug var breaks = 0; -var exception = false; function sendCommand(state, cmd) { // Get the debug command processor in paused state. @@ -48,18 +47,15 @@ function listener(event, exec_state, event_data, data) { "should not break on unexpected lines") assertEquals('BREAK ' + breaks, line.substr(-7)); breaks++; - if (breaks < 4) { - sendCommand(exec_state, { - seq: 0, - type: "request", - command: "continue", - arguments: { stepaction: "next" } - }); - } + sendCommand(exec_state, { + seq: 0, + type: "request", + command: "continue", + arguments: { stepaction: "next" } + }); } } catch (e) { print(e); - exception = true; } } @@ -86,6 +82,4 @@ function c() { // Set a break point and call to invoke the debug event listener. Debug.setBreakPoint(b, 0, 0); a(b); -a(); // BREAK 3 - -assertFalse(exception); +// BREAK 3 diff --git a/deps/v8/test/mjsunit/regress/regress-1849.js b/deps/v8/test/mjsunit/regress/regress-1849.js index 5b8fc50f3..176f918b9 100644 --- a/deps/v8/test/mjsunit/regress/regress-1849.js +++ b/deps/v8/test/mjsunit/regress/regress-1849.js @@ -1,4 +1,4 @@ -// Copyright 2012 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,7 +25,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// See: http://code.google.com/p/v8/issues/detail?id=1849 +// See: http://code.google.com/p/v8/issues/detail?id=1878 // Flags: --allow-natives-syntax @@ -36,4 +36,4 @@ for (var i = 0; i < count; i++) { arr[i] = 0; } assertFalse(%HasFastDoubleElements(arr)); -assertTrue(%HasFastSmiElements(arr)); +assertTrue(%HasFastSmiOnlyElements(arr)); diff --git a/deps/v8/test/mjsunit/regress/regress-1878.js b/deps/v8/test/mjsunit/regress/regress-1878.js index fbc47bdd1..a1648b121 100644 --- a/deps/v8/test/mjsunit/regress/regress-1878.js +++ b/deps/v8/test/mjsunit/regress/regress-1878.js @@ -34,11 +34,11 @@ var a = Array(); for (var i = 0; i < 1000; i++) { var ai = natives.InternalArray(10000); assertFalse(%HaveSameMap(ai, a)); - assertTrue(%HasFastObjectElements(ai)); + assertTrue(%HasFastElements(ai)); } for (var i = 0; i < 1000; i++) { var ai = new natives.InternalArray(10000); assertFalse(%HaveSameMap(ai, a)); - assertTrue(%HasFastObjectElements(ai)); + assertTrue(%HasFastElements(ai)); } diff --git a/deps/v8/test/mjsunit/regress/regress-2153.js b/deps/v8/test/mjsunit/regress/regress-2153.js deleted file mode 100644 index 3170042be..000000000 --- a/deps/v8/test/mjsunit/regress/regress-2153.js +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2012 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: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following -// disclaimer in the documentation and/or other materials provided -// with the distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived -// from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -var o = {}; -o.__defineGetter__('foo', function () { return null; }); -var o = {}; -o.foo = 42; -assertEquals(42, o.foo); diff --git a/deps/v8/test/mjsunit/regress/regress-crbug-122271.js b/deps/v8/test/mjsunit/regress/regress-crbug-122271.js index 8ae91e857..3a99a7fa5 100644 --- a/deps/v8/test/mjsunit/regress/regress-crbug-122271.js +++ b/deps/v8/test/mjsunit/regress/regress-crbug-122271.js @@ -39,11 +39,11 @@ function foo(array) { array.foo = "bar"; } -assertTrue(%HasFastSmiElements(a)); -assertTrue(%HasFastObjectElements(b)); +assertTrue(%HasFastSmiOnlyElements(a)); +assertTrue(%HasFastElements(b)); foo(a); foo(b); -assertTrue(%HasFastSmiElements(a)); -assertTrue(%HasFastObjectElements(b)); +assertTrue(%HasFastSmiOnlyElements(a)); +assertTrue(%HasFastElements(b)); diff --git a/deps/v8/test/mjsunit/regress/regress-smi-only-concat.js b/deps/v8/test/mjsunit/regress/regress-smi-only-concat.js index 55ca2996f..a9a6d89b0 100644 --- a/deps/v8/test/mjsunit/regress/regress-smi-only-concat.js +++ b/deps/v8/test/mjsunit/regress/regress-smi-only-concat.js @@ -33,5 +33,5 @@ var fast_array = ['a', 'b']; var array = fast_array.concat(fast_array); -assertTrue(%HasFastObjectElements(fast_array)); -assertTrue(%HasFastObjectElements(array)); +assertTrue(%HasFastElements(fast_array)); +assertTrue(%HasFastElements(array));
\ No newline at end of file diff --git a/deps/v8/test/mjsunit/regress/regress-transcendental.js b/deps/v8/test/mjsunit/regress/regress-transcendental.js deleted file mode 100644 index b5dbcb48a..000000000 --- a/deps/v8/test/mjsunit/regress/regress-transcendental.js +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2012 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: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following -// disclaimer in the documentation and/or other materials provided -// with the distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived -// from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Flags: --expose-gc - -// Test whether the runtime implementation and generated code of -// sine and tangens return the same results. - -function test(f, x, name) { - // Reset transcendental cache. - gc(); - // Initializing cache leads to a runtime call. - var runtime_result = f(x); - // Flush transcendental cache entries and optimize f. - for (var i = 0; i < 100000; i++) f(i); - // Calculate using generated code. - var gencode_result = f(x); - print(name + " runtime function: " + runtime_result); - print(name + " generated code : " + gencode_result); - assertEquals(gencode_result, runtime_result); -} - -test(Math.tan, -1.57079632679489660000, "Math.tan"); -test(Math.sin, 6.283185307179586, "Math.sin"); - diff --git a/deps/v8/test/mjsunit/stack-traces.js b/deps/v8/test/mjsunit/stack-traces.js index 438eec979..536e71bbb 100644 --- a/deps/v8/test/mjsunit/stack-traces.js +++ b/deps/v8/test/mjsunit/stack-traces.js @@ -111,18 +111,6 @@ function testStrippedCustomError() { throw new CustomError("hep-hey", CustomError); } -MyObj = function() { FAIL; } - -MyObjCreator = function() {} - -MyObjCreator.prototype.Create = function() { - return new MyObj(); -} - -function testClassNames() { - (new MyObjCreator).Create(); -} - // Utility function for testing that the expected strings occur // in the stack trace produced when running the given function. function testTrace(name, fun, expected, unexpected) { @@ -266,8 +254,6 @@ testTrace("testDefaultCustomError", testDefaultCustomError, ["collectStackTrace"]); testTrace("testStrippedCustomError", testStrippedCustomError, ["hep-hey"], ["new CustomError", "collectStackTrace"]); -testTrace("testClassNames", testClassNames, - ["new MyObj", "MyObjCreator.Create"], ["as Create"]); testCallerCensorship(); testUnintendedCallerCensorship(); testErrorsDuringFormatting(); diff --git a/deps/v8/test/mjsunit/unbox-double-arrays.js b/deps/v8/test/mjsunit/unbox-double-arrays.js index ac039930c..fd7db28a0 100644 --- a/deps/v8/test/mjsunit/unbox-double-arrays.js +++ b/deps/v8/test/mjsunit/unbox-double-arrays.js @@ -1,4 +1,4 @@ -// Copyright 2012 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: @@ -278,8 +278,7 @@ function testOneArrayType(allocator) { expected_array_value(7)); %DeoptimizeFunction(test_various_loads6); - %ClearFunctionTypeFeedback(test_various_stores); - %ClearFunctionTypeFeedback(test_various_loads7); + gc(); // Test stores for non-NaN. var large_array = new allocator(large_array_size); @@ -377,7 +376,7 @@ delete large_array2[5]; // Convert back to fast elements and make sure the contents of the array are // unchanged. large_array2[25] = new Object(); -assertTrue(%HasFastObjectElements(large_array2)); +assertTrue(%HasFastElements(large_array2)); for (var i= 0; i < approx_dict_to_elements_threshold; i += 500 ) { if (i != 25 && i != 5) { assertEquals(expected_array_value(i), large_array2[i]); diff --git a/deps/v8/test/test262/testcfg.py b/deps/v8/test/test262/testcfg.py index 07f760c8d..2c9bf06f1 100644 --- a/deps/v8/test/test262/testcfg.py +++ b/deps/v8/test/test262/testcfg.py @@ -31,7 +31,6 @@ import os from os.path import join, exists import urllib import hashlib -import sys import tarfile @@ -121,11 +120,7 @@ class Test262TestConfiguration(test.TestConfiguration): os.remove(archive_name) raise Exception("Hash mismatch of test data file") archive = tarfile.open(archive_name, 'r:bz2') - if sys.platform in ('win32', 'cygwin'): - # Magic incantation to allow longer path names on Windows. - archive.extractall(u'\\\\?\\%s' % self.root) - else: - archive.extractall(self.root) + archive.extractall(join(self.root)) os.rename(join(self.root, 'test262-%s' % revision), directory_name) def GetBuildRequirements(self): |