| Index: test/mjsunit/regress/regress-prepare-break-while-recompile.js
|
| diff --git a/test/mjsunit/parallel-invalidate-transition-map.js b/test/mjsunit/regress/regress-prepare-break-while-recompile.js
|
| similarity index 69%
|
| copy from test/mjsunit/parallel-invalidate-transition-map.js
|
| copy to test/mjsunit/regress/regress-prepare-break-while-recompile.js
|
| index 716f63198cd02f4ba01af39ebd11c082d507ff0a..e4941738562747e6f6e04a0091a46a7435067f52 100644
|
| --- a/test/mjsunit/parallel-invalidate-transition-map.js
|
| +++ b/test/mjsunit/regress/regress-prepare-break-while-recompile.js
|
| @@ -25,33 +25,38 @@
|
| // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
| // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
| -// Flags: --track-fields --track-double-fields --allow-natives-syntax
|
| -// Flags: --parallel-recompilation --parallel-recompilation-delay=100
|
| +// Flags: --expose-debug-as debug --allow-natives-syntax
|
| +// Flags: --parallel-recompilation-delay=300
|
|
|
| if (!%IsParallelRecompilationSupported()) {
|
| print("Parallel recompilation is disabled. Skipping this test.");
|
| quit();
|
| }
|
|
|
| -function new_object() {
|
| - var o = {};
|
| - o.a = 1;
|
| - o.b = 2;
|
| - return o;
|
| +Debug = debug.Debug
|
| +
|
| +function foo() {
|
| + var x = 1;
|
| + return x;
|
| }
|
|
|
| -function add_field(obj) {
|
| - obj.c = 3;
|
| +function bar() {
|
| + var x = 2;
|
| + return x;
|
| }
|
|
|
| -add_field(new_object());
|
| -add_field(new_object());
|
| -%OptimizeFunctionOnNextCall(add_field, "parallel");
|
| -
|
| -var o = new_object();
|
| -// Trigger optimization in the background thread.
|
| -add_field(o);
|
| -// Invalidate transition map while optimization is underway.
|
| -o.c = 2.2;
|
| -// Sync with background thread to conclude optimization that bailed out.
|
| -assertUnoptimized(add_field, "sync");
|
| +foo();
|
| +// Mark and trigger parallel optimization.
|
| +%OptimizeFunctionOnNextCall(foo, "parallel");
|
| +foo();
|
| +
|
| +// Set break points on an unrelated function. This clears both optimized
|
| +// and (shared) unoptimized code on foo, and sets both to lazy-compile builtin.
|
| +// Clear the break point immediately after to deactivate the debugger.
|
| +Debug.setBreakPoint(bar, 0, 0);
|
| +Debug.clearAllBreakPoints();
|
| +
|
| +// Install optimized code when parallel optimization finishes.
|
| +// This needs to be able to deal with shared code being a builtin.
|
| +assertUnoptimized(foo, "sync");
|
| +
|
|
|