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

Unified Diff: test/mjsunit/regress/regress-crbug-282736.js

Issue 23658033: Reload the descriptor after modifying the transition target. (Closed) Base URL: https://v8.googlecode.com/svn/branches/3.20
Patch Set: Adding test Created 7 years, 3 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/version.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-crbug-282736.js
diff --git a/test/mjsunit/never-optimize.js b/test/mjsunit/regress/regress-crbug-282736.js
similarity index 70%
copy from test/mjsunit/never-optimize.js
copy to test/mjsunit/regress/regress-crbug-282736.js
index 55b1f11981891a70fe01a4c25f55176416fd1a0b..afd9f75be42b50c0a2ff5c4158439390b548bd61 100644
--- a/test/mjsunit/never-optimize.js
+++ b/test/mjsunit/regress/regress-crbug-282736.js
@@ -25,39 +25,35 @@
// (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: --allow-natives-syntax
-
-function o1() {
-}
-
-if (%GetOptimizationStatus(o1) != 4) {
- // 4 == optimization disabled.
- o1(); o1();
- %OptimizeFunctionOnNextCall(o1);
- o1();
-
- // Check that the given function was optimized.
- assertOptimized(o1);
-
- // Test the %NeverOptimizeFunction runtime call.
- %NeverOptimizeFunction(u1);
- function u1() {
- }
-
- function u2() {
- u1();
+function funcify(obj) {
+ var type = typeof obj;
+ if (type === "object") {
+ var funcified = {}, foo = {};
+ for (var prop in obj) {
+ funcified[prop] = funcify(obj[prop]);
+ foo[prop] = true;
+ }
+ return funcified;
+ } else if (type === "function") {
+ return obj;
+ } else {
+ return function () { return obj; };
}
+}
- u1(); u1();
- u2(); u2();
+var obj = {};
- %OptimizeFunctionOnNextCall(u1);
- %OptimizeFunctionOnNextCall(u2);
+obj.A = 1;
+obj.B = function () { return 2; };
+obj.C = 3;
+obj.D = 4;
- u1(); u1();
- u2(); u2();
+var funcified = funcify(obj);
- // 2 => not optimized.
- assertUnoptimized(u1);
- assertOptimized(u2);
-}
+assertEquals("function", typeof funcified.A);
+assertEquals(1, funcified.A());
+assertEquals("function", typeof funcified.B);
+assertEquals(2, funcified.B());
+assertEquals("function", typeof funcified.C);
+assertEquals("function", typeof funcified.D);
+assertEquals(4, funcified.D());
« no previous file with comments | « src/version.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698