libv8 3.10.8.0 → 3.11.8.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +10 -3
- data/ext/libv8/compiler.rb +46 -0
- data/ext/libv8/extconf.rb +5 -1
- data/ext/libv8/make.rb +13 -0
- data/lib/libv8/version.rb +1 -1
- data/patches/add-freebsd9-and-freebsd10-to-gyp-GetFlavor.patch +11 -0
- data/patches/src_platform-freebsd.cc.patch +10 -0
- data/vendor/v8/ChangeLog +124 -0
- data/vendor/v8/DEPS +27 -0
- data/vendor/v8/Makefile +7 -0
- data/vendor/v8/SConstruct +15 -2
- data/vendor/v8/build/common.gypi +129 -157
- data/vendor/v8/build/gyp_v8 +11 -25
- data/vendor/v8/build/standalone.gypi +9 -3
- data/vendor/v8/include/v8.h +5 -3
- data/vendor/v8/src/SConscript +1 -0
- data/vendor/v8/src/api.cc +4 -33
- data/vendor/v8/src/api.h +2 -2
- data/vendor/v8/src/arm/builtins-arm.cc +5 -4
- data/vendor/v8/src/arm/code-stubs-arm.cc +21 -14
- data/vendor/v8/src/arm/codegen-arm.cc +2 -2
- data/vendor/v8/src/arm/debug-arm.cc +3 -1
- data/vendor/v8/src/arm/full-codegen-arm.cc +3 -102
- data/vendor/v8/src/arm/ic-arm.cc +30 -33
- data/vendor/v8/src/arm/lithium-arm.cc +20 -7
- data/vendor/v8/src/arm/lithium-arm.h +10 -4
- data/vendor/v8/src/arm/lithium-codegen-arm.cc +106 -60
- data/vendor/v8/src/arm/macro-assembler-arm.cc +49 -39
- data/vendor/v8/src/arm/macro-assembler-arm.h +5 -4
- data/vendor/v8/src/arm/regexp-macro-assembler-arm.cc +115 -55
- data/vendor/v8/src/arm/regexp-macro-assembler-arm.h +7 -6
- data/vendor/v8/src/arm/simulator-arm.h +6 -6
- data/vendor/v8/src/arm/stub-cache-arm.cc +64 -19
- data/vendor/v8/src/array.js +7 -3
- data/vendor/v8/src/ast.cc +11 -6
- data/vendor/v8/src/bootstrapper.cc +9 -11
- data/vendor/v8/src/builtins.cc +61 -31
- data/vendor/v8/src/code-stubs.cc +23 -9
- data/vendor/v8/src/code-stubs.h +1 -0
- data/vendor/v8/src/codegen.h +3 -3
- data/vendor/v8/src/compiler.cc +1 -1
- data/vendor/v8/src/contexts.h +2 -18
- data/vendor/v8/src/d8.cc +94 -93
- data/vendor/v8/src/d8.h +1 -1
- data/vendor/v8/src/debug-agent.cc +3 -3
- data/vendor/v8/src/debug.cc +41 -1
- data/vendor/v8/src/debug.h +50 -0
- data/vendor/v8/src/elements-kind.cc +134 -0
- data/vendor/v8/src/elements-kind.h +210 -0
- data/vendor/v8/src/elements.cc +356 -190
- data/vendor/v8/src/elements.h +36 -28
- data/vendor/v8/src/factory.cc +44 -4
- data/vendor/v8/src/factory.h +11 -7
- data/vendor/v8/src/flag-definitions.h +3 -0
- data/vendor/v8/src/frames.h +3 -0
- data/vendor/v8/src/full-codegen.cc +2 -1
- data/vendor/v8/src/func-name-inferrer.h +2 -0
- data/vendor/v8/src/globals.h +3 -0
- data/vendor/v8/src/heap-inl.h +16 -4
- data/vendor/v8/src/heap.cc +38 -32
- data/vendor/v8/src/heap.h +3 -17
- data/vendor/v8/src/hydrogen-instructions.cc +28 -5
- data/vendor/v8/src/hydrogen-instructions.h +142 -44
- data/vendor/v8/src/hydrogen.cc +160 -55
- data/vendor/v8/src/hydrogen.h +2 -0
- data/vendor/v8/src/ia32/assembler-ia32.h +3 -0
- data/vendor/v8/src/ia32/builtins-ia32.cc +5 -4
- data/vendor/v8/src/ia32/code-stubs-ia32.cc +22 -16
- data/vendor/v8/src/ia32/codegen-ia32.cc +2 -2
- data/vendor/v8/src/ia32/debug-ia32.cc +29 -2
- data/vendor/v8/src/ia32/full-codegen-ia32.cc +8 -101
- data/vendor/v8/src/ia32/ic-ia32.cc +23 -19
- data/vendor/v8/src/ia32/lithium-codegen-ia32.cc +126 -80
- data/vendor/v8/src/ia32/lithium-codegen-ia32.h +2 -1
- data/vendor/v8/src/ia32/lithium-ia32.cc +15 -9
- data/vendor/v8/src/ia32/lithium-ia32.h +14 -6
- data/vendor/v8/src/ia32/macro-assembler-ia32.cc +50 -40
- data/vendor/v8/src/ia32/macro-assembler-ia32.h +5 -4
- data/vendor/v8/src/ia32/regexp-macro-assembler-ia32.cc +113 -43
- data/vendor/v8/src/ia32/regexp-macro-assembler-ia32.h +9 -4
- data/vendor/v8/src/ia32/simulator-ia32.h +4 -4
- data/vendor/v8/src/ia32/stub-cache-ia32.cc +52 -14
- data/vendor/v8/src/ic.cc +77 -20
- data/vendor/v8/src/ic.h +18 -2
- data/vendor/v8/src/incremental-marking-inl.h +21 -5
- data/vendor/v8/src/incremental-marking.cc +35 -8
- data/vendor/v8/src/incremental-marking.h +12 -3
- data/vendor/v8/src/isolate.cc +12 -2
- data/vendor/v8/src/isolate.h +1 -1
- data/vendor/v8/src/jsregexp.cc +66 -26
- data/vendor/v8/src/jsregexp.h +60 -31
- data/vendor/v8/src/list-inl.h +8 -0
- data/vendor/v8/src/list.h +3 -0
- data/vendor/v8/src/lithium.cc +5 -2
- data/vendor/v8/src/liveedit.cc +57 -5
- data/vendor/v8/src/mark-compact-inl.h +17 -11
- data/vendor/v8/src/mark-compact.cc +100 -143
- data/vendor/v8/src/mark-compact.h +44 -20
- data/vendor/v8/src/messages.js +131 -99
- data/vendor/v8/src/mips/builtins-mips.cc +5 -4
- data/vendor/v8/src/mips/code-stubs-mips.cc +23 -15
- data/vendor/v8/src/mips/codegen-mips.cc +2 -2
- data/vendor/v8/src/mips/debug-mips.cc +3 -1
- data/vendor/v8/src/mips/full-codegen-mips.cc +4 -102
- data/vendor/v8/src/mips/ic-mips.cc +34 -36
- data/vendor/v8/src/mips/lithium-codegen-mips.cc +116 -68
- data/vendor/v8/src/mips/lithium-mips.cc +20 -7
- data/vendor/v8/src/mips/lithium-mips.h +11 -4
- data/vendor/v8/src/mips/macro-assembler-mips.cc +50 -39
- data/vendor/v8/src/mips/macro-assembler-mips.h +5 -4
- data/vendor/v8/src/mips/regexp-macro-assembler-mips.cc +110 -50
- data/vendor/v8/src/mips/regexp-macro-assembler-mips.h +6 -5
- data/vendor/v8/src/mips/simulator-mips.h +5 -5
- data/vendor/v8/src/mips/stub-cache-mips.cc +66 -20
- data/vendor/v8/src/mksnapshot.cc +5 -1
- data/vendor/v8/src/objects-debug.cc +103 -6
- data/vendor/v8/src/objects-inl.h +215 -116
- data/vendor/v8/src/objects-printer.cc +13 -8
- data/vendor/v8/src/objects.cc +608 -331
- data/vendor/v8/src/objects.h +129 -94
- data/vendor/v8/src/parser.cc +16 -4
- data/vendor/v8/src/platform-freebsd.cc +1 -0
- data/vendor/v8/src/platform-linux.cc +9 -30
- data/vendor/v8/src/platform-posix.cc +28 -7
- data/vendor/v8/src/platform-win32.cc +15 -3
- data/vendor/v8/src/platform.h +2 -1
- data/vendor/v8/src/profile-generator-inl.h +25 -2
- data/vendor/v8/src/profile-generator.cc +300 -822
- data/vendor/v8/src/profile-generator.h +97 -214
- data/vendor/v8/src/regexp-macro-assembler-irregexp.cc +2 -1
- data/vendor/v8/src/regexp-macro-assembler-irregexp.h +2 -2
- data/vendor/v8/src/regexp-macro-assembler-tracer.cc +6 -5
- data/vendor/v8/src/regexp-macro-assembler-tracer.h +1 -1
- data/vendor/v8/src/regexp-macro-assembler.cc +7 -3
- data/vendor/v8/src/regexp-macro-assembler.h +10 -2
- data/vendor/v8/src/regexp.js +6 -0
- data/vendor/v8/src/runtime.cc +265 -212
- data/vendor/v8/src/runtime.h +6 -5
- data/vendor/v8/src/scopes.cc +20 -0
- data/vendor/v8/src/scopes.h +6 -3
- data/vendor/v8/src/spaces.cc +0 -2
- data/vendor/v8/src/string-stream.cc +2 -2
- data/vendor/v8/src/v8-counters.h +0 -2
- data/vendor/v8/src/v8natives.js +2 -2
- data/vendor/v8/src/v8utils.h +6 -3
- data/vendor/v8/src/version.cc +1 -1
- data/vendor/v8/src/x64/assembler-x64.h +2 -1
- data/vendor/v8/src/x64/builtins-x64.cc +5 -4
- data/vendor/v8/src/x64/code-stubs-x64.cc +25 -16
- data/vendor/v8/src/x64/codegen-x64.cc +2 -2
- data/vendor/v8/src/x64/debug-x64.cc +14 -1
- data/vendor/v8/src/x64/disasm-x64.cc +1 -1
- data/vendor/v8/src/x64/full-codegen-x64.cc +10 -106
- data/vendor/v8/src/x64/ic-x64.cc +20 -16
- data/vendor/v8/src/x64/lithium-codegen-x64.cc +156 -79
- data/vendor/v8/src/x64/lithium-codegen-x64.h +2 -1
- data/vendor/v8/src/x64/lithium-x64.cc +18 -8
- data/vendor/v8/src/x64/lithium-x64.h +7 -2
- data/vendor/v8/src/x64/macro-assembler-x64.cc +50 -40
- data/vendor/v8/src/x64/macro-assembler-x64.h +5 -4
- data/vendor/v8/src/x64/regexp-macro-assembler-x64.cc +122 -51
- data/vendor/v8/src/x64/regexp-macro-assembler-x64.h +17 -8
- data/vendor/v8/src/x64/simulator-x64.h +4 -4
- data/vendor/v8/src/x64/stub-cache-x64.cc +55 -17
- data/vendor/v8/test/cctest/cctest.status +1 -0
- data/vendor/v8/test/cctest/test-api.cc +24 -0
- data/vendor/v8/test/cctest/test-func-name-inference.cc +38 -0
- data/vendor/v8/test/cctest/test-heap-profiler.cc +21 -77
- data/vendor/v8/test/cctest/test-heap.cc +164 -3
- data/vendor/v8/test/cctest/test-list.cc +12 -0
- data/vendor/v8/test/cctest/test-mark-compact.cc +5 -5
- data/vendor/v8/test/cctest/test-regexp.cc +14 -8
- data/vendor/v8/test/cctest/testcfg.py +2 -0
- data/vendor/v8/test/mjsunit/accessor-map-sharing.js +176 -0
- data/vendor/v8/test/mjsunit/array-construct-transition.js +3 -3
- data/vendor/v8/test/mjsunit/array-literal-transitions.js +10 -10
- data/vendor/v8/test/mjsunit/big-array-literal.js +3 -0
- data/vendor/v8/test/mjsunit/compiler/inline-construct.js +4 -2
- data/vendor/v8/test/mjsunit/debug-liveedit-stack-padding.js +88 -0
- data/vendor/v8/test/mjsunit/elements-kind.js +4 -4
- data/vendor/v8/test/mjsunit/elements-transition-hoisting.js +2 -2
- data/vendor/v8/test/mjsunit/elements-transition.js +5 -5
- data/vendor/v8/test/mjsunit/error-constructors.js +68 -33
- data/vendor/v8/test/mjsunit/harmony/proxies.js +14 -6
- data/vendor/v8/test/mjsunit/mjsunit.status +1 -0
- data/vendor/v8/test/mjsunit/packed-elements.js +112 -0
- data/vendor/v8/test/mjsunit/regexp-capture-3.js +6 -0
- data/vendor/v8/test/mjsunit/regexp-global.js +132 -0
- data/vendor/v8/test/mjsunit/regexp.js +11 -0
- data/vendor/v8/test/mjsunit/regress/regress-117409.js +52 -0
- data/vendor/v8/test/mjsunit/regress/regress-126412.js +33 -0
- data/vendor/v8/test/mjsunit/regress/regress-128018.js +35 -0
- data/vendor/v8/test/mjsunit/regress/regress-128146.js +33 -0
- data/vendor/v8/test/mjsunit/regress/regress-1639-2.js +4 -1
- data/vendor/v8/test/mjsunit/regress/regress-1639.js +14 -8
- data/vendor/v8/test/mjsunit/regress/regress-1849.js +3 -3
- data/vendor/v8/test/mjsunit/regress/regress-1878.js +2 -2
- data/vendor/v8/test/mjsunit/regress/regress-2071.js +79 -0
- data/vendor/v8/test/mjsunit/regress/regress-2153.js +32 -0
- data/vendor/v8/test/mjsunit/regress/regress-crbug-122271.js +4 -4
- data/vendor/v8/test/mjsunit/regress/regress-crbug-126414.js +32 -0
- data/vendor/v8/test/mjsunit/regress/regress-smi-only-concat.js +2 -2
- data/vendor/v8/test/mjsunit/regress/regress-transcendental.js +49 -0
- data/vendor/v8/test/mjsunit/stack-traces.js +14 -0
- data/vendor/v8/test/mjsunit/unbox-double-arrays.js +4 -3
- data/vendor/v8/test/test262/testcfg.py +6 -1
- data/vendor/v8/tools/check-static-initializers.sh +11 -3
- data/vendor/v8/tools/fuzz-harness.sh +92 -0
- data/vendor/v8/tools/grokdump.py +658 -67
- data/vendor/v8/tools/gyp/v8.gyp +21 -39
- data/vendor/v8/tools/js2c.py +3 -3
- data/vendor/v8/tools/jsmin.py +2 -2
- data/vendor/v8/tools/presubmit.py +2 -1
- data/vendor/v8/tools/test-wrapper-gypbuild.py +25 -11
- metadata +624 -612
@@ -1,4 +1,4 @@
|
|
1
|
-
// Copyright
|
1
|
+
// Copyright 2012 the V8 project authors. All rights reserved.
|
2
2
|
// Redistribution and use in source and binary forms, with or without
|
3
3
|
// modification, are permitted provided that the following conditions are
|
4
4
|
// met:
|
@@ -29,6 +29,7 @@
|
|
29
29
|
// Get the Debug object exposed from the debug context global object.
|
30
30
|
Debug = debug.Debug
|
31
31
|
var breaks = 0;
|
32
|
+
var exception = false;
|
32
33
|
|
33
34
|
function sendCommand(state, cmd) {
|
34
35
|
// Get the debug command processor in paused state.
|
@@ -47,15 +48,18 @@ function listener(event, exec_state, event_data, data) {
|
|
47
48
|
"should not break on unexpected lines")
|
48
49
|
assertEquals('BREAK ' + breaks, line.substr(-7));
|
49
50
|
breaks++;
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
51
|
+
if (breaks < 4) {
|
52
|
+
sendCommand(exec_state, {
|
53
|
+
seq: 0,
|
54
|
+
type: "request",
|
55
|
+
command: "continue",
|
56
|
+
arguments: { stepaction: "next" }
|
57
|
+
});
|
58
|
+
}
|
56
59
|
}
|
57
60
|
} catch (e) {
|
58
61
|
print(e);
|
62
|
+
exception = true;
|
59
63
|
}
|
60
64
|
}
|
61
65
|
|
@@ -82,4 +86,6 @@ function c() {
|
|
82
86
|
// Set a break point and call to invoke the debug event listener.
|
83
87
|
Debug.setBreakPoint(b, 0, 0);
|
84
88
|
a(b);
|
85
|
-
// BREAK 3
|
89
|
+
a(); // BREAK 3
|
90
|
+
|
91
|
+
assertFalse(exception);
|
@@ -1,4 +1,4 @@
|
|
1
|
-
// Copyright
|
1
|
+
// Copyright 2012 the V8 project authors. All rights reserved.
|
2
2
|
// Redistribution and use in source and binary forms, with or without
|
3
3
|
// modification, are permitted provided that the following conditions are
|
4
4
|
// met:
|
@@ -25,7 +25,7 @@
|
|
25
25
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
26
26
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
27
27
|
|
28
|
-
// See: http://code.google.com/p/v8/issues/detail?id=
|
28
|
+
// See: http://code.google.com/p/v8/issues/detail?id=1849
|
29
29
|
|
30
30
|
// Flags: --allow-natives-syntax
|
31
31
|
|
@@ -36,4 +36,4 @@ for (var i = 0; i < count; i++) {
|
|
36
36
|
arr[i] = 0;
|
37
37
|
}
|
38
38
|
assertFalse(%HasFastDoubleElements(arr));
|
39
|
-
assertTrue(%
|
39
|
+
assertTrue(%HasFastSmiElements(arr));
|
@@ -34,11 +34,11 @@ var a = Array();
|
|
34
34
|
for (var i = 0; i < 1000; i++) {
|
35
35
|
var ai = natives.InternalArray(10000);
|
36
36
|
assertFalse(%HaveSameMap(ai, a));
|
37
|
-
assertTrue(%
|
37
|
+
assertTrue(%HasFastObjectElements(ai));
|
38
38
|
}
|
39
39
|
|
40
40
|
for (var i = 0; i < 1000; i++) {
|
41
41
|
var ai = new natives.InternalArray(10000);
|
42
42
|
assertFalse(%HaveSameMap(ai, a));
|
43
|
-
assertTrue(%
|
43
|
+
assertTrue(%HasFastObjectElements(ai));
|
44
44
|
}
|
@@ -0,0 +1,79 @@
|
|
1
|
+
// Copyright 2012 the V8 project authors. All rights reserved.
|
2
|
+
// Redistribution and use in source and binary forms, with or without
|
3
|
+
// modification, are permitted provided that the following conditions are
|
4
|
+
// met:
|
5
|
+
//
|
6
|
+
// * Redistributions of source code must retain the above copyright
|
7
|
+
// notice, this list of conditions and the following disclaimer.
|
8
|
+
// * Redistributions in binary form must reproduce the above
|
9
|
+
// copyright notice, this list of conditions and the following
|
10
|
+
// disclaimer in the documentation and/or other materials provided
|
11
|
+
// with the distribution.
|
12
|
+
// * Neither the name of Google Inc. nor the names of its
|
13
|
+
// contributors may be used to endorse or promote products derived
|
14
|
+
// from this software without specific prior written permission.
|
15
|
+
//
|
16
|
+
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
17
|
+
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
18
|
+
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
19
|
+
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
20
|
+
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
21
|
+
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
22
|
+
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
23
|
+
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
24
|
+
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
25
|
+
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
26
|
+
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
27
|
+
|
28
|
+
a = {};
|
29
|
+
|
30
|
+
a.b = 42;
|
31
|
+
|
32
|
+
with(a) {
|
33
|
+
a.f = (function f1() {
|
34
|
+
function f2() {
|
35
|
+
return b;
|
36
|
+
};
|
37
|
+
return f2;
|
38
|
+
})();
|
39
|
+
}
|
40
|
+
|
41
|
+
for(var i = 0; i < 10000; i++) {
|
42
|
+
assertEquals(42, a.f());
|
43
|
+
}
|
44
|
+
|
45
|
+
with(a) {
|
46
|
+
a.g = (function f1() {
|
47
|
+
function f2() {
|
48
|
+
function f3() {
|
49
|
+
return b;
|
50
|
+
}
|
51
|
+
return f3;
|
52
|
+
};
|
53
|
+
return f2();
|
54
|
+
})();
|
55
|
+
}
|
56
|
+
|
57
|
+
for(var i = 0; i < 10000; i++) {
|
58
|
+
assertEquals(42, a.g());
|
59
|
+
}
|
60
|
+
|
61
|
+
function outer() {
|
62
|
+
with(a) {
|
63
|
+
a.h = (function f1() {
|
64
|
+
function f2() {
|
65
|
+
function f3() {
|
66
|
+
return b;
|
67
|
+
}
|
68
|
+
return f3;
|
69
|
+
};
|
70
|
+
return f2();
|
71
|
+
})();
|
72
|
+
}
|
73
|
+
};
|
74
|
+
|
75
|
+
outer();
|
76
|
+
|
77
|
+
for(var i = 0; i < 10000; i++) {
|
78
|
+
assertEquals(42, a.h());
|
79
|
+
}
|
@@ -0,0 +1,32 @@
|
|
1
|
+
// Copyright 2012 the V8 project authors. All rights reserved.
|
2
|
+
// Redistribution and use in source and binary forms, with or without
|
3
|
+
// modification, are permitted provided that the following conditions are
|
4
|
+
// met:
|
5
|
+
//
|
6
|
+
// * Redistributions of source code must retain the above copyright
|
7
|
+
// notice, this list of conditions and the following disclaimer.
|
8
|
+
// * Redistributions in binary form must reproduce the above
|
9
|
+
// copyright notice, this list of conditions and the following
|
10
|
+
// disclaimer in the documentation and/or other materials provided
|
11
|
+
// with the distribution.
|
12
|
+
// * Neither the name of Google Inc. nor the names of its
|
13
|
+
// contributors may be used to endorse or promote products derived
|
14
|
+
// from this software without specific prior written permission.
|
15
|
+
//
|
16
|
+
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
17
|
+
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
18
|
+
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
19
|
+
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
20
|
+
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
21
|
+
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
22
|
+
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
23
|
+
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
24
|
+
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
25
|
+
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
26
|
+
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
27
|
+
|
28
|
+
var o = {};
|
29
|
+
o.__defineGetter__('foo', function () { return null; });
|
30
|
+
var o = {};
|
31
|
+
o.foo = 42;
|
32
|
+
assertEquals(42, o.foo);
|
@@ -39,11 +39,11 @@ function foo(array) {
|
|
39
39
|
array.foo = "bar";
|
40
40
|
}
|
41
41
|
|
42
|
-
assertTrue(%
|
43
|
-
assertTrue(%
|
42
|
+
assertTrue(%HasFastSmiElements(a));
|
43
|
+
assertTrue(%HasFastObjectElements(b));
|
44
44
|
|
45
45
|
foo(a);
|
46
46
|
foo(b);
|
47
47
|
|
48
|
-
assertTrue(%
|
49
|
-
assertTrue(%
|
48
|
+
assertTrue(%HasFastSmiElements(a));
|
49
|
+
assertTrue(%HasFastObjectElements(b));
|
@@ -0,0 +1,32 @@
|
|
1
|
+
// Copyright 2012 the V8 project authors. All rights reserved.
|
2
|
+
// Redistribution and use in source and binary forms, with or without
|
3
|
+
// modification, are permitted provided that the following conditions are
|
4
|
+
// met:
|
5
|
+
//
|
6
|
+
// * Redistributions of source code must retain the above copyright
|
7
|
+
// notice, this list of conditions and the following disclaimer.
|
8
|
+
// * Redistributions in binary form must reproduce the above
|
9
|
+
// copyright notice, this list of conditions and the following
|
10
|
+
// disclaimer in the documentation and/or other materials provided
|
11
|
+
// with the distribution.
|
12
|
+
// * Neither the name of Google Inc. nor the names of its
|
13
|
+
// contributors may be used to endorse or promote products derived
|
14
|
+
// from this software without specific prior written permission.
|
15
|
+
//
|
16
|
+
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
17
|
+
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
18
|
+
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
19
|
+
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
20
|
+
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
21
|
+
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
22
|
+
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
23
|
+
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
24
|
+
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
25
|
+
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
26
|
+
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
27
|
+
|
28
|
+
function foo(bar) {
|
29
|
+
return arguments[bar];
|
30
|
+
}
|
31
|
+
foo(0); // Handled in runtime.
|
32
|
+
foo(-536870912); // Triggers bug.
|
@@ -0,0 +1,49 @@
|
|
1
|
+
// Copyright 2012 the V8 project authors. All rights reserved.
|
2
|
+
// Redistribution and use in source and binary forms, with or without
|
3
|
+
// modification, are permitted provided that the following conditions are
|
4
|
+
// met:
|
5
|
+
//
|
6
|
+
// * Redistributions of source code must retain the above copyright
|
7
|
+
// notice, this list of conditions and the following disclaimer.
|
8
|
+
// * Redistributions in binary form must reproduce the above
|
9
|
+
// copyright notice, this list of conditions and the following
|
10
|
+
// disclaimer in the documentation and/or other materials provided
|
11
|
+
// with the distribution.
|
12
|
+
// * Neither the name of Google Inc. nor the names of its
|
13
|
+
// contributors may be used to endorse or promote products derived
|
14
|
+
// from this software without specific prior written permission.
|
15
|
+
//
|
16
|
+
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
17
|
+
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
18
|
+
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
19
|
+
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
20
|
+
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
21
|
+
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
22
|
+
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
23
|
+
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
24
|
+
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
25
|
+
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
26
|
+
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
27
|
+
|
28
|
+
// Flags: --expose-gc
|
29
|
+
|
30
|
+
// Test whether the runtime implementation and generated code of
|
31
|
+
// sine and tangens return the same results.
|
32
|
+
|
33
|
+
function test(f, x, name) {
|
34
|
+
// Reset transcendental cache.
|
35
|
+
gc();
|
36
|
+
// Initializing cache leads to a runtime call.
|
37
|
+
var runtime_result = f(x);
|
38
|
+
// Flush transcendental cache entries and optimize f.
|
39
|
+
for (var i = 0; i < 100000; i++) f(i);
|
40
|
+
// Calculate using generated code.
|
41
|
+
var gencode_result = f(x);
|
42
|
+
print(name + " runtime function: " + runtime_result);
|
43
|
+
print(name + " generated code : " + gencode_result);
|
44
|
+
assertEquals(gencode_result, runtime_result);
|
45
|
+
}
|
46
|
+
|
47
|
+
test(Math.tan, -1.57079632679489660000, "Math.tan");
|
48
|
+
test(Math.sin, 6.283185307179586, "Math.sin");
|
49
|
+
|
@@ -111,6 +111,18 @@ function testStrippedCustomError() {
|
|
111
111
|
throw new CustomError("hep-hey", CustomError);
|
112
112
|
}
|
113
113
|
|
114
|
+
MyObj = function() { FAIL; }
|
115
|
+
|
116
|
+
MyObjCreator = function() {}
|
117
|
+
|
118
|
+
MyObjCreator.prototype.Create = function() {
|
119
|
+
return new MyObj();
|
120
|
+
}
|
121
|
+
|
122
|
+
function testClassNames() {
|
123
|
+
(new MyObjCreator).Create();
|
124
|
+
}
|
125
|
+
|
114
126
|
// Utility function for testing that the expected strings occur
|
115
127
|
// in the stack trace produced when running the given function.
|
116
128
|
function testTrace(name, fun, expected, unexpected) {
|
@@ -254,6 +266,8 @@ testTrace("testDefaultCustomError", testDefaultCustomError,
|
|
254
266
|
["collectStackTrace"]);
|
255
267
|
testTrace("testStrippedCustomError", testStrippedCustomError, ["hep-hey"],
|
256
268
|
["new CustomError", "collectStackTrace"]);
|
269
|
+
testTrace("testClassNames", testClassNames,
|
270
|
+
["new MyObj", "MyObjCreator.Create"], ["as Create"]);
|
257
271
|
testCallerCensorship();
|
258
272
|
testUnintendedCallerCensorship();
|
259
273
|
testErrorsDuringFormatting();
|
@@ -1,4 +1,4 @@
|
|
1
|
-
// Copyright
|
1
|
+
// Copyright 2012 the V8 project authors. All rights reserved.
|
2
2
|
// Redistribution and use in source and binary forms, with or without
|
3
3
|
// modification, are permitted provided that the following conditions are
|
4
4
|
// met:
|
@@ -278,7 +278,8 @@ function testOneArrayType(allocator) {
|
|
278
278
|
expected_array_value(7));
|
279
279
|
|
280
280
|
%DeoptimizeFunction(test_various_loads6);
|
281
|
-
|
281
|
+
%ClearFunctionTypeFeedback(test_various_stores);
|
282
|
+
%ClearFunctionTypeFeedback(test_various_loads7);
|
282
283
|
|
283
284
|
// Test stores for non-NaN.
|
284
285
|
var large_array = new allocator(large_array_size);
|
@@ -376,7 +377,7 @@ delete large_array2[5];
|
|
376
377
|
// Convert back to fast elements and make sure the contents of the array are
|
377
378
|
// unchanged.
|
378
379
|
large_array2[25] = new Object();
|
379
|
-
assertTrue(%
|
380
|
+
assertTrue(%HasFastObjectElements(large_array2));
|
380
381
|
for (var i= 0; i < approx_dict_to_elements_threshold; i += 500 ) {
|
381
382
|
if (i != 25 && i != 5) {
|
382
383
|
assertEquals(expected_array_value(i), large_array2[i]);
|
@@ -31,6 +31,7 @@ import os
|
|
31
31
|
from os.path import join, exists
|
32
32
|
import urllib
|
33
33
|
import hashlib
|
34
|
+
import sys
|
34
35
|
import tarfile
|
35
36
|
|
36
37
|
|
@@ -120,7 +121,11 @@ class Test262TestConfiguration(test.TestConfiguration):
|
|
120
121
|
os.remove(archive_name)
|
121
122
|
raise Exception("Hash mismatch of test data file")
|
122
123
|
archive = tarfile.open(archive_name, 'r:bz2')
|
123
|
-
|
124
|
+
if sys.platform in ('win32', 'cygwin'):
|
125
|
+
# Magic incantation to allow longer path names on Windows.
|
126
|
+
archive.extractall(u'\\\\?\\%s' % self.root)
|
127
|
+
else:
|
128
|
+
archive.extractall(self.root)
|
124
129
|
os.rename(join(self.root, 'test262-%s' % revision), directory_name)
|
125
130
|
|
126
131
|
def GetBuildRequirements(self):
|
@@ -37,14 +37,19 @@
|
|
37
37
|
expected_static_init_count=3
|
38
38
|
|
39
39
|
v8_root=$(readlink -f $(dirname $BASH_SOURCE)/../)
|
40
|
-
|
40
|
+
|
41
|
+
if [ -n "$1" ] ; then
|
42
|
+
d8="${v8_root}/$1"
|
43
|
+
else
|
44
|
+
d8="${v8_root}/d8"
|
45
|
+
fi
|
41
46
|
|
42
47
|
if [ ! -f "$d8" ]; then
|
43
|
-
echo "
|
48
|
+
echo "d8 binary not found: $d8"
|
44
49
|
exit 1
|
45
50
|
fi
|
46
51
|
|
47
|
-
static_inits=$(nm "$d8" | grep
|
52
|
+
static_inits=$(nm "$d8" | grep _GLOBAL_ | grep _I_ | awk '{ print $NF; }')
|
48
53
|
|
49
54
|
static_init_count=$(echo "$static_inits" | wc -l)
|
50
55
|
|
@@ -52,4 +57,7 @@ if [ $static_init_count -gt $expected_static_init_count ]; then
|
|
52
57
|
echo "Too many static initializers."
|
53
58
|
echo "$static_inits"
|
54
59
|
exit 1
|
60
|
+
else
|
61
|
+
echo "Static initializer check passed ($static_init_count initializers)."
|
62
|
+
exit 0
|
55
63
|
fi
|
@@ -0,0 +1,92 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
# Copyright 2012 the V8 project authors. All rights reserved.
|
3
|
+
# Redistribution and use in source and binary forms, with or without
|
4
|
+
# modification, are permitted provided that the following conditions are
|
5
|
+
# met:
|
6
|
+
#
|
7
|
+
# * Redistributions of source code must retain the above copyright
|
8
|
+
# notice, this list of conditions and the following disclaimer.
|
9
|
+
# * Redistributions in binary form must reproduce the above
|
10
|
+
# copyright notice, this list of conditions and the following
|
11
|
+
# disclaimer in the documentation and/or other materials provided
|
12
|
+
# with the distribution.
|
13
|
+
# * Neither the name of Google Inc. nor the names of its
|
14
|
+
# contributors may be used to endorse or promote products derived
|
15
|
+
# from this software without specific prior written permission.
|
16
|
+
#
|
17
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
18
|
+
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
19
|
+
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
20
|
+
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
21
|
+
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
22
|
+
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
23
|
+
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
24
|
+
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
25
|
+
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
26
|
+
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
27
|
+
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
28
|
+
|
29
|
+
# A simple harness that downloads and runs 'jsfunfuzz' against d8. This
|
30
|
+
# takes a long time because it runs many iterations and is intended for
|
31
|
+
# automated usage. The package containing 'jsfunfuzz' can be found as an
|
32
|
+
# attachment to this bug:
|
33
|
+
# https://bugzilla.mozilla.org/show_bug.cgi?id=jsfunfuzz
|
34
|
+
|
35
|
+
JSFUNFUZZ_URL="https://bugzilla.mozilla.org/attachment.cgi?id=310631"
|
36
|
+
JSFUNFUZZ_MD5="d0e497201c5cd7bffbb1cdc1574f4e32"
|
37
|
+
|
38
|
+
v8_root=$(readlink -f $(dirname $BASH_SOURCE)/../)
|
39
|
+
|
40
|
+
if [ -n "$1" ]; then
|
41
|
+
d8="${v8_root}/$1"
|
42
|
+
else
|
43
|
+
d8="${v8_root}/d8"
|
44
|
+
fi
|
45
|
+
|
46
|
+
if [ ! -f "$d8" ]; then
|
47
|
+
echo "Failed to find d8 binary: $d8"
|
48
|
+
exit 1
|
49
|
+
fi
|
50
|
+
|
51
|
+
jsfunfuzz_file="$v8_root/tools/jsfunfuzz.zip"
|
52
|
+
if [ ! -f "$jsfunfuzz_file" ]; then
|
53
|
+
echo "Downloading $jsfunfuzz_file ..."
|
54
|
+
wget -q -O "$jsfunfuzz_file" $JSFUNFUZZ_URL || exit 1
|
55
|
+
fi
|
56
|
+
|
57
|
+
jsfunfuzz_sum=$(md5sum "$jsfunfuzz_file" | awk '{ print $1 }')
|
58
|
+
if [ $jsfunfuzz_sum != $JSFUNFUZZ_MD5 ]; then
|
59
|
+
echo "Failed to verify checksum!"
|
60
|
+
exit 1
|
61
|
+
fi
|
62
|
+
|
63
|
+
jsfunfuzz_dir="$v8_root/tools/jsfunfuzz"
|
64
|
+
if [ ! -d "$jsfunfuzz_dir" ]; then
|
65
|
+
echo "Unpacking into $jsfunfuzz_dir ..."
|
66
|
+
unzip "$jsfunfuzz_file" -d "$jsfunfuzz_dir" || exit 1
|
67
|
+
echo "Patching runner ..."
|
68
|
+
cat << EOF | patch -s -p0 -d "$v8_root"
|
69
|
+
--- tools/jsfunfuzz/jsfunfuzz/multi_timed_run.py~
|
70
|
+
+++ tools/jsfunfuzz/jsfunfuzz/multi_timed_run.py
|
71
|
+
@@ -125,7 +125,7 @@
|
72
|
+
|
73
|
+
def many_timed_runs():
|
74
|
+
iteration = 0
|
75
|
+
- while True:
|
76
|
+
+ while iteration < 100:
|
77
|
+
iteration += 1
|
78
|
+
logfilename = "w%d" % iteration
|
79
|
+
one_timed_run(logfilename)
|
80
|
+
EOF
|
81
|
+
fi
|
82
|
+
|
83
|
+
flags='--debug-code --expose-gc --verify-gc'
|
84
|
+
python -u "$jsfunfuzz_dir/jsfunfuzz/multi_timed_run.py" 300 \
|
85
|
+
"$d8" $flags "$jsfunfuzz_dir/jsfunfuzz/jsfunfuzz.js"
|
86
|
+
exit_code=$(cat w* | grep " looking good" -c)
|
87
|
+
exit_code=$((100-exit_code))
|
88
|
+
tar -cjf fuzz-results-$(date +%y%m%d).tar.bz2 err-* w*
|
89
|
+
rm -f err-* w*
|
90
|
+
|
91
|
+
echo "Total failures: $exit_code"
|
92
|
+
exit $exit_code
|