annotate graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64PrefetchOp.java @ 17391:e890b86b397d

default allocation profiling to AllocatedTypes
author Lukas Stadler <lukas.stadler@oracle.com>
date Thu, 09 Oct 2014 14:44:19 +0200
parents 96bb07a5d667
children 8fc336a04d77
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
13255
785bbb619238 Basic allocation prefetching support
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff changeset
1 /*
785bbb619238 Basic allocation prefetching support
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff changeset
2 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
785bbb619238 Basic allocation prefetching support
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
785bbb619238 Basic allocation prefetching support
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff changeset
4 *
785bbb619238 Basic allocation prefetching support
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
785bbb619238 Basic allocation prefetching support
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
785bbb619238 Basic allocation prefetching support
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff changeset
7 * published by the Free Software Foundation.
785bbb619238 Basic allocation prefetching support
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff changeset
8 *
785bbb619238 Basic allocation prefetching support
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
785bbb619238 Basic allocation prefetching support
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
785bbb619238 Basic allocation prefetching support
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
785bbb619238 Basic allocation prefetching support
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
785bbb619238 Basic allocation prefetching support
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff changeset
13 * accompanied this code).
785bbb619238 Basic allocation prefetching support
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff changeset
14 *
785bbb619238 Basic allocation prefetching support
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
785bbb619238 Basic allocation prefetching support
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
785bbb619238 Basic allocation prefetching support
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
785bbb619238 Basic allocation prefetching support
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff changeset
18 *
785bbb619238 Basic allocation prefetching support
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
785bbb619238 Basic allocation prefetching support
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
785bbb619238 Basic allocation prefetching support
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff changeset
21 * questions.
785bbb619238 Basic allocation prefetching support
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff changeset
22 */
785bbb619238 Basic allocation prefetching support
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff changeset
23
785bbb619238 Basic allocation prefetching support
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff changeset
24 package com.oracle.graal.hotspot.amd64;
785bbb619238 Basic allocation prefetching support
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff changeset
25
785bbb619238 Basic allocation prefetching support
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff changeset
26 import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*;
785bbb619238 Basic allocation prefetching support
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff changeset
27
785bbb619238 Basic allocation prefetching support
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff changeset
28 import com.oracle.graal.asm.amd64.*;
15193
96bb07a5d667 Spit up and move GraalInternalError.
Josef Eisl <josef.eisl@jku.at>
parents: 14013
diff changeset
29 import com.oracle.graal.compiler.common.*;
13255
785bbb619238 Basic allocation prefetching support
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff changeset
30 import com.oracle.graal.lir.amd64.*;
785bbb619238 Basic allocation prefetching support
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff changeset
31 import com.oracle.graal.lir.asm.*;
785bbb619238 Basic allocation prefetching support
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff changeset
32
785bbb619238 Basic allocation prefetching support
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff changeset
33 public class AMD64PrefetchOp extends AMD64LIRInstruction {
785bbb619238 Basic allocation prefetching support
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff changeset
34
14013
4347ad3df3d7 make SPARC compile code again
twisti
parents: 13255
diff changeset
35 private final int instr; // AllocatePrefetchInstr
13255
785bbb619238 Basic allocation prefetching support
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff changeset
36 @Alive({COMPOSITE}) protected AMD64AddressValue address;
785bbb619238 Basic allocation prefetching support
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff changeset
37
785bbb619238 Basic allocation prefetching support
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff changeset
38 public AMD64PrefetchOp(AMD64AddressValue address, int instr) {
785bbb619238 Basic allocation prefetching support
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff changeset
39 this.address = address;
785bbb619238 Basic allocation prefetching support
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff changeset
40 this.instr = instr;
785bbb619238 Basic allocation prefetching support
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff changeset
41 }
785bbb619238 Basic allocation prefetching support
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff changeset
42
785bbb619238 Basic allocation prefetching support
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff changeset
43 @Override
785bbb619238 Basic allocation prefetching support
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff changeset
44 public void emitCode(CompilationResultBuilder crb, AMD64MacroAssembler masm) {
785bbb619238 Basic allocation prefetching support
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff changeset
45 switch (instr) {
785bbb619238 Basic allocation prefetching support
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff changeset
46 case 0:
785bbb619238 Basic allocation prefetching support
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff changeset
47 masm.prefetchnta(address.toAddress());
785bbb619238 Basic allocation prefetching support
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff changeset
48 break;
785bbb619238 Basic allocation prefetching support
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff changeset
49 case 1:
785bbb619238 Basic allocation prefetching support
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff changeset
50 masm.prefetcht0(address.toAddress());
785bbb619238 Basic allocation prefetching support
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff changeset
51 break;
785bbb619238 Basic allocation prefetching support
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff changeset
52 case 2:
785bbb619238 Basic allocation prefetching support
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff changeset
53 masm.prefetcht2(address.toAddress());
785bbb619238 Basic allocation prefetching support
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff changeset
54 break;
785bbb619238 Basic allocation prefetching support
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff changeset
55 case 3:
785bbb619238 Basic allocation prefetching support
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff changeset
56 masm.prefetchw(address.toAddress());
785bbb619238 Basic allocation prefetching support
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff changeset
57 break;
785bbb619238 Basic allocation prefetching support
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff changeset
58 default:
785bbb619238 Basic allocation prefetching support
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff changeset
59 throw GraalInternalError.shouldNotReachHere("unspported prefetch op " + instr);
785bbb619238 Basic allocation prefetching support
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff changeset
60
785bbb619238 Basic allocation prefetching support
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff changeset
61 }
785bbb619238 Basic allocation prefetching support
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff changeset
62 }
785bbb619238 Basic allocation prefetching support
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
diff changeset
63 }