Mercurial > hg > truffle
comparison truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/debug/TagBreakpointFactory.java @ 22066:78c3d3d8d86e
Clearly separating the TruffleLanguage definition from context used during its execution. TruffleLanguage now has to have public static field INSTANCE and override createContext method.
author | Jaroslav Tulach <jaroslav.tulach@oracle.com> |
---|---|
date | Thu, 06 Aug 2015 08:31:49 +0200 |
parents | 95d5d6a93968 |
children | c2cb9f1c8688 |
comparison
equal
deleted
inserted
replaced
22065:503529c65456 | 22066:78c3d3d8d86e |
---|---|
86 public int compare(Entry<SyntaxTag, TagBreakpointImpl> entry1, Entry<SyntaxTag, TagBreakpointImpl> entry2) { | 86 public int compare(Entry<SyntaxTag, TagBreakpointImpl> entry1, Entry<SyntaxTag, TagBreakpointImpl> entry2) { |
87 return entry1.getKey().name().compareTo(entry2.getKey().name()); | 87 return entry1.getKey().name().compareTo(entry2.getKey().name()); |
88 } | 88 } |
89 }; | 89 }; |
90 | 90 |
91 private final Debugger executionSupport; | |
92 private final BreakpointCallback breakpointCallback; | 91 private final BreakpointCallback breakpointCallback; |
93 private final WarningLog warningLog; | 92 private final WarningLog warningLog; |
94 | 93 |
95 /** | 94 /** |
96 * Map: Tags ==> Tag Breakpoints. There may be no more than one breakpoint per Tag. | 95 * Map: Tags ==> Tag Breakpoints. There may be no more than one breakpoint per Tag. |
102 * individual breakpoints are enabled. | 101 * individual breakpoints are enabled. |
103 */ | 102 */ |
104 @CompilationFinal private boolean breakpointsActive = true; | 103 @CompilationFinal private boolean breakpointsActive = true; |
105 private final CyclicAssumption breakpointsActiveUnchanged = new CyclicAssumption(BREAKPOINT_NAME + " globally active"); | 104 private final CyclicAssumption breakpointsActiveUnchanged = new CyclicAssumption(BREAKPOINT_NAME + " globally active"); |
106 | 105 |
107 TagBreakpointFactory(Debugger executionSupport, BreakpointCallback breakpointCallback, final WarningLog warningLog) { | 106 TagBreakpointFactory(BreakpointCallback breakpointCallback, final WarningLog warningLog) { |
108 this.executionSupport = executionSupport; | |
109 this.breakpointCallback = breakpointCallback; | 107 this.breakpointCallback = breakpointCallback; |
110 this.warningLog = warningLog; | 108 this.warningLog = warningLog; |
111 | 109 |
112 Probe.addProbeListener(new DefaultProbeListener() { | 110 Probe.addProbeListener(new DefaultProbeListener() { |
113 | 111 |
327 } | 325 } |
328 Instrument newInstrument = null; | 326 Instrument newInstrument = null; |
329 if (conditionExpr == null) { | 327 if (conditionExpr == null) { |
330 newInstrument = Instrument.create(new UnconditionalTagBreakInstrumentListener(), BREAKPOINT_NAME); | 328 newInstrument = Instrument.create(new UnconditionalTagBreakInstrumentListener(), BREAKPOINT_NAME); |
331 } else { | 329 } else { |
332 newInstrument = Instrument.create(this, executionSupport.createAdvancedInstrumentRootFactory(newProbe, conditionExpr, this), Boolean.class, BREAKPOINT_NAME); | 330 newInstrument = Instrument.create(this, Debugger.createAdvancedInstrumentRootFactory(newProbe, conditionExpr, this), Boolean.class, BREAKPOINT_NAME); |
333 } | 331 } |
334 newProbe.attach(newInstrument); | 332 newProbe.attach(newInstrument); |
335 instruments.add(newInstrument); | 333 instruments.add(newInstrument); |
336 changeState(isEnabled ? ENABLED : DISABLED); | 334 changeState(isEnabled ? ENABLED : DISABLED); |
337 } | 335 } |