Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Unified Diff: test/mjsunit/regress/regress-392114.js

Issue 418023002: CallIC customization stubs must accept that a vector slot is cleared. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: CallIC feedback slots don't contain smis. Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/x64/code-stubs-x64.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/regress/regress-392114.js
diff --git a/test/mjsunit/regress/regress-frame-details-null-receiver.js b/test/mjsunit/regress/regress-392114.js
similarity index 63%
copy from test/mjsunit/regress/regress-frame-details-null-receiver.js
copy to test/mjsunit/regress/regress-392114.js
index ffe5fbb84ce80c0289a5a76c0a7bc1c798383c49..69fd04ba177ede7d46054e29d8fc4bb0e8e8b7e7 100644
--- a/test/mjsunit/regress/regress-frame-details-null-receiver.js
+++ b/test/mjsunit/regress/regress-392114.js
@@ -1,4 +1,4 @@
-// Copyright 2013 the V8 project authors. All rights reserved.
+// Copyright 2014 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,24 +28,42 @@
// Flags: --expose-debug-as debug --allow-natives-syntax
Debug = debug.Debug;
-var listened = false;
-function listener(event, exec_state, event_data, data) {
- if (event == Debug.DebugEvent.Exception) {
- for (var i = 0; i < exec_state.frameCount(); i++) {
- print(exec_state.frame(i).receiver());
- print(exec_state.frame(i).func().name());
+function dummy(x) {
+ return x + 100;
+}
+
+function create_closure() {
+ return function(arg) {
+ if (arg === true) {
Toon Verwaest 2014/07/29 11:28:18 if (arg) { %DeoptimizeFunction(function); }
+ // Do something that causes a deopt. We'd like to run the newly compiled
+ // full code for the Array statement below. Soft deopt:
+ dummy();
+ }
+ var a = Array(10);
+ for (var i = 0; i < a.length; i++) {
+ a[i] = i;
}
}
- listened = true;
}
-Debug.setListener(listener);
-Debug.setBreakOnException();
+var c = create_closure();
+c();
+
+// c CallIC state now has custom Array handler installed.
+
+// Turn on the debugger.
+Debug.setListener(function () {});
-assertThrows(function() { delete null['foo']; });
+var d = create_closure();
+%OptimizeFunctionOnNextCall(d);
+// Thanks to the debugger, we recreate the full code too. We deopt and run
+// it, stomping on the unexpected AllocationSite in the type vector slot.
+d(true);
-Debug.clearBreakOnException();
-Debug.setListener(null);
+// CallIC in c misinterprets type vector slot contents as an AllocationSite,
+// corrupting the heap.
+c();
-assertTrue(listened);
+// CallIC MISS - crash due to corruption.
+dummy();
« no previous file with comments | « src/x64/code-stubs-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698