Mercurial > hg > truffle
comparison graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotDebugInfoBuilder.java @ 8586:82f6a25321b8
modeling of lock state removed from LIR and runtime specific debug info for locks moved into runtime specific classes
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Fri, 29 Mar 2013 12:31:42 +0100 |
parents | |
children | b5eff8bd82da |
comparison
equal
deleted
inserted
replaced
8585:aaf3988bd1b4 | 8586:82f6a25321b8 |
---|---|
1 /* | |
2 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. | |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | |
4 * | |
5 * This code is free software; you can redistribute it and/or modify it | |
6 * under the terms of the GNU General Public License version 2 only, as | |
7 * published by the Free Software Foundation. | |
8 * | |
9 * This code is distributed in the hope that it will be useful, but WITHOUT | |
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
12 * version 2 for more details (a copy is included in the LICENSE file that | |
13 * accompanied this code). | |
14 * | |
15 * You should have received a copy of the GNU General Public License version | |
16 * 2 along with this work; if not, write to the Free Software Foundation, | |
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | |
18 * | |
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | |
20 * or visit www.oracle.com if you need additional information or have any | |
21 * questions. | |
22 */ | |
23 package com.oracle.graal.hotspot; | |
24 | |
25 import com.oracle.graal.api.code.*; | |
26 import com.oracle.graal.api.meta.*; | |
27 import com.oracle.graal.compiler.gen.*; | |
28 import com.oracle.graal.graph.*; | |
29 import com.oracle.graal.nodes.*; | |
30 import com.oracle.graal.nodes.virtual.*; | |
31 | |
32 /** | |
33 * Extends {@link DebugInfoBuilder} to allocate the extra debug information required for locks. | |
34 */ | |
35 public class HotSpotDebugInfoBuilder extends DebugInfoBuilder { | |
36 | |
37 private final HotSpotLockStack lockStack; | |
38 | |
39 public HotSpotDebugInfoBuilder(NodeMap<Value> nodeOperands, HotSpotLockStack lockStack) { | |
40 super(nodeOperands); | |
41 this.lockStack = lockStack; | |
42 } | |
43 | |
44 public HotSpotLockStack lockStack() { | |
45 return lockStack; | |
46 } | |
47 | |
48 @Override | |
49 protected Value computeLockValue(FrameState state, int i) { | |
50 int lockDepth = i; | |
51 for (FrameState outer = state.outerFrameState(); outer != null; outer = outer.outerFrameState()) { | |
52 lockDepth += outer.locksSize(); | |
53 } | |
54 StackSlot slot = lockStack.makeLockSlot(lockDepth); | |
55 ValueNode lock = state.lockAt(i); | |
56 Value object = toValue(lock); | |
57 boolean eliminated = lock instanceof VirtualObjectNode; | |
58 return new MonitorValue(object, slot, eliminated); | |
59 } | |
60 } |