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

Side by Side Diff: test/mjsunit/debug-liveedit-patch-positions.js

Issue 8888006: Make more JS files beter match the coding standard. Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address review comments Created 9 years 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 14 matching lines...) Expand all
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 27
28 // Flags: --expose-debug-as debug 28 // Flags: --expose-debug-as debug
29 // Get the Debug object exposed from the debug context global object. 29 // Get the Debug object exposed from the debug context global object.
30 30
31 // Scenario: some function is being edited; the outer function has to have its 31 // Scenario: some function is being edited; the outer function has to have its
32 // positions patched. Accoring to a special markup of function text 32 // positions patched. Accoring to a special markup of function text
33 // corresponding byte-code PCs should coincide before change and after it. 33 // corresponding byte-code PCs should coincide before change and after it.
34 34
35 Debug = debug.Debug 35 Debug = debug.Debug;
36 36
37 eval( 37 eval(
38 "function F1() { return 5; }\n" + 38 "function F1() { return 5; }\n" +
39 "function ChooseAnimal(/*$*/ ) {\n" + 39 "function ChooseAnimal(/*$*/ ) {\n" +
40 "/*$*/ var x = F1(/*$*/ );\n" + 40 "/*$*/ var x = F1(/*$*/ );\n" +
41 "/*$*/ var res/*$*/ =/*$*/ (function() { return 'Cat'; } )();\n" + 41 "/*$*/ var res/*$*/ =/*$*/ (function() { return 'Cat'; } )();\n" +
42 "/*$*/ var y/*$*/ = F2(/*$*/ F1()/*$*/ , F1(/*$*/ )/*$*/ );\n" + 42 "/*$*/ var y/*$*/ = F2(/*$*/ F1()/*$*/ , F1(/*$*/ )/*$*/ );\n" +
43 "/*$*/ if (/*$*/ x.toString(/*$*/ )) { /*$*/ y = 3;/*$*/ } else {/*$*/ y = 8;/*$*/ }\n" + 43 "/*$*/ if (/*$*/ x.toString(/*$*/ )) { /*$*/ y = 3;/*$*/ } else {/*$*/ y = 8;/*$*/ }\n" +
44 "/*$*/ var z = /*$*/ x * y;\n" + 44 "/*$*/ var z = /*$*/ x * y;\n" +
45 "/*$*/ return/*$*/ res/*$*/ + z;/*$*/ }\n" + 45 "/*$*/ return/*$*/ res/*$*/ + z;/*$*/ }\n" +
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 print(pcArray1); 117 print(pcArray1);
118 print(pcArray2); 118 print(pcArray2);
119 119
120 // Function can be marked for recompilation at any point (especially if we are 120 // Function can be marked for recompilation at any point (especially if we are
121 // running with --stress-opt). When we mark function for recompilation we 121 // running with --stress-opt). When we mark function for recompilation we
122 // replace it's code with stub. So there is no reliable way to get PCs for 122 // replace it's code with stub. So there is no reliable way to get PCs for
123 // function. 123 // function.
124 if (pcArray1 && pcArray2) { 124 if (pcArray1 && pcArray2) {
125 assertArrayEquals(pcArray1, pcArray2); 125 assertArrayEquals(pcArray1, pcArray2);
126 } 126 }
OLDNEW
« no previous file with comments | « test/mjsunit/debug-liveedit-newsource.js ('k') | test/mjsunit/debug-liveedit-patch-positions-replace.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698