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

Unified Diff: test/mjsunit/compiler/to-fast-properties.js

Issue 147573003: A64: Add a test for HToFastProperties. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 11 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/a64/lithium-codegen-a64.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/compiler/to-fast-properties.js
diff --git a/test/message/try-catch-finally-no-message.js b/test/mjsunit/compiler/to-fast-properties.js
similarity index 77%
copy from test/message/try-catch-finally-no-message.js
copy to test/mjsunit/compiler/to-fast-properties.js
index 6459ed80e3331154dc3a9e1edbcd964f25773dd4..26829d95e9bcb94049b3b464ec47c33ca529255e 100644
--- a/test/message/try-catch-finally-no-message.js
+++ b/test/mjsunit/compiler/to-fast-properties.js
@@ -1,4 +1,4 @@
-// Copyright 2008 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:
@@ -25,27 +25,19 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-function f() {
- try {
- throw "foo";
- } catch (e) {
- throw "bar";
- } finally {
- return 4;
- }
-}
+// This test requires OSR or --stress-runs=3 to optimize the top level script.
-function g() {
- while (true) {
- try {
- throw "foo";
- } catch (e) {
- throw "bar";
- } finally {
- break;
- }
+for (var i = 0; i < 3; i++) {
+ // HToFastProperties is used for top-level object literals that have
+ // function property.
+ var obj = {
+ index: function() { return i; },
+ x: 0
}
+ var n = 10000;
+ // Loop to hit OSR.
+ for (var j = 0; j < n; j++) {
+ obj.x += i;
+ }
+ assertEquals(obj.index() * n, obj.x);
}
-
-f();
-g();
« no previous file with comments | « src/a64/lithium-codegen-a64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698