Class: Mirah::Util::CompilationState

Inherits:
Object
  • Object
show all
Defined in:
lib/mirah/util/compilation_state.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCompilationState

Returns a new instance of CompilationState.



21
22
23
24
# File 'lib/mirah/util/compilation_state.rb', line 21

def initialize
  @save_extensions = true
  set_jvm_version ENV_JAVA['java.specification.version']
end

Instance Attribute Details

#argsObject

Returns the value of attribute args.



33
34
35
# File 'lib/mirah/util/compilation_state.rb', line 33

def args
  @args
end

#bootclasspathObject

Returns the value of attribute bootclasspath.



38
39
40
# File 'lib/mirah/util/compilation_state.rb', line 38

def bootclasspath
  @bootclasspath
end

#bytecode_versionObject (readonly)

Returns the value of attribute bytecode_version.



39
40
41
# File 'lib/mirah/util/compilation_state.rb', line 39

def bytecode_version
  @bytecode_version
end

#classpathObject

Returns the value of attribute classpath.



38
39
40
# File 'lib/mirah/util/compilation_state.rb', line 38

def classpath
  @classpath
end

#commandObject

Returns the value of attribute command.



34
35
36
# File 'lib/mirah/util/compilation_state.rb', line 34

def command
  @command
end

#compiler_classObject

Returns the value of attribute compiler_class.



32
33
34
# File 'lib/mirah/util/compilation_state.rb', line 32

def compiler_class
  @compiler_class
end

#destinationObject

Returns the value of attribute destination.



26
27
28
# File 'lib/mirah/util/compilation_state.rb', line 26

def destination
  @destination
end

#help_printedObject

Returns the value of attribute help_printed.



28
29
30
# File 'lib/mirah/util/compilation_state.rb', line 28

def help_printed
  @help_printed
end

#loggersObject

Returns the value of attribute loggers.



35
36
37
# File 'lib/mirah/util/compilation_state.rb', line 35

def loggers
  @loggers
end

#runningObject Also known as: running?

Returns the value of attribute running.



30
31
32
# File 'lib/mirah/util/compilation_state.rb', line 30

def running
  @running
end

#save_extensionsObject

Returns the value of attribute save_extensions.



29
30
31
# File 'lib/mirah/util/compilation_state.rb', line 29

def save_extensions
  @save_extensions
end

#target_jvm_versionObject (readonly)

Returns the value of attribute target_jvm_version.



39
40
41
# File 'lib/mirah/util/compilation_state.rb', line 39

def target_jvm_version
  @target_jvm_version
end

#type_systemObject

Returns the value of attribute type_system.



36
37
38
# File 'lib/mirah/util/compilation_state.rb', line 36

def type_system
  @type_system
end

#verboseObject

Returns the value of attribute verbose.



26
27
28
# File 'lib/mirah/util/compilation_state.rb', line 26

def verbose
  @verbose
end

#version_printedObject

Returns the value of attribute version_printed.



27
28
29
# File 'lib/mirah/util/compilation_state.rb', line 27

def version_printed
  @version_printed
end

Instance Method Details

#set_jvm_version(ver_str) ⇒ Object



41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/mirah/util/compilation_state.rb', line 41

def set_jvm_version(ver_str)
  @target_jvm_version = ver_str
  @bytecode_version = case ver_str
  when '1.4' then BiteScript::JAVA1_4
  when '1.5' then BiteScript::JAVA1_5
  when '1.6' then BiteScript::JAVA1_6
  when '1.7' then BiteScript::JAVA1_7
  when '1.8' then BiteScript::JAVA1_8
  else
    $stderr.puts "invalid bytecode version specified: #{ver_str}"
  end
  BiteScript.bytecode_version = @bytecode_version
end

#supports_invokedynamic?Boolean

Returns:

  • (Boolean)


55
56
57
# File 'lib/mirah/util/compilation_state.rb', line 55

def supports_invokedynamic?
  @bytecode_version == BiteScript::JAVA1_7
end