Mercurial > hg > truffle
annotate graal/com.oracle.graal.compiler.amd64.test/src/com/oracle/graal/compiler/amd64/test/AMD64AllocatorTest.java @ 14023:3be1d30dd40f
Keep stamp when canonicalizing nodes to constants.
author | Roland Schatz <roland.schatz@oracle.com> |
---|---|
date | Wed, 26 Feb 2014 15:53:51 +0100 |
parents | 97db51025787 |
children | cb70055faeeb |
rev | line source |
---|---|
8190
87cb93643a47
Move platform specific assumptions from AllocatorTest to a separate project.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
1 /* |
87cb93643a47
Move platform specific assumptions from AllocatorTest to a separate project.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
2 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. |
87cb93643a47
Move platform specific assumptions from AllocatorTest to a separate project.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
87cb93643a47
Move platform specific assumptions from AllocatorTest to a separate project.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
4 * |
87cb93643a47
Move platform specific assumptions from AllocatorTest to a separate project.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
87cb93643a47
Move platform specific assumptions from AllocatorTest to a separate project.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
87cb93643a47
Move platform specific assumptions from AllocatorTest to a separate project.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
87cb93643a47
Move platform specific assumptions from AllocatorTest to a separate project.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
8 * |
87cb93643a47
Move platform specific assumptions from AllocatorTest to a separate project.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
87cb93643a47
Move platform specific assumptions from AllocatorTest to a separate project.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
87cb93643a47
Move platform specific assumptions from AllocatorTest to a separate project.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
87cb93643a47
Move platform specific assumptions from AllocatorTest to a separate project.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
87cb93643a47
Move platform specific assumptions from AllocatorTest to a separate project.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
13 * accompanied this code). |
87cb93643a47
Move platform specific assumptions from AllocatorTest to a separate project.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
14 * |
87cb93643a47
Move platform specific assumptions from AllocatorTest to a separate project.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
87cb93643a47
Move platform specific assumptions from AllocatorTest to a separate project.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
87cb93643a47
Move platform specific assumptions from AllocatorTest to a separate project.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
87cb93643a47
Move platform specific assumptions from AllocatorTest to a separate project.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
18 * |
87cb93643a47
Move platform specific assumptions from AllocatorTest to a separate project.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
87cb93643a47
Move platform specific assumptions from AllocatorTest to a separate project.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
87cb93643a47
Move platform specific assumptions from AllocatorTest to a separate project.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
21 * questions. |
87cb93643a47
Move platform specific assumptions from AllocatorTest to a separate project.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
22 */ |
87cb93643a47
Move platform specific assumptions from AllocatorTest to a separate project.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
23 package com.oracle.graal.compiler.amd64.test; |
87cb93643a47
Move platform specific assumptions from AllocatorTest to a separate project.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
24 |
87cb93643a47
Move platform specific assumptions from AllocatorTest to a separate project.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
25 import org.junit.*; |
87cb93643a47
Move platform specific assumptions from AllocatorTest to a separate project.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
26 |
87cb93643a47
Move platform specific assumptions from AllocatorTest to a separate project.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
27 import com.oracle.graal.compiler.test.backend.*; |
87cb93643a47
Move platform specific assumptions from AllocatorTest to a separate project.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
28 |
87cb93643a47
Move platform specific assumptions from AllocatorTest to a separate project.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
29 public class AMD64AllocatorTest extends AllocatorTest { |
87cb93643a47
Move platform specific assumptions from AllocatorTest to a separate project.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
30 |
87cb93643a47
Move platform specific assumptions from AllocatorTest to a separate project.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
31 @Test |
87cb93643a47
Move platform specific assumptions from AllocatorTest to a separate project.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
32 public void test1() { |
8290
9882af5c8504
AMD64 HotSpot backend now models RBP as an incoming parameter that must be preserved until the end of the method. For non-leaf methods, the value is preserved in the special stack slot required by the HotSpot runtime for walking/inspecting frames of such methods.
Doug Simon <doug.simon@oracle.com>
parents:
8220
diff
changeset
|
33 test("test1snippet", 3, 1, 0); |
8190
87cb93643a47
Move platform specific assumptions from AllocatorTest to a separate project.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
34 } |
87cb93643a47
Move platform specific assumptions from AllocatorTest to a separate project.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
35 |
87cb93643a47
Move platform specific assumptions from AllocatorTest to a separate project.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
36 public static long test1snippet(long x) { |
87cb93643a47
Move platform specific assumptions from AllocatorTest to a separate project.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
37 return x + 5; |
87cb93643a47
Move platform specific assumptions from AllocatorTest to a separate project.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
38 } |
87cb93643a47
Move platform specific assumptions from AllocatorTest to a separate project.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
39 |
87cb93643a47
Move platform specific assumptions from AllocatorTest to a separate project.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
40 @Test |
87cb93643a47
Move platform specific assumptions from AllocatorTest to a separate project.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
41 public void test2() { |
8290
9882af5c8504
AMD64 HotSpot backend now models RBP as an incoming parameter that must be preserved until the end of the method. For non-leaf methods, the value is preserved in the special stack slot required by the HotSpot runtime for walking/inspecting frames of such methods.
Doug Simon <doug.simon@oracle.com>
parents:
8220
diff
changeset
|
42 test("test2snippet", 3, 0, 0); |
8190
87cb93643a47
Move platform specific assumptions from AllocatorTest to a separate project.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
43 } |
87cb93643a47
Move platform specific assumptions from AllocatorTest to a separate project.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
44 |
87cb93643a47
Move platform specific assumptions from AllocatorTest to a separate project.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
45 public static long test2snippet(long x) { |
87cb93643a47
Move platform specific assumptions from AllocatorTest to a separate project.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
46 return x * 5; |
87cb93643a47
Move platform specific assumptions from AllocatorTest to a separate project.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
47 } |
87cb93643a47
Move platform specific assumptions from AllocatorTest to a separate project.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
48 |
87cb93643a47
Move platform specific assumptions from AllocatorTest to a separate project.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
49 @Ignore |
87cb93643a47
Move platform specific assumptions from AllocatorTest to a separate project.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
50 @Test |
87cb93643a47
Move platform specific assumptions from AllocatorTest to a separate project.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
51 public void test3() { |
87cb93643a47
Move platform specific assumptions from AllocatorTest to a separate project.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
52 test("test3snippet", 4, 1, 0); |
87cb93643a47
Move platform specific assumptions from AllocatorTest to a separate project.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
53 } |
87cb93643a47
Move platform specific assumptions from AllocatorTest to a separate project.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
54 |
87cb93643a47
Move platform specific assumptions from AllocatorTest to a separate project.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
55 public static long test3snippet(long x) { |
87cb93643a47
Move platform specific assumptions from AllocatorTest to a separate project.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
56 return x / 3 + x % 3; |
87cb93643a47
Move platform specific assumptions from AllocatorTest to a separate project.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
57 } |
87cb93643a47
Move platform specific assumptions from AllocatorTest to a separate project.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
58 |
87cb93643a47
Move platform specific assumptions from AllocatorTest to a separate project.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
59 } |