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

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

Issue 6691054: [Arguments] Merge (7442,7496] from bleeding_edge. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/arguments
Patch Set: Created 9 years, 9 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 | « test/mjsunit/global-accessors.js ('k') | test/preparser/empty.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/regress/regress-1229.js
diff --git a/src/platform-tls-mac.h b/test/mjsunit/regress/regress-1229.js
similarity index 54%
copy from src/platform-tls-mac.h
copy to test/mjsunit/regress/regress-1229.js
index 86a3347d0f710825808a231031a4f81851b15ffa..4afb9646ea0dc57dc7b813355abfb3e66fdb2b16 100644
--- a/src/platform-tls-mac.h
+++ b/test/mjsunit/regress/regress-1229.js
@@ -25,38 +25,55 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifndef V8_PLATFORM_TLS_MAC_H_
-#define V8_PLATFORM_TLS_MAC_H_
-
-#include "globals.h"
-
-namespace v8 {
-namespace internal {
-
-#if defined(V8_HOST_ARCH_IA32) || defined(V8_HOST_ARCH_X64)
-
-#define V8_FAST_TLS_SUPPORTED 1
-
-INLINE(intptr_t InternalGetExistingThreadLocal(intptr_t index));
-
-inline intptr_t InternalGetExistingThreadLocal(intptr_t index) {
- // The constants below are taken from pthreads.s from the XNU kernel
- // sources archive at www.opensource.apple.com.
- intptr_t result;
-#if defined(V8_HOST_ARCH_IA32)
- asm("movl %%gs:0x48(,%1,4), %0;"
- :"=r"(result) // Output must be a writable register.
- :"0"(index)); // Input is the same as output.
-#else
- asm("movq %%gs:0x60(,%1,8), %0;"
- :"=r"(result)
- :"0"(index));
-#endif
- return result;
+// Flags: --allow-natives-syntax
+
+// Check that %NewObjectFromBound works correctly when called from optimized
+// frame.
+function foo(x, y, z) {
+ assertEquals(1, x);
+ assertEquals(2, y);
+ assertEquals(3, z);
+}
+
+var bound_arg = [1];
+
+function f(y, z) {
+ return %NewObjectFromBound(foo, bound_arg);
}
-#endif
+// Check that %NewObjectFromBound looks at correct frame for inlined function.
+function g(z, y) {
+ return f(y, z); /* f should be inlined into g, note rotated arguments */
+}
+
+// Check that %NewObjectFromBound looks at correct frame for inlined function.
+function ff(x) { }
+function h(z2, y2) {
+ var local_z = z2 >> 1;
+ ff(local_z);
+ var local_y = y2 >> 1;
+ ff(local_y);
+ return f(local_y, local_z); /* f should be inlined into h */
+}
-} } // namespace v8::internal
+for (var i = 0; i < 100000; i++) f(2, 3);
+
+for (var i = 0; i < 100000; i++) g(3, 2);
+
+for (var i = 0; i < 100000; i++) h(6, 4);
+
+// Check that %_IsConstructCall returns correct value when inlined
+var NON_CONSTRUCT_MARKER = {};
+var CONSTRUCT_MARKER = {};
+function baz() {
+ return (!%_IsConstructCall()) ? NON_CONSTRUCT_MARKER : CONSTRUCT_MARKER;
+}
+
+function bar(x, y, z) {
+ var non_construct = baz(); /* baz should be inlined */
+ assertEquals(non_construct, NON_CONSTRUCT_MARKER);
+ var construct = new baz();
+ assertEquals(construct, CONSTRUCT_MARKER);
+}
-#endif // V8_PLATFORM_TLS_MAC_H_
+for (var i = 0; i < 100000; i++) new bar(1, 2, 3);
« no previous file with comments | « test/mjsunit/global-accessors.js ('k') | test/preparser/empty.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698