# HG changeset patch # User Thomas Wuerthinger # Date 1308569685 -7200 # Node ID 94f3ffcc5c2a5dd2bd6814ff61223e3de245351c # Parent 79165996a12d03ba46a858882e1f0ed428d61eeb Removed the graph project from graalvm repository. diff -r 79165996a12d -r 94f3ffcc5c2a graal/com.oracle.max.graal.graph/.checkstyle --- a/graal/com.oracle.max.graal.graph/.checkstyle Mon Jun 20 12:07:16 2011 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ - - - - - - - - - - diff -r 79165996a12d -r 94f3ffcc5c2a graal/com.oracle.max.graal.graph/.classpath --- a/graal/com.oracle.max.graal.graph/.classpath Mon Jun 20 12:07:16 2011 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,9 +0,0 @@ - - - - - - - - - diff -r 79165996a12d -r 94f3ffcc5c2a graal/com.oracle.max.graal.graph/.project --- a/graal/com.oracle.max.graal.graph/.project Mon Jun 20 12:07:16 2011 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +0,0 @@ - - - com.oracle.max.graal.graph - - - - - - org.eclipse.jdt.core.javabuilder - - - - - net.sf.eclipsecs.core.CheckstyleBuilder - - - - - - org.eclipse.jdt.core.javanature - net.sf.eclipsecs.core.CheckstyleNature - - diff -r 79165996a12d -r 94f3ffcc5c2a graal/com.oracle.max.graal.graph/.settings/org.eclipse.jdt.core.prefs --- a/graal/com.oracle.max.graal.graph/.settings/org.eclipse.jdt.core.prefs Mon Jun 20 12:07:16 2011 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,270 +0,0 @@ -#Wed Apr 27 22:10:44 CEST 2011 -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.6 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.6 -org.eclipse.jdt.core.formatter.align_type_members_on_columns=false -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_assignment=0 -org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 -org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 -org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 -org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 -org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 -org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_after_package=1 -org.eclipse.jdt.core.formatter.blank_lines_before_field=0 -org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=1 -org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 -org.eclipse.jdt.core.formatter.blank_lines_before_method=1 -org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 -org.eclipse.jdt.core.formatter.blank_lines_before_package=0 -org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 -org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 -org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false -org.eclipse.jdt.core.formatter.comment.format_block_comments=true -org.eclipse.jdt.core.formatter.comment.format_header=true -org.eclipse.jdt.core.formatter.comment.format_html=true -org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true -org.eclipse.jdt.core.formatter.comment.format_line_comments=true -org.eclipse.jdt.core.formatter.comment.format_source_code=true -org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true -org.eclipse.jdt.core.formatter.comment.indent_root_tags=true -org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert -org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert -org.eclipse.jdt.core.formatter.comment.line_length=120 -org.eclipse.jdt.core.formatter.compact_else_if=true -org.eclipse.jdt.core.formatter.continuation_indentation=4 -org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=4 -org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true -org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_empty_lines=false -org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true -org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true -org.eclipse.jdt.core.formatter.indentation.size=8 -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert -org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.join_lines_in_comments=true -org.eclipse.jdt.core.formatter.join_wrapped_lines=true -org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false -org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=true -org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false -org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false -org.eclipse.jdt.core.formatter.lineSplit=200 -org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=true -org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=true -org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 -org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 -org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true -org.eclipse.jdt.core.formatter.tabulation.char=space -org.eclipse.jdt.core.formatter.tabulation.size=4 -org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false -org.eclipse.jdt.core.formatter.wrap_before_binary_operator=false diff -r 79165996a12d -r 94f3ffcc5c2a graal/com.oracle.max.graal.graph/.settings/org.eclipse.jdt.ui.prefs --- a/graal/com.oracle.max.graal.graph/.settings/org.eclipse.jdt.ui.prefs Mon Jun 20 12:07:16 2011 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,4 +0,0 @@ -#Wed Apr 27 22:10:44 CEST 2011 -eclipse.preferences.version=1 -formatter_profile=_C1XJavaCodeStyle -formatter_settings_version=11 diff -r 79165996a12d -r 94f3ffcc5c2a graal/com.oracle.max.graal.graph/src/com/oracle/max/graal/graph/EdgeType.java --- a/graal/com.oracle.max.graal.graph/src/com/oracle/max/graal/graph/EdgeType.java Mon Jun 20 12:07:16 2011 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.oracle.max.graal.graph; - - -public enum EdgeType { - INPUTS, - USAGES, - PREDECESSORS, - SUCCESSORS; -} diff -r 79165996a12d -r 94f3ffcc5c2a graal/com.oracle.max.graal.graph/src/com/oracle/max/graal/graph/Graph.java --- a/graal/com.oracle.max.graal.graph/src/com/oracle/max/graal/graph/Graph.java Mon Jun 20 12:07:16 2011 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,222 +0,0 @@ -/* - * Copyright (c) 2011, 2011, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.oracle.max.graal.graph; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; - -public class Graph { - - public static final List verificationListeners = new ArrayList(4); - - private final ArrayList nodes; - private final StartNode start; - int nextId; - int deletedNodeCount; - - static int nextGraphId = 0; - int id = nextGraphId++; - - @Override - public String toString() { - return "Graph " + id; - } - - public Graph() { - nodes = new ArrayList(); - start = new StartNode(this); - } - - public int getDeletedNodeCount() { - return deletedNodeCount; - } - - public int getNodeCount() { - return nodes.size() - getDeletedNodeCount(); - } - - public List getNodes() { - return Collections.unmodifiableList(nodes); - } - - public class TypedNodeIterator implements Iterator { - private final Class type; - private int index; - - public TypedNodeIterator(Class type) { - this.type = type; - this.index = -1; - forward(); - } - - private void forward() { - if (index < nodes.size()) { - do { - index++; - } while (index < nodes.size() && !type.isInstance(nodes.get(index))); - if (index >= nodes.size()) { - index = Integer.MAX_VALUE; - } - } - } - - @Override - public boolean hasNext() { - return index < nodes.size(); - } - - @Override - @SuppressWarnings("unchecked") - public T next() { - try { - return (T) nodes.get(index); - } finally { - forward(); - } - } - - @Override - public void remove() { - throw new UnsupportedOperationException(); - } - } - - public Iterable getNodes(final Class type) { - return new Iterable() { - @Override - public Iterator iterator() { - return new TypedNodeIterator(type); - } - }; - } - - int register(Node node) { - int id = nextId++; - nodes.add(id, node); - return id; - } - - void unregister(Node node) { - nodes.set(node.id(), Node.Null); - deletedNodeCount++; - } - - public StartNode start() { - return start; - } - - public NodeBitMap createNodeBitMap() { - return new NodeBitMap(this); - } - - public NodeMap createNodeMap() { - return new NodeMap(this); - } - - public NodeFlood createNodeFlood() { - return new NodeFlood(this); - } - - public NodeWorkList createNodeWorkList() { - return new NodeWorkList(this); - } - - public NodeWorkList createNodeWorkList(boolean fill, int iterationLimitPerNode) { - return new NodeWorkList(this, fill, iterationLimitPerNode); - } - - public boolean verify() { - for (Node n : getNodes()) { - assert n == Node.Null || n.verify(); - } - return true; - } - - public Map addDuplicate(Collection nodes, Map replacements) { - Map newNodes = new HashMap(); - // create node duplicates - for (Node node : nodes) { - if (node != null && !replacements.containsKey(node)) { - assert node.graph != this; - assert !node.isDeleted() : "trying to duplicate deleted node"; - Node newNode = node.copy(this); - assert newNode.getClass() == node.getClass(); - newNodes.put(node, newNode); - } - } - // re-wire inputs - for (Entry entry : newNodes.entrySet()) { - Node oldNode = entry.getKey(); - Node node = entry.getValue(); - for (int i = 0; i < oldNode.inputs().size(); i++) { - Node input = oldNode.inputs().get(i); - Node target = replacements.get(input); - if (target == null) { - target = newNodes.get(input); - } - node.inputs().setOrExpand(i, target); - } - } - for (Entry entry : replacements.entrySet()) { - Node oldNode = entry.getKey(); - Node node = entry.getValue(); - for (int i = 0; i < oldNode.inputs().size(); i++) { - Node input = oldNode.inputs().get(i); - if (newNodes.containsKey(input)) { - node.inputs().setOrExpand(i, newNodes.get(input)); - } - } - } - - // re-wire successors - for (Entry entry : newNodes.entrySet()) { - Node oldNode = entry.getKey(); - Node node = entry.getValue(); - for (int i = 0; i < oldNode.successors().size(); i++) { - Node succ = oldNode.successors().get(i); - Node target = replacements.get(succ); - if (target == null) { - target = newNodes.get(succ); - } - node.successors().setOrExpand(i, target); - } - } - for (Entry entry : replacements.entrySet()) { - Node oldNode = entry.getKey(); - Node node = entry.getValue(); - for (int i = 0; i < oldNode.successors().size(); i++) { - Node succ = oldNode.successors().get(i); - if (newNodes.containsKey(succ)) { - node.successors().setOrExpand(i, newNodes.get(succ)); - } - } - } - return newNodes; - } -} diff -r 79165996a12d -r 94f3ffcc5c2a graal/com.oracle.max.graal.graph/src/com/oracle/max/graal/graph/Node.java --- a/graal/com.oracle.max.graal.graph/src/com/oracle/max/graal/graph/Node.java Mon Jun 20 12:07:16 2011 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,226 +0,0 @@ -/* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.oracle.max.graal.graph; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public abstract class Node { - - public static final Node Null = null; - public static final int DeletedID = -1; - - final Graph graph; - private int id; - final NodeArray inputs; - final NodeArray successors; - final ArrayList usages; - final ArrayList predecessors; - - public Node(int inputCount, int successorCount, Graph graph) { - assert graph != null : "cannot create a node for a null graph"; - this.graph = graph; - this.id = graph.register(this); - this.inputs = new NodeArray(this, inputCount); - this.successors = new NodeArray(this, successorCount); - this.predecessors = new ArrayList(1); - this.usages = new ArrayList(4); - } - - public List predecessors() { - return Collections.unmodifiableList(predecessors); - } - - public List usages() { - return Collections.unmodifiableList(usages); - } - - public NodeArray inputs() { - return inputs; - } - - public NodeArray successors() { - return successors; - } - - public int id() { - return id; - } - - public Graph graph() { - return graph; - } - - public T lookup(Class clazz) { - return null; - } - - public String shortName() { - return getClass().getSimpleName(); - } - - public Node replace(Node other) { - assert !isDeleted() && (other == null || !other.isDeleted()) : "id: " + id() + ", other: " + other; - assert other == null || other.graph == graph; - for (Node usage : usages) { - usage.inputs.replaceFirstOccurrence(this, other); - } - int z = 0; - for (Node predecessor : predecessors) { - for (int i = 0; i < predecessor.successors.size(); i++) { - if (predecessor.successors.get(i) == this) { - predecessor.successors.silentSet(i, other); - } - } - ++z; - } - if (other != null) { - other.usages.addAll(usages); - other.predecessors.addAll(predecessors); - } - usages.clear(); - predecessors.clear(); - delete(); - assert other == null || other.verify(); - return other; - } - - public boolean isDeleted() { - return id == DeletedID; - } - - public void forceDelete() { - for (Node n : usages) { - n.inputs.silentRemove(this); - } - for (Node n : predecessors) { - n.successors.silentRemove(this); - } - usages.clear(); - predecessors.clear(); - } - - public void unsafeDelete() { - graph.unregister(this); - id = DeletedID; - assert isDeleted(); - } - - public void delete() { - assert !isDeleted(); - assert checkDeletion() : "Could not delete " + this + " (usages: " + this.usages() + ", predecessors: " + this.predecessors() + ")"; - - for (int i = 0; i < inputs.size(); ++i) { - inputs.set(i, Null); - } - for (int i = 0; i < successors.size(); ++i) { - successors.set(i, Null); - } - assert predecessors().size() == 0 && usages().size() == 0; - unsafeDelete(); - } - - private boolean checkDeletion() { - if (usages.size() != 0 || predecessors.size() != 0) { - System.out.println(this.shortName() + ", id: " + id + ", usages: " + usages.size() + ", predecessors: " + predecessors().size()); - System.out.println("usages:"); - for (Node n : usages()) { - System.out.print(n.id() + " (" + n.shortName() + ") "); - } - System.out.println("\npreds:"); - for (Node n : predecessors()) { - System.out.print(n.id() + " (" + n.shortName() + ") "); - } - System.out.println(); - return false; - } - return true; - } - - public final Node copy() { - return copy(graph); - } - - /** - * - * @param into - * @return - */ - public abstract Node copy(Graph into); - - /** - * - * @return - */ - protected int inputCount() { - return 0; - } - - /** - * - * @return - */ - protected int successorCount() { - return 0; - } - - /** - * Provides a {@link Map} of properties of this node for use in debugging (e.g., to view in the ideal graph - * visualizer). Subclasses overriding this method should add to the map returned by their superclass. - */ - public Map getDebugProperties() { - Map map = new HashMap(); - map.put("inputCount", inputCount()); - map.put("usageCount", usages.size()); - map.put("successorCount", successorCount()); - map.put("predecessorCount", predecessors.size()); - return map; - } - - @Override - public String toString() { - return this.getClass().getSimpleName() + "-" + this.id(); - } - - public boolean verify() { - return true; - } - - public final void assertTrue(boolean cond) { - assert cond || assertionFailure(""); - } - - public final void assertTrue(boolean cond, String message) { - assert cond || assertionFailure(message); - } - - public final boolean assertionFailure(String message) { - for (VerificationListener l : Graph.verificationListeners) { - l.verificationFailed(this, message); - } - return true; - } -} diff -r 79165996a12d -r 94f3ffcc5c2a graal/com.oracle.max.graal.graph/src/com/oracle/max/graal/graph/NodeArray.java --- a/graal/com.oracle.max.graal.graph/src/com/oracle/max/graal/graph/NodeArray.java Mon Jun 20 12:07:16 2011 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,232 +0,0 @@ -/* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.oracle.max.graal.graph; - -import java.util.AbstractList; -import java.util.Arrays; -import java.util.Iterator; - -public class NodeArray extends AbstractList { - - private final Node node; - private Node[] nodes; - private final int fixedLength; - private int variableLength; - - public NodeArray(Node node, int length) { - this.node = node; - this.nodes = new Node[length]; - this.fixedLength = length; - } - - @Override - public Iterator iterator() { - return Arrays.asList(this.nodes).iterator(); - } - - private Node self() { - return this.node; - } - - Node silentSet(int index, Node node) { - Node result = nodes[index]; - nodes[index] = node; - return result; - } - - public AbstractList variablePart() { - return new AbstractList() { - - @Override - public Node get(int index) { - checkIndex(index); - return NodeArray.this.get(fixedLength + index); - } - - @Override - public int size() { - return variableLength; - } - - public Node set(int index, Node element) { - checkIndex(index); - return NodeArray.this.set(fixedLength + index, element); - } - - public void add(int index, Node element) { - variableLength++; - checkIndex(index); - NodeArray.this.ensureSize(); - for (int i = size() - 1; i > index; i--) { - NodeArray.this.nodes[fixedLength + i] = NodeArray.this.nodes[fixedLength + i - 1]; - } - set(index, element); - } - - private void checkIndex(int index) { - if (index < 0 || index >= size()) { - throw new IndexOutOfBoundsException(); - } - } - - @Override - public Node remove(int index) { - checkIndex(index); - Node n = get(index); - set(index, Node.Null); - for (int i = index; i < size() - 1; i++) { - NodeArray.this.nodes[fixedLength + i] = NodeArray.this.nodes[fixedLength + i + 1]; - } - NodeArray.this.nodes[fixedLength + size() - 1] = Node.Null; - variableLength--; - assert variableLength >= 0; - return n; - } - }; - } - - private void ensureSize() { - if (size() > nodes.length) { - nodes = Arrays.copyOf(nodes, (nodes.length + 1) * 2); - } - } - - public void setOrExpand(int index, Node node) { - if (index < 0) { - throw new IndexOutOfBoundsException(); - } - - while (index >= size()) { - variablePart().add(Node.Null); - } - - set(index, node); - } - - @Override - public Node set(int index, Node node) { - assert !self().isDeleted() : "trying to set input/successor of deleted node: " + self().shortName(); - assert node == Node.Null || node.graph == self().graph : "node is from different graph: (this=" + self() + ") and (node=" + node + ")"; - assert node == Node.Null || node.id() != Node.DeletedID : "inserted node must not be deleted"; - assert node != self() || node.getClass().toString().contains("Phi") : "No direct circles allowed in the graph! " + node; - - Node old = get(index); - if (old != node) { - silentSet(index, node); - if (self().inputs == this) { - if (old != null) { - old.usages.remove(self()); - } - if (node != null) { - node.usages.add(self()); - } - } else { - assert self().successors == this; - if (old != null) { - old.predecessors.remove(self()); - } - if (node != null) { - node.predecessors.add(self()); - } - } - } - - return old; - } - - public void setAll(NodeArray other) { - assert size() == other.size(); - for (int i = 0; i < other.size(); i++) { - set(i, other.get(i)); - } - } - - private void checkIndex(int index) { - if (index < 0 || index >= size()) { - throw new IndexOutOfBoundsException(); - } - } - - @Override - public Node get(int index) { - checkIndex(index); - assert !self().isDeleted(); - return nodes[index]; - } - - @Override - public Node[] toArray() { - return Arrays.copyOf(nodes, size()); - } - - boolean replaceFirstOccurrence(Node toReplace, Node replacement) { - for (int i = 0; i < size(); i++) { - if (nodes[i] == toReplace) { - nodes[i] = replacement; - return true; - } - } - return false; - } - - public int remove(Node n) { - return replace(n, null); - } - - public int replace(Node toReplace, Node replacement) { - int result = 0; - for (int i = 0; i < size(); i++) { - if (nodes[i] == toReplace) { - set(i, replacement); - result++; - } - } - return result; - } - - int silentRemove(Node n) { - return silentReplace(n, null); - } - - int silentReplace(Node toReplace, Node replacement) { - int result = 0; - for (int i = 0; i < size(); i++) { - if (nodes[i] == toReplace) { - silentSet(i, replacement); - result++; - } - } - return result; - } - - @Override - public int size() { - return fixedLength + variableLength; - } - - public void clearAll() { - for (int i = 0; i < size(); i++) { - set(i, Node.Null); - } - } -} diff -r 79165996a12d -r 94f3ffcc5c2a graal/com.oracle.max.graal.graph/src/com/oracle/max/graal/graph/NodeBitMap.java --- a/graal/com.oracle.max.graal.graph/src/com/oracle/max/graal/graph/NodeBitMap.java Mon Jun 20 12:07:16 2011 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,87 +0,0 @@ -/* - * Copyright (c) 2011, 2011, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.oracle.max.graal.graph; - -import com.sun.cri.ci.CiBitMap; - - -public final class NodeBitMap { - - private final CiBitMap bitMap; - private final Graph graph; - - NodeBitMap(Graph graph) { - this.graph = graph; - bitMap = new CiBitMap(graph.nextId); - } - - public Graph graph() { - return graph; - } - - public boolean setIntersect(NodeBitMap other) { - return bitMap.setIntersect(other.bitMap); - } - - public void setUnion(NodeBitMap other) { - bitMap.setUnion(other.bitMap); - } - - public boolean isMarked(Node node) { - check(node); - return bitMap.get(node.id()); - } - - public boolean isNew(Node node) { - return node.id() >= bitMap.size(); - } - - public void mark(Node node) { - check(node); - bitMap.set(node.id()); - } - - public void clear(Node node) { - check(node); - bitMap.clear(node.id()); - } - - public void clearAll() { - bitMap.clearAll(); - } - - public void grow(Node node) { - bitMap.grow(node.id() + 1); - } - - private void check(Node node) { - assert node.graph == graph : "this node is not part of the graph"; - assert !isNew(node) : "this node (" + node.id() + ") was added to the graph after creating the node bitmap (" + bitMap.length() + ")"; - assert !node.isDeleted() : "node " + node + " is deleted!"; - } - - @Override - public String toString() { - return bitMap.toBinaryString(-1); - } -} diff -r 79165996a12d -r 94f3ffcc5c2a graal/com.oracle.max.graal.graph/src/com/oracle/max/graal/graph/NodeFlood.java --- a/graal/com.oracle.max.graal.graph/src/com/oracle/max/graal/graph/NodeFlood.java Mon Jun 20 12:07:16 2011 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,128 +0,0 @@ -/* - * Copyright (c) 2011, 2011, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.oracle.max.graal.graph; - -import java.util.ArrayDeque; -import java.util.Iterator; -import java.util.Queue; - - -public class NodeFlood implements Iterable { - private final NodeBitMap visited; - private final Queue worklist; - - NodeFlood(Graph graph) { - visited = graph.createNodeBitMap(); - worklist = new ArrayDeque(); - } - - public void add(Node node) { - if (node != null && !visited.isMarked(node)) { - visited.mark(node); - worklist.add(node); - } - } - - public boolean isMarked(Node node) { - return visited.isMarked(node); - } - - private static class QueueConsumingIterator implements Iterator { - private final Queue queue; - - public QueueConsumingIterator(Queue queue) { - this.queue = queue; - } - - @Override - public boolean hasNext() { - return !queue.isEmpty(); - } - - @Override - public Node next() { - return queue.remove(); - } - - @Override - public void remove() { - throw new UnsupportedOperationException(); - } - } - - @Override - public Iterator iterator() { - return new QueueConsumingIterator(worklist); - } - - private static class UnmarkedNodeIterator implements Iterator { - private final NodeBitMap visited; - private Iterator nodes; - private Node nextNode; - - public UnmarkedNodeIterator(NodeBitMap visited, Iterator nodes) { - this.visited = visited; - this.nodes = nodes; - forward(); - } - - private void forward() { - do { - if (!nodes.hasNext()) { - nextNode = null; - return; - } - nextNode = nodes.next(); - } while (visited.isMarked(nextNode)); - } - - @Override - public boolean hasNext() { - return nextNode != null; - } - - @Override - public Node next() { - try { - return nextNode; - } finally { - forward(); - } - } - - @Override - public void remove() { - throw new UnsupportedOperationException(); - } - - } - - public Iterable unmarkedNodes() { - return new Iterable() { - @Override - public Iterator iterator() { - return new UnmarkedNodeIterator(visited, visited.graph().getNodes().iterator()); - } - }; - } -} diff -r 79165996a12d -r 94f3ffcc5c2a graal/com.oracle.max.graal.graph/src/com/oracle/max/graal/graph/NodeIterator.java --- a/graal/com.oracle.max.graal.graph/src/com/oracle/max/graal/graph/NodeIterator.java Mon Jun 20 12:07:16 2011 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,78 +0,0 @@ -/* - * Copyright (c) 2011, 2011, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.oracle.max.graal.graph; - -import java.util.LinkedList; -import java.util.List; - - -public class NodeIterator { - public static NodeBitMap iterate(EdgeType e, Node start, NodeBitMap constraint, NodeVisitor visitor) { - LinkedList nodes = new LinkedList(); - NodeBitMap nodeBitMap = start.graph.createNodeBitMap(); - - add(nodes, nodeBitMap, start, constraint, null); - while (nodes.size() > 0) { - Node n = nodes.remove(); - if (visitor != null) { - boolean followEdges = visitor.visit(n); - if (!followEdges) { - continue; - } - } - switch(e) { - case INPUTS: - for (Node inputs : n.inputs()) { - add(nodes, nodeBitMap, inputs, constraint, n.usages()); - } - break; - case USAGES: - for (Node usage : n.usages()) { - add(nodes, nodeBitMap, usage, constraint, n.inputs()); - } - break; - case PREDECESSORS: - for (Node preds : n.predecessors()) { - add(nodes, nodeBitMap, preds, constraint, n.successors()); - } - break; - case SUCCESSORS: - for (Node succ : n.successors()) { - add(nodes, nodeBitMap, succ, constraint, n.predecessors()); - } - break; - default: - assert false : "unknown edge type"; - } - } - - return nodeBitMap; - } - - private static void add(List nodes, NodeBitMap nodeBitMap, Node node, NodeBitMap constraint, List others) { - if (node != null && !nodeBitMap.isMarked(node) && (constraint == null || constraint.isMarked(node))) { - nodes.add(node); - nodeBitMap.mark(node); - } - } -} diff -r 79165996a12d -r 94f3ffcc5c2a graal/com.oracle.max.graal.graph/src/com/oracle/max/graal/graph/NodeMap.java --- a/graal/com.oracle.max.graal.graph/src/com/oracle/max/graal/graph/NodeMap.java Mon Jun 20 12:07:16 2011 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2011, 2011, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.oracle.max.graal.graph; - - - -public final class NodeMap { - - private final Object[] values; - private final Graph graph; - - NodeMap(Graph graph) { - this.graph = graph; - values = new Object[graph.nextId]; - } - - @SuppressWarnings("unchecked") - public T get(Node node) { - check(node); - return (T) values[node.id()]; - } - - public void set(Node node, T value) { - check(node); - values[node.id()] = value; - } - - public int size() { - return values.length; - } - - private void check(Node node) { - assert node.graph == graph : "this node is not part of the graph"; - assert node.id() < values.length : "this node was added to the graph after creating the node map"; - } -} diff -r 79165996a12d -r 94f3ffcc5c2a graal/com.oracle.max.graal.graph/src/com/oracle/max/graal/graph/NodeVisitor.java --- a/graal/com.oracle.max.graal.graph/src/com/oracle/max/graal/graph/NodeVisitor.java Mon Jun 20 12:07:16 2011 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2011, 2011, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.oracle.max.graal.graph; - - -public interface NodeVisitor { - boolean visit(Node n); -} diff -r 79165996a12d -r 94f3ffcc5c2a graal/com.oracle.max.graal.graph/src/com/oracle/max/graal/graph/NodeWorkList.java --- a/graal/com.oracle.max.graal.graph/src/com/oracle/max/graal/graph/NodeWorkList.java Mon Jun 20 12:07:16 2011 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,199 +0,0 @@ -/* - * Copyright (c) 2011, 2011, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.oracle.max.graal.graph; - -import java.util.ArrayDeque; -import java.util.Iterator; -import java.util.NoSuchElementException; -import java.util.Queue; - - -public class NodeWorkList implements Iterable { - private final NodeBitMap visited; - private final NodeBitMap inQueue; - private final Queue worklist; - private int iterationLimit = Integer.MAX_VALUE; - - NodeWorkList(Graph graph) { - this(graph, false, -1); - } - - NodeWorkList(Graph graph, boolean fill, int iterationLimitPerNode) { - visited = graph.createNodeBitMap(); - inQueue = graph.createNodeBitMap(); - if (fill) { - ArrayDeque deque = new ArrayDeque(graph.getNodeCount()); - for (Node node : graph.getNodes()) { - if (node != null) { - deque.add(node); - } - } - worklist = deque; - } else { - worklist = new ArrayDeque(); - } - if (iterationLimitPerNode > 0) { - iterationLimit = iterationLimitPerNode * graph.getNodeCount(); - } - } - - public void add(Node node) { - if (node != null && !visited.isMarked(node)) { - doAdd(node); - } - } - - private void doAdd(Node node) { - if (node != null && !inQueue.isMarked(node)) { - visited.mark(node); - inQueue.mark(node); - worklist.add(node); - } - } - - public void replaced(Node newNode, Node oldNode, EdgeType... edges) { - this.replaced(newNode, oldNode, false, edges); - } - - public void replaced(Node newNode, Node oldNode, boolean add, EdgeType... edges) { - visited.grow(newNode); - inQueue.grow(newNode); - worklist.remove(oldNode); - assert !worklist.contains(oldNode); - if (add) { - this.add(newNode); - } - for (EdgeType type : edges) { - switch (type) { - case INPUTS: - for (Node n : newNode.inputs()) { - doAdd(n); - } - break; - case PREDECESSORS: - for (Node n : newNode.predecessors()) { - doAdd(n); - } - break; - case USAGES: - for (Node n : newNode.usages()) { - doAdd(n); - } - break; - case SUCCESSORS: - for (Node n : newNode.successors()) { - doAdd(n); - } - break; - } - } - } - - public boolean isMarked(Node node) { - return visited.isMarked(node); - } - - private class QueueConsumingIterator implements Iterator { - private final Queue queue; - - public QueueConsumingIterator(Queue queue) { - this.queue = queue; - } - - @Override - public boolean hasNext() { - return iterationLimit > 0 && !queue.isEmpty(); - } - - @Override - public Node next() { - if (iterationLimit-- <= 0) { - throw new NoSuchElementException(); - } - Node node = queue.remove(); - inQueue.clear(node); - return node; - } - - @Override - public void remove() { - throw new UnsupportedOperationException(); - } - } - - @Override - public Iterator iterator() { - return new QueueConsumingIterator(worklist); - } - - private static class UnmarkedNodeIterator implements Iterator { - private final NodeBitMap visited; - private Iterator nodes; - private Node nextNode; - - public UnmarkedNodeIterator(NodeBitMap visited, Iterator nodes) { - this.visited = visited; - this.nodes = nodes; - forward(); - } - - private void forward() { - do { - if (!nodes.hasNext()) { - nextNode = null; - return; - } - nextNode = nodes.next(); - } while (visited.isMarked(nextNode)); - } - - @Override - public boolean hasNext() { - return nextNode != null; - } - - @Override - public Node next() { - try { - return nextNode; - } finally { - forward(); - } - } - - @Override - public void remove() { - throw new UnsupportedOperationException(); - } - - } - - public Iterable unmarkedNodes() { - return new Iterable() { - @Override - public Iterator iterator() { - return new UnmarkedNodeIterator(visited, visited.graph().getNodes().iterator()); - } - }; - } -} diff -r 79165996a12d -r 94f3ffcc5c2a graal/com.oracle.max.graal.graph/src/com/oracle/max/graal/graph/Op.java --- a/graal/com.oracle.max.graal.graph/src/com/oracle/max/graal/graph/Op.java Mon Jun 20 12:07:16 2011 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.oracle.max.graal.graph; - - -public interface Op { - -} diff -r 79165996a12d -r 94f3ffcc5c2a graal/com.oracle.max.graal.graph/src/com/oracle/max/graal/graph/StartNode.java --- a/graal/com.oracle.max.graal.graph/src/com/oracle/max/graal/graph/StartNode.java Mon Jun 20 12:07:16 2011 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,69 +0,0 @@ -/* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.oracle.max.graal.graph; - -public class StartNode extends Node { - - private static final int INPUT_COUNT = 0; - - private static final int SUCCESSOR_COUNT = 1; - private static final int SUCCESSOR_START = 0; - - @Override - protected int inputCount() { - return super.inputCount() + INPUT_COUNT; - } - - @Override - protected int successorCount() { - return super.successorCount() + SUCCESSOR_COUNT; - } - - public Node start() { - return successors().get(super.successorCount() + SUCCESSOR_START); - } - - public Node setStart(Node next) { - return successors().set(super.successorCount() + SUCCESSOR_START, next); - } - - StartNode(Graph graph) { - super(INPUT_COUNT, SUCCESSOR_COUNT, graph); - } - - @Override - public Node replace(Node other) { - throw new UnsupportedOperationException(); - } - - @Override - public void delete() { - throw new UnsupportedOperationException(); - } - - @Override - public Node copy(Graph into) { - throw new UnsupportedOperationException(); - } - -} diff -r 79165996a12d -r 94f3ffcc5c2a graal/com.oracle.max.graal.graph/src/com/oracle/max/graal/graph/VerificationListener.java --- a/graal/com.oracle.max.graal.graph/src/com/oracle/max/graal/graph/VerificationListener.java Mon Jun 20 12:07:16 2011 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.oracle.max.graal.graph; - - -public interface VerificationListener { - void verificationFailed(Node n, String message); -} diff -r 79165996a12d -r 94f3ffcc5c2a graal/com.oracle.max.graal.graph/src/com/oracle/max/graal/graph/package-info.java --- a/graal/com.oracle.max.graal.graph/src/com/oracle/max/graal/graph/package-info.java Mon Jun 20 12:07:16 2011 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2011, 2011, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/** - * This package contains the Node base class and the Graph container class of the Graal IR. - * - * @author Gilles Duboscq - * @author Lukas Stadler - * @author Thomas Wuerthinger - */ -package com.oracle.max.graal.graph; diff -r 79165996a12d -r 94f3ffcc5c2a graal/com.oracle.max.graal.graph/test/com/oracle/graal/graph/NodeTest.java --- a/graal/com.oracle.max.graal.graph/test/com/oracle/graal/graph/NodeTest.java Mon Jun 20 12:07:16 2011 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,145 +0,0 @@ -/* - * Copyright (c) 2011, 2011, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.oracle.graal.graph; - -import static org.junit.Assert.*; - -import org.junit.Test; - -import com.oracle.max.graal.graph.Graph; -import com.oracle.max.graal.graph.Node; - -public class NodeTest { - - @Test - public void testBasics() { - - Graph g1 = new Graph(); - - DummyNode n1 = new DummyNode(2, 1, g1); - DummyNode n2 = new DummyNode(1, 1, g1); - DummyNode n3 = new DummyNode(0, 0, g1); - n2.dummySetInput(0, Node.Null); - n2.dummySetSuccessor(0, n3); - - assertSame(Node.Null, n2.inputs().get(0)); - assertSame(n3, n2.successors().get(0)); - assertEquals(n1.inputs().size(), 2); - assertEquals(n1.successors().size(), 1); - } - - @Test - public void testReplace() { - Graph g2 = new Graph(); - - DummyOp2 o1 = new DummyOp2(Node.Null, Node.Null, g2); - DummyOp2 o2 = new DummyOp2(o1, Node.Null, g2); - DummyOp2 o3 = new DummyOp2(o2, Node.Null, g2); - DummyOp2 o4 = new DummyOp2(Node.Null, Node.Null, g2); - - o2.replace(o4); - - assertFalse(o3.inputs().contains(o2)); - assertTrue(o3.inputs().contains(o4)); - assertTrue(o4.usages().contains(o3)); - } - - private static class DummyNode extends Node { - - private final int inputCount; - private final int successorCount; - - public DummyNode(int inputCount, int successorCount, Graph graph) { - super(inputCount, successorCount, graph); - this.inputCount = inputCount; - this.successorCount = successorCount; - } - - @Override - protected int inputCount() { - return super.inputCount() + inputCount; - } - - @Override - protected int successorCount() { - return super.inputCount() + successorCount; - } - - public void dummySetInput(int idx, Node n) { - inputs().set(idx, n); - } - - public void dummySetSuccessor(int idx, Node n) { - successors().set(idx, n); - } - - @Override - public Node copy(Graph into) { - return new DummyNode(inputCount, successorCount, into); - } - - } - - public static class DummyOp2 extends Node { - - public static final int SUCCESSOR_COUNT = 0; - public static final int INPUT_COUNT = 2; - public static final int INPUT_X = 0; - public static final int INPUT_Y = 1; - - public DummyOp2(Node x, Node y, Graph graph) { - this(graph); - setX(x); - setY(y); - } - public DummyOp2(Graph graph) { - super(INPUT_COUNT, SUCCESSOR_COUNT, graph); - } - - @Override - protected int inputCount() { - return super.inputCount() + INPUT_COUNT; - } - - public Node x() { - return inputs().get(super.inputCount() + INPUT_X); - } - - public Node y() { - return inputs().get(super.inputCount() + INPUT_Y); - } - - public Node setX(Node n) { - return inputs().set(super.inputCount() + INPUT_X, n); - } - - public Node setY(Node n) { - return inputs().set(super.inputCount() + INPUT_Y, n); - } - - @Override - public Node copy(Graph into) { - return new DummyOp2(into); - } - } -}