Index: test/mjsunit/generic-monorphic-keyed-load.js |
diff --git a/test/mjsunit/regress/regress-351315.js b/test/mjsunit/generic-monorphic-keyed-load.js |
similarity index 81% |
copy from test/mjsunit/regress/regress-351315.js |
copy to test/mjsunit/generic-monorphic-keyed-load.js |
index e2580fc34beab641655ba2a58c3e09e007890fd0..7ceca4cb2fc838af0eda908d2966758823248aad 100644 |
--- a/test/mjsunit/regress/regress-351315.js |
+++ b/test/mjsunit/generic-monorphic-keyed-load.js |
@@ -27,23 +27,23 @@ |
// Flags: --allow-natives-syntax |
-function f_13(x, y, z) { } |
-v_5 = f_13.bind({}, -7); |
- |
-function f_0(z) { |
- return %NewObjectFromBound(v_5); |
+var o = { |
+ "foo": "bar", |
} |
-function f_8(z2, y2) { |
- var v_0 = { f1 : 0.5, f2 : 0.25 }; |
- return f_0(v_0); |
+function get(obj, key) { |
+ return obj[key]; |
} |
-function f_12(f, args) { |
- f.apply(this, args); |
- %OptimizeFunctionOnNextCall(f); |
- f.apply(this, args); |
-} |
+get(o, "foo"); |
+get(o, "foo"); |
+get(o, "foo"); |
+ |
+// At this point, lookup in `get` should be aware of the key type and |
+// generate KeyedLoadGeneric, instead of element access and deopt check |
Jakob Kummerow
2014/12/11 09:52:42
nit: missing punctuation at the end.
Or you could
|
+%OptimizeFunctionOnNextCall(get); |
+get(o, "foo"); |
-f_12(f_8, [6, 4]); |
+// Should not deoptimize |
Jakob Kummerow
2014/12/11 09:52:42
nit: same here. Again, just drop it. It's obvious
|
+assertTrue(%GetOptimizationStatus(get) != 2); |
Jakob Kummerow
2014/12/11 09:52:42
Use "assertOptimized(get);" here.
|