Class: Mirah::JVM::Types::LongType
- Inherits:
-
Number
- Object
- AST::Node
- AST::TypeReference
- Type
- PrimitiveType
- Number
- Mirah::JVM::Types::LongType
- Defined in:
- lib/mirah/jvm/types/integers.rb
Constant Summary
Constants inherited from AST::TypeReference
AST::TypeReference::BlockType, AST::TypeReference::ErrorType, AST::TypeReference::NoType, AST::TypeReference::NullType, AST::TypeReference::UnreachableType
Instance Attribute Summary
Attributes inherited from Type
Attributes inherited from AST::TypeReference
Attributes included from AST::Named
Attributes inherited from AST::Node
#children, #inferred_type, #newline, #parent, #position
Instance Method Summary collapse
- #add_intrinsics ⇒ Object
- #box_type ⇒ Object
- #init_value(builder) ⇒ Object
- #literal(builder, value) ⇒ Object
- #math_type ⇒ Object
- #prefix ⇒ Object
- #wide? ⇒ Boolean
- #widen(builder, type) ⇒ Object
Methods inherited from Number
#add_delegates, #boolean_operator, #box, #compile_boolean_operator, #delegate_intrinsic, #invert_op, #jump_if, #math_operator, #suffix, #unary_operator
Methods inherited from PrimitiveType
#convertible_to?, #initialize, #interfaces, #newarray, #primitive?, #primitive_type, #superclass
Methods inherited from Type
#add_compiled_macro, #add_enumerable_macros, #add_macro, #add_method, #aload, #array?, #array_type, #assignable_from?, #astore, #basic_type, #compatible?, #component_type, #constructor, #declared_class_methods, #declared_constructors, #declared_instance_methods, #declared_intrinsics, #dynamic?, #expand_each, #field_getter, #field_setter, #full_name, #get_method, #include, #initialize, #inner_class?, #inner_class_getter, #inspect, #interface?, #interfaces, #intrinsics, #is_parent, #iterable?, #java_method, #jvm_type, #load, #load_extensions, #log, #meta, #meta?, #newarray, #pop, #primitive?, #return, #store, #superclass, #to_source, #unmeta, #void?, #wrap_with_scoped_body
Methods included from MethodLookup
#each_is_exact, #each_is_exact_or_subtype_or_convertible, #field_lookup, #find_jls, #find_method, #inner_class, #is_more_specific?, #log, #phase1, #phase2, #phase3, #primitive_convertible?
Methods inherited from AST::TypeReference
#==, #_dump, _load, #basic_type, #block?, #compatible?, #component_type, #eql?, #error?, #full_name, #hash, #initialize, #is_parent, #iterable?, #meta?, #narrow, #null?, #primitive?, #to_s, #type_reference, #unmeta, #unreachable?, #void?
Methods included from AST::Named
#string_value, #to_s, #validate_name
Methods inherited from AST::Node
#<<, ===, #[], #[]=, #_dump, _load, #_set_parent, child, child_name, #child_nodes, #each, #empty?, #expr?, #inferred_type!, #initialize, #initialize_copy, #insert, #inspect, #inspect_children, #line_number, #log, #precompile, #resolve_if, #resolved!, #resolved?, #simple_name, #string_value, #temp, #to_s, #top_level?, #validate_child, #validate_children
Constructor Details
This class inherits a constructor from Mirah::JVM::Types::PrimitiveType
Instance Method Details
#add_intrinsics ⇒ Object
175 176 177 178 179 180 181 182 183 184 |
# File 'lib/mirah/jvm/types/integers.rb', line 175 def add_intrinsics super math_operator('<<', 'shl') math_operator('>>', 'shr') math_operator('>>>', 'ushr') math_operator('|', 'or') math_operator('&', 'and') math_operator('^', 'xor') unary_operator('~', 'not') end |
#box_type ⇒ Object
146 147 148 |
# File 'lib/mirah/jvm/types/integers.rb', line 146 def box_type java.lang.Long end |
#init_value(builder) ⇒ Object
154 155 156 |
# File 'lib/mirah/jvm/types/integers.rb', line 154 def init_value(builder) builder.lconst_0 end |
#literal(builder, value) ⇒ Object
150 151 152 |
# File 'lib/mirah/jvm/types/integers.rb', line 150 def literal(builder, value) builder.ldc_long(value) end |
#math_type ⇒ Object
142 143 144 |
# File 'lib/mirah/jvm/types/integers.rb', line 142 def math_type Long end |
#prefix ⇒ Object
138 139 140 |
# File 'lib/mirah/jvm/types/integers.rb', line 138 def prefix 'l' end |
#widen(builder, type) ⇒ Object
162 163 164 165 166 167 168 169 170 171 172 173 |
# File 'lib/mirah/jvm/types/integers.rb', line 162 def widen(builder, type) case type when Long # do nothing when Float builder.l2f when Double builder.l2d else raise ArgumentError, "Invalid widening conversion from Int to #{type}" end end |