summaryrefslogtreecommitdiff
path: root/deps/v8/benchmarks/splay.js
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2010-05-21 09:41:50 -0700
committerRyan Dahl <ry@tinyclouds.org>2010-05-21 09:41:50 -0700
commit2b34363d03e0718c9e9f39982c723b806558c759 (patch)
tree0388b89e7794e3aa7c9ee2e923570cca56c7def9 /deps/v8/benchmarks/splay.js
parent9514a4d5476225e8c8310ce5acae2857033bcaaa (diff)
downloadnode-2b34363d03e0718c9e9f39982c723b806558c759.tar.gz
Upgrade V8 to 2.2.11
Diffstat (limited to 'deps/v8/benchmarks/splay.js')
-rw-r--r--deps/v8/benchmarks/splay.js11
1 files changed, 6 insertions, 5 deletions
diff --git a/deps/v8/benchmarks/splay.js b/deps/v8/benchmarks/splay.js
index 53fc72793..d8c8f0427 100644
--- a/deps/v8/benchmarks/splay.js
+++ b/deps/v8/benchmarks/splay.js
@@ -46,16 +46,16 @@ var kSplayTreePayloadDepth = 5;
var splayTree = null;
-function GeneratePayloadTree(depth, key) {
+function GeneratePayloadTree(depth, tag) {
if (depth == 0) {
return {
array : [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ],
- string : 'String for key ' + key + ' in leaf node'
+ string : 'String for key ' + tag + ' in leaf node'
};
} else {
return {
- left: GeneratePayloadTree(depth - 1, key),
- right: GeneratePayloadTree(depth - 1, key)
+ left: GeneratePayloadTree(depth - 1, tag),
+ right: GeneratePayloadTree(depth - 1, tag)
};
}
}
@@ -74,7 +74,8 @@ function InsertNewNode() {
do {
key = GenerateKey();
} while (splayTree.find(key) != null);
- splayTree.insert(key, GeneratePayloadTree(kSplayTreePayloadDepth, key));
+ var payload = GeneratePayloadTree(kSplayTreePayloadDepth, String(key));
+ splayTree.insert(key, payload);
return key;
}