56
56
import com .oracle .graal .python .builtins .objects .str .StringNodes ;
57
57
import com .oracle .graal .python .builtins .objects .type .PythonBuiltinClass ;
58
58
import com .oracle .graal .python .nodes .bytecode .PBytecodeGeneratorFunctionRootNode ;
59
+ import com .oracle .graal .python .nodes .bytecode .PBytecodeRootNode ;
59
60
import com .oracle .graal .python .nodes .expression .BinaryOp ;
60
61
import com .oracle .graal .python .nodes .generator .GeneratorFunctionRootNode ;
61
62
import com .oracle .graal .python .runtime .PythonContext ;
@@ -216,7 +217,6 @@ static boolean doCode(PCode left, PCode right,
216
217
RootCallTarget leftCt = getCt .execute (left );
217
218
RootCallTarget rightCt = getCt .execute (right );
218
219
if (leftCt != null && rightCt != null ) {
219
- // TODO: handle splitting, i.e., cloned root nodes
220
220
RootNode leftRootNode = leftCt .getRootNode ();
221
221
RootNode rightRootNode = rightCt .getRootNode ();
222
222
if (leftRootNode instanceof GeneratorFunctionRootNode ) {
@@ -229,6 +229,11 @@ static boolean doCode(PCode left, PCode right,
229
229
} else if (rightRootNode instanceof PBytecodeGeneratorFunctionRootNode ) {
230
230
rightRootNode = ((PBytecodeGeneratorFunctionRootNode ) rightRootNode ).getBytecodeRootNode ();
231
231
}
232
+ if (PythonContext .get (getCt ).getOption (PythonOptions .EnableBytecodeInterpreter )) {
233
+ if (leftRootNode instanceof PBytecodeRootNode && rightRootNode instanceof PBytecodeRootNode ) {
234
+ return ((PBytecodeRootNode ) leftRootNode ).getCodeUnit () == ((PBytecodeRootNode ) rightRootNode ).getCodeUnit ();
235
+ }
236
+ }
232
237
return leftRootNode == rightRootNode ;
233
238
} else {
234
239
return false ;
0 commit comments