Mercurial > hg > truffle
comparison graal/com.oracle.graal.graph/src/com/oracle/graal/graph/NodeClass.java @ 21543:93c50cefb9e8
moved GraalInternalError to com.oracle.jvmci.common and renamed it to JVMCIError (JBS:GRAAL-53)
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Mon, 25 May 2015 23:30:34 +0200 |
parents | 5e868236654f |
children | b1530a6cce8c |
comparison
equal
deleted
inserted
replaced
21542:543957c1c6a6 | 21543:93c50cefb9e8 |
---|---|
21 * questions. | 21 * questions. |
22 */ | 22 */ |
23 package com.oracle.graal.graph; | 23 package com.oracle.graal.graph; |
24 | 24 |
25 import static com.oracle.graal.compiler.common.Fields.*; | 25 import static com.oracle.graal.compiler.common.Fields.*; |
26 import static com.oracle.graal.compiler.common.GraalInternalError.*; | |
27 import static com.oracle.graal.graph.Edges.*; | 26 import static com.oracle.graal.graph.Edges.*; |
28 import static com.oracle.graal.graph.InputEdges.*; | 27 import static com.oracle.graal.graph.InputEdges.*; |
29 import static com.oracle.graal.graph.Node.*; | 28 import static com.oracle.graal.graph.Node.*; |
29 import static com.oracle.jvmci.common.JVMCIError.*; | |
30 | 30 |
31 import java.lang.annotation.*; | 31 import java.lang.annotation.*; |
32 import java.lang.reflect.*; | 32 import java.lang.reflect.*; |
33 import java.util.*; | 33 import java.util.*; |
34 import java.util.concurrent.atomic.*; | 34 import java.util.concurrent.atomic.*; |
365 if (inputAnnotation != null || optionalInputAnnotation != null) { | 365 if (inputAnnotation != null || optionalInputAnnotation != null) { |
366 assert successorAnnotation == null : "field cannot be both input and successor"; | 366 assert successorAnnotation == null : "field cannot be both input and successor"; |
367 if (INPUT_LIST_CLASS.isAssignableFrom(type)) { | 367 if (INPUT_LIST_CLASS.isAssignableFrom(type)) { |
368 // NodeInputList fields should not be final since they are | 368 // NodeInputList fields should not be final since they are |
369 // written (via Unsafe) in clearInputs() | 369 // written (via Unsafe) in clearInputs() |
370 GraalInternalError.guarantee(!Modifier.isFinal(modifiers), "NodeInputList input field %s should not be final", field); | 370 JVMCIError.guarantee(!Modifier.isFinal(modifiers), "NodeInputList input field %s should not be final", field); |
371 GraalInternalError.guarantee(!Modifier.isPublic(modifiers), "NodeInputList input field %s should not be public", field); | 371 JVMCIError.guarantee(!Modifier.isPublic(modifiers), "NodeInputList input field %s should not be public", field); |
372 } else { | 372 } else { |
373 GraalInternalError.guarantee(NODE_CLASS.isAssignableFrom(type) || type.isInterface(), "invalid input type: %s", type); | 373 JVMCIError.guarantee(NODE_CLASS.isAssignableFrom(type) || type.isInterface(), "invalid input type: %s", type); |
374 GraalInternalError.guarantee(!Modifier.isFinal(modifiers), "Node input field %s should not be final", field); | 374 JVMCIError.guarantee(!Modifier.isFinal(modifiers), "Node input field %s should not be final", field); |
375 directInputs++; | 375 directInputs++; |
376 } | 376 } |
377 InputType inputType; | 377 InputType inputType; |
378 if (inputAnnotation != null) { | 378 if (inputAnnotation != null) { |
379 assert optionalInputAnnotation == null : "inputs can either be optional or non-optional"; | 379 assert optionalInputAnnotation == null : "inputs can either be optional or non-optional"; |
384 inputs.add(new InputInfo(offset, field.getName(), type, field.getDeclaringClass(), inputType, field.isAnnotationPresent(Node.OptionalInput.class))); | 384 inputs.add(new InputInfo(offset, field.getName(), type, field.getDeclaringClass(), inputType, field.isAnnotationPresent(Node.OptionalInput.class))); |
385 } else if (successorAnnotation != null) { | 385 } else if (successorAnnotation != null) { |
386 if (SUCCESSOR_LIST_CLASS.isAssignableFrom(type)) { | 386 if (SUCCESSOR_LIST_CLASS.isAssignableFrom(type)) { |
387 // NodeSuccessorList fields should not be final since they are | 387 // NodeSuccessorList fields should not be final since they are |
388 // written (via Unsafe) in clearSuccessors() | 388 // written (via Unsafe) in clearSuccessors() |
389 GraalInternalError.guarantee(!Modifier.isFinal(modifiers), "NodeSuccessorList successor field % should not be final", field); | 389 JVMCIError.guarantee(!Modifier.isFinal(modifiers), "NodeSuccessorList successor field % should not be final", field); |
390 GraalInternalError.guarantee(!Modifier.isPublic(modifiers), "NodeSuccessorList successor field %s should not be public", field); | 390 JVMCIError.guarantee(!Modifier.isPublic(modifiers), "NodeSuccessorList successor field %s should not be public", field); |
391 } else { | 391 } else { |
392 GraalInternalError.guarantee(NODE_CLASS.isAssignableFrom(type), "invalid successor type: %s", type); | 392 JVMCIError.guarantee(NODE_CLASS.isAssignableFrom(type), "invalid successor type: %s", type); |
393 GraalInternalError.guarantee(!Modifier.isFinal(modifiers), "Node successor field %s should not be final", field); | 393 JVMCIError.guarantee(!Modifier.isFinal(modifiers), "Node successor field %s should not be final", field); |
394 directSuccessors++; | 394 directSuccessors++; |
395 } | 395 } |
396 successors.add(new EdgeInfo(offset, field.getName(), type, field.getDeclaringClass())); | 396 successors.add(new EdgeInfo(offset, field.getName(), type, field.getDeclaringClass())); |
397 } else { | 397 } else { |
398 GraalInternalError.guarantee(!NODE_CLASS.isAssignableFrom(type) || field.getName().equals("Null"), "suspicious node field: %s", field); | 398 JVMCIError.guarantee(!NODE_CLASS.isAssignableFrom(type) || field.getName().equals("Null"), "suspicious node field: %s", field); |
399 GraalInternalError.guarantee(!INPUT_LIST_CLASS.isAssignableFrom(type), "suspicious node input list field: %s", field); | 399 JVMCIError.guarantee(!INPUT_LIST_CLASS.isAssignableFrom(type), "suspicious node input list field: %s", field); |
400 GraalInternalError.guarantee(!SUCCESSOR_LIST_CLASS.isAssignableFrom(type), "suspicious node successor list field: %s", field); | 400 JVMCIError.guarantee(!SUCCESSOR_LIST_CLASS.isAssignableFrom(type), "suspicious node successor list field: %s", field); |
401 super.scanField(field, offset); | 401 super.scanField(field, offset); |
402 } | 402 } |
403 } | 403 } |
404 } | 404 } |
405 } | 405 } |