mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Merge.
This commit is contained in:
commit
7eba55b32b
@ -386,7 +386,7 @@ TraceRecorder::readstack(void* p, char *prefix, int index)
|
||||
if (prefix) {
|
||||
char name[16];
|
||||
JS_ASSERT(strlen(prefix) < 10);
|
||||
JS_snprintf(name, 15, "$%s%d", prefix, index);
|
||||
JS_snprintf(name, sizeof name, "$%s%d", prefix, index);
|
||||
lirbuf->names->addName(ins, name);
|
||||
}
|
||||
#endif
|
||||
|
37
js/src/trace-test.js
Normal file
37
js/src/trace-test.js
Normal file
@ -0,0 +1,37 @@
|
||||
function test(desc, expected, actual)
|
||||
{
|
||||
if (expected == actual)
|
||||
return print(desc, ": passed");
|
||||
print(desc, ": FAILED: ", typeof(expected), "(", expected, ") != ",
|
||||
typeof(actual), "(", actual, ")");
|
||||
}
|
||||
|
||||
function ifInsideLoop()
|
||||
{
|
||||
var cond = true, count = 0;
|
||||
for (var i = 0; i < 5000; i++) {
|
||||
if (cond)
|
||||
count++;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
test("tracing if", ifInsideLoop(), 5000);
|
||||
|
||||
function bitwiseAnd(bitwiseAndValue) {
|
||||
for (var i = 0; i < 60000000; i++)
|
||||
bitwiseAndValue = bitwiseAndValue & i;
|
||||
return bitwiseAndValue;
|
||||
}
|
||||
test("bitwise and with arg/var", bitwiseAnd(12341234), 0)
|
||||
|
||||
function equalInt()
|
||||
{
|
||||
var i1 = 55, eq = 0;
|
||||
for (var i = 0; i < 5000; i++) {
|
||||
if (i1 == 55)
|
||||
eq++;
|
||||
}
|
||||
return eq;
|
||||
}
|
||||
test("int equality", equalInt(), 5000);
|
||||
|
Loading…
Reference in New Issue
Block a user