Mercurial > hg > truffle
comparison graal/com.oracle.truffle.ruby.nodes/src/com/oracle/truffle/ruby/nodes/debug/InactiveEnterDebugProbe.java @ 13918:22bf5a8ba9eb
Ruby: restore prototype debugger.
author | Chris Seaton <chris.seaton@oracle.com> |
---|---|
date | Mon, 10 Feb 2014 03:39:21 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
13917:f2345d7c52ef | 13918:22bf5a8ba9eb |
---|---|
1 /* | |
2 * Copyright (c) 2013, 2014 Oracle and/or its affiliates. All rights reserved. This | |
3 * code is released under a tri EPL/GPL/LGPL license. You can use it, | |
4 * redistribute it and/or modify it under the terms of the: | |
5 * | |
6 * Eclipse Public License version 1.0 | |
7 * GNU General Public License version 2 | |
8 * GNU Lesser General Public License version 2.1 | |
9 */ | |
10 package com.oracle.truffle.ruby.nodes.debug; | |
11 | |
12 import com.oracle.truffle.api.*; | |
13 import com.oracle.truffle.api.frame.*; | |
14 import com.oracle.truffle.api.nodes.*; | |
15 import com.oracle.truffle.ruby.runtime.*; | |
16 | |
17 public abstract class InactiveEnterDebugProbe extends RubyProbe { | |
18 | |
19 private final Assumption inactiveAssumption; | |
20 | |
21 public InactiveEnterDebugProbe(RubyContext context, Assumption inactiveAssumption) { | |
22 super(context, false); | |
23 this.inactiveAssumption = inactiveAssumption; | |
24 } | |
25 | |
26 @Override | |
27 public void enter(Node astNode, VirtualFrame frame) { | |
28 try { | |
29 inactiveAssumption.check(); | |
30 } catch (InvalidAssumptionException e) { | |
31 final ActiveEnterDebugProbe activeNode = createActive(); | |
32 replace(activeNode); | |
33 activeNode.enter(astNode, frame); | |
34 } | |
35 } | |
36 | |
37 protected abstract ActiveEnterDebugProbe createActive(); | |
38 | |
39 } |