File tree Expand file tree Collapse file tree 3 files changed +15
-7
lines changed
src/main/java/org/truffleruby/core Expand file tree Collapse file tree 3 files changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,11 @@ public final class CoreSymbols {
47
47
public final RubySymbol DECONSTRUCT = createRubySymbol ("deconstruct" );
48
48
public final RubySymbol DECONSTRUCT_KEYS = createRubySymbol ("deconstruct_keys" );
49
49
50
+ public final RubySymbol RUN = createRubySymbol ("run" );
51
+ public final RubySymbol SLEEP = createRubySymbol ("sleep" );
52
+ public final RubySymbol ABORTING = createRubySymbol ("aborting" );
53
+ public final RubySymbol DEAD = createRubySymbol ("dead" );
54
+
50
55
// Added to workaround liquid's no symbols leaked test (SecurityTest#test_does_not_permanently_add_filters_to_symbol_table)
51
56
public final RubySymbol IMMEDIATE_SWEEP = createRubySymbol ("immediate_sweep" );
52
57
public final RubySymbol IMMEDIATE_MARK = createRubySymbol ("immediate_mark" );
Original file line number Diff line number Diff line change @@ -592,19 +592,17 @@ public abstract static class ThreadSetStatusPrimitiveNode extends PrimitiveArray
592
592
@ Specialization
593
593
Object threadSetStatus (RubyThread thread , RubySymbol status ) {
594
594
ThreadStatus current = thread .status ;
595
- String newName = status .getString ();
596
595
597
- if (newName . equals ( "run" ) ) {
596
+ if (status == coreSymbols (). RUN ) {
598
597
thread .status = ThreadStatus .RUN ;
599
- } else if (newName . equals ( "sleep" ) ) {
598
+ } else if (status == coreSymbols (). SLEEP ) {
600
599
thread .status = ThreadStatus .SLEEP ;
601
- } else if (newName . equals ( "aborting" ) ) {
600
+ } else if (status == coreSymbols (). ABORTING ) {
602
601
thread .status = ThreadStatus .ABORTING ;
603
- } else if (newName . equals ( "dead" ) ) {
602
+ } else if (status == coreSymbols (). DEAD ) {
604
603
thread .status = ThreadStatus .DEAD ;
605
604
} else {
606
- throw new RaiseException (getContext (),
607
- coreExceptions ().argumentError ("Unknown thread status: " + newName , this ));
605
+ throw CompilerDirectives .shouldNotReachHere ("Unknown thread status: " + status );
608
606
}
609
607
610
608
String currentName = StringUtils .toLowerCase (current .name ());
Original file line number Diff line number Diff line change 66
66
public final RubySymbol DECONSTRUCT = createRubySymbol("deconstruct");
67
67
public final RubySymbol DECONSTRUCT_KEYS = createRubySymbol("deconstruct_keys");
68
68
69
+ public final RubySymbol RUN = createRubySymbol("run");
70
+ public final RubySymbol SLEEP = createRubySymbol("sleep");
71
+ public final RubySymbol ABORTING = createRubySymbol("aborting");
72
+ public final RubySymbol DEAD = createRubySymbol("dead");
73
+
69
74
// Added to workaround liquid's no symbols leaked test (SecurityTest#test_does_not_permanently_add_filters_to_symbol_table)
70
75
public final RubySymbol IMMEDIATE_SWEEP = createRubySymbol("immediate_sweep");
71
76
public final RubySymbol IMMEDIATE_MARK = createRubySymbol("immediate_mark");
You can’t perform that action at this time.
0 commit comments