Class: BiteScript::MethodBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/duby/jvm/types/intrinsics.rb,
lib/duby/jvm/types/integers.rb

Instance Method Summary collapse

Instance Method Details

#inotObject



2
3
4
5
# File 'lib/duby/jvm/types/integers.rb', line 2

def inot
  iconst_m1
  ixor
end

#lnotObject



7
8
9
10
11
12
13
# File 'lib/duby/jvm/types/integers.rb', line 7

def lnot
  # TODO would any of these be faster?
  #   iconst_m1; i2l
  #   lconst_1; lneg
  ldc_long(-1)
  ixor
end

#op_to_bool {|true_label| ... } ⇒ Object

Yields:

  • (true_label)


5
6
7
8
9
10
11
12
13
14
15
# File 'lib/duby/jvm/types/intrinsics.rb', line 5

def op_to_bool
  done_label = label
  true_label = label

  yield(true_label)
  iconst_0
  goto(done_label)
  true_label.set!
  iconst_1
  done_label.set!
end