C# Class Rakudo.Runtime.Ops

This class implements the various vm::op options that are available.
Mostrar archivo Open project: jnthn/6model

Public Methods

Method Description
add_int ( ThreadContext TC, int x, int y ) : int

Performs an integer addition.

add_num ( ThreadContext TC, RakudoObject x, RakudoObject y ) : RakudoObject

Performs a numeric addition.

bind_attr ( ThreadContext TC, RakudoObject Object, RakudoObject Class, RakudoObject Name, RakudoObject Value ) : RakudoObject

Binds the value of an attribute to the given value.

bind_attr ( ThreadContext TC, RakudoObject Object, RakudoObject Class, string Name, RakudoObject Value ) : RakudoObject

Binds the value of an attribute to the given value.

bind_attr_with_hint ( ThreadContext TC, RakudoObject Object, RakudoObject Class, string Name, int Hint, RakudoObject Value ) : RakudoObject

Binds the value of an attribute to the given value, using the given hint.

bind_dynamic ( ThreadContext TC, string Name, RakudoObject Value ) : RakudoObject

Binds the given value to a variable in the dynamic scope.

bind_lex ( ThreadContext TC, string Name, RakudoObject Value ) : RakudoObject

Binds the given value to a lexical variable of the given name.

bitwise_and_int ( ThreadContext TC, RakudoObject x, RakudoObject y ) : RakudoObject

Performs a bitwise and on ints.

bitwise_and_num ( ThreadContext TC, RakudoObject x, RakudoObject y ) : RakudoObject

Performs a bitwise and on nums.

bitwise_or_int ( ThreadContext TC, RakudoObject x, RakudoObject y ) : RakudoObject

Performs a bitwise or on ints.

bitwise_or_num ( ThreadContext TC, RakudoObject x, RakudoObject y ) : RakudoObject

Performs a bitwise or on nums.

bitwise_xor_int ( ThreadContext TC, RakudoObject x, RakudoObject y ) : RakudoObject

Performs a bitwise xor on ints.

bitwise_xor_num ( ThreadContext TC, RakudoObject x, RakudoObject y ) : RakudoObject

Performs a bitwise xor on nums.

box_int ( ThreadContext TC, int Value ) : RakudoObject

Boxes a native int into its matching value type.

box_int ( ThreadContext TC, int Value, RakudoObject To ) : RakudoObject

Boxes a native int into its matching value type.

box_num ( ThreadContext TC, double Value, RakudoObject To ) : RakudoObject

Boxes a native num into its matching value type.

box_num ( ThreadContext TC, int Value ) : RakudoObject

Boxes a native num into its matching value type.

box_str ( ThreadContext TC, string Value ) : RakudoObject

Boxes a native string into its matching value type.

box_str ( ThreadContext TC, string Value, RakudoObject To ) : RakudoObject

Boxes a native string into its matching value type.

capture_outer ( ThreadContext TC, RakudoCodeRef Block ) : RakudoObject

Makes the outer context of the provided block be set to the current context.

coerce_int_to_num ( ThreadContext TC, RakudoObject Int, RakudoObject TargetType ) : RakudoObject

Coerces an integer into a floating point number.

coerce_int_to_str ( ThreadContext TC, RakudoObject Int, RakudoObject TargetType ) : RakudoObject

Coerces an integer into a string.

coerce_num_to_int ( ThreadContext TC, RakudoObject Num, RakudoObject TargetType ) : RakudoObject

Coerces a floating point number into an integer.

coerce_num_to_str ( ThreadContext TC, RakudoObject Num, RakudoObject TargetType ) : RakudoObject

Coerces a floating point number into a string.

coerce_str_to_int ( ThreadContext TC, RakudoObject Str, RakudoObject TargetType ) : RakudoObject

Coerces a string into an integer.

coerce_str_to_num ( ThreadContext TC, RakudoObject Str, RakudoObject TargetType ) : RakudoObject

Coerces a string into an number.

concat ( ThreadContext TC, RakudoObject x, RakudoObject y ) : RakudoObject

Performs a string concatenation.

create_dispatch_and_add_candidates ( ThreadContext TC, RakudoObject ToInstantiate, RakudoObject ExtraDispatchees ) : RakudoObject

Creates an instantiation of the dispatch routine (or proto, which may serve as one) supplied and augments it with the provided candidates. It relies on being passed the instantiation of the dispatcher from the last outer scope that had an instantiation, and we thus take its candidates. This may or may not hold up in the long run; it works out in the Perl 6-y "you can make a new instance from any object" sense though, and seems more likely to get the closure semantics right than any of the other approaches I've considered so far.

div_int ( ThreadContext TC, int x, int y ) : int

Performs an integer division.

div_num ( ThreadContext TC, RakudoObject x, RakudoObject y ) : RakudoObject

Performs a numeric division.

equal_ints ( ThreadContext TC, int x, int y ) : int

Compares two integers for equality.

equal_nums ( ThreadContext TC, double x, double y ) : int

Compares two floating point numbers for equality.

equal_refs ( ThreadContext TC, RakudoObject x, RakudoObject y ) : RakudoObject

Compares reference equality.

equal_strs ( ThreadContext TC, string x, string y ) : int

Compares two strings for equality.

find_method ( ThreadContext TC, RakudoObject Object, string Name ) : RakudoObject

Finds a method to call by name.

find_method_with_hint ( ThreadContext TC, RakudoObject Object, string Name, int Hint ) : RakudoObject

Finds a method to call, using the hint if available.

format_str ( ThreadContext TC, RakudoObject x ) : RakudoObject

Performs a string format.

get_attr ( ThreadContext TC, RakudoObject Object, RakudoObject Class, RakudoObject Name ) : RakudoObject

Gets the value of an attribute.

get_attr ( ThreadContext TC, RakudoObject Object, RakudoObject Class, string Name ) : RakudoObject

Gets the value of an attribute.

get_attr_with_hint ( ThreadContext TC, RakudoObject Object, RakudoObject Class, string Name, int Hint ) : RakudoObject

Gets the value of an attribute, using the given hint.

get_dynamic ( ThreadContext TC, string Name ) : RakudoObject

Looks up a variable in the dynamic scope.

get_how ( ThreadContext TC, RakudoObject Obj ) : RakudoObject

Gets the HOW (higher order workings, e.g. meta-package).

get_lex ( ThreadContext TC, string Name ) : RakudoObject

Gets a lexical variable of the given name.

get_lex_skip_current ( ThreadContext TC, string Name ) : RakudoObject

Gets a lexical variable of the given name, but skips the current scope.

get_what ( ThreadContext TC, RakudoObject Obj ) : RakudoObject

Gets the WHAT (type object).

greater_than_ints ( ThreadContext TC, RakudoObject x, RakudoObject y ) : RakudoObject

Compares two integers for greater-than inequality.

greater_than_nums ( ThreadContext TC, RakudoObject x, RakudoObject y ) : RakudoObject

Compares two floating point numbers for greater-than inequality.

greater_than_or_equal_ints ( ThreadContext TC, RakudoObject x, RakudoObject y ) : RakudoObject

Compares two integers for greater-than-or-equal inequality.

greater_than_or_equal_nums ( ThreadContext TC, RakudoObject x, RakudoObject y ) : RakudoObject

Compares two floating point numbers for greater-than-or-equal inequality.

greater_than_or_equal_strs ( ThreadContext TC, RakudoObject x, RakudoObject y ) : RakudoObject

Compares two strings for greater-than-or-equal inequality.

greater_than_strs ( ThreadContext TC, RakudoObject x, RakudoObject y ) : RakudoObject

Compares two strings for greater-than inequality.

index_str ( ThreadContext TC, RakudoObject x, RakudoObject y ) : RakudoObject

Search for the first occurrence of a substring within a string and returns its zero-based index if it's found and -1 if it's not.

index_str_index ( ThreadContext TC, RakudoObject x, RakudoObject y, RakudoObject z ) : RakudoObject

Search for the first occurrence of a substring within a string and returns its zero-based index if it's found and -1 if it's not, starting at a specified index.

instance_of ( ThreadContext TC, RakudoObject WHAT ) : RakudoObject

Create an instance of an object.

invoke ( ThreadContext TC, RakudoObject Invokee, RakudoObject Capture ) : RakudoObject

Invokes the given method.

is_cclass_str ( ThreadContext TC, RakudoObject x, RakudoObject y ) : RakudoObject

Checks whether a character is a member of a particular character class.

is_cclass_str_index ( ThreadContext TC, RakudoObject x, RakudoObject y, RakudoObject z ) : RakudoObject

Checks whether a character at a particular index in a string is a member of a particular character class.

is_dispatcher ( ThreadContext TC, RakudoObject Check ) : RakudoObject

Checks if a routine is considered a dispatcher (that is, if it has a candidate list).

leave_block ( ThreadContext TC, RakudoObject Block, RakudoObject ReturnValue ) : RakudoObject

Leaves the specified block, returning the specified value from it. This unwinds the stack.

length_str ( ThreadContext TC, RakudoObject x ) : RakudoObject

Returns the length of the string.

less_than_ints ( ThreadContext TC, RakudoObject x, RakudoObject y ) : RakudoObject

Compares two integers for less-than inequality.

less_than_nums ( ThreadContext TC, RakudoObject x, RakudoObject y ) : RakudoObject

Compares two floating point numbers for less-than inequality.

less_than_or_equal_ints ( ThreadContext TC, RakudoObject x, RakudoObject y ) : RakudoObject

Compares two integers for less-than-or-equal inequality.

less_than_or_equal_nums ( ThreadContext TC, RakudoObject x, RakudoObject y ) : RakudoObject

Compares two floating point numbers for less-than-or-equal inequality.

less_than_or_equal_strs ( ThreadContext TC, RakudoObject x, RakudoObject y ) : RakudoObject

Compares two strings for less-than-or-equal inequality.

less_than_strs ( ThreadContext TC, RakudoObject x, RakudoObject y ) : RakudoObject

Compares two strings for less-than inequality.

lllist_bind_at_pos ( ThreadContext TC, RakudoObject LLList, RakudoObject IndexObj, RakudoObject Value ) : RakudoObject

Binds a value at a given positional index from a low level list (something that uses the P6list representation).

lllist_elems ( ThreadContext TC, RakudoObject LLList ) : RakudoObject

Gets the number of elements in a low level list (something that uses the P6list representation).

lllist_get_at_pos ( ThreadContext TC, RakudoObject LLList, RakudoObject Index ) : RakudoObject

Gets a value at a given positional index from a low level list (something that uses the P6list representation).

lllist_get_at_pos ( ThreadContext TC, RakudoObject LLList, int index ) : RakudoObject
lllist_pop ( ThreadContext TC, RakudoObject LLList ) : RakudoObject

Pops a value from a low level list (something that uses the P6list representation).

lllist_push ( ThreadContext TC, RakudoObject LLList, RakudoObject item ) : RakudoObject

Pushes a value to a low level list (something that uses the P6list representation).

lllist_shift ( ThreadContext TC, RakudoObject LLList ) : RakudoObject

Shifts a value from a low level list (something that uses the P6list representation).

lllist_truncate_to ( ThreadContext TC, RakudoObject LLList, RakudoObject Length ) : RakudoObject

Truncates a LLList to a prescribed length. Mimics parrot's assign integer to array.

lllist_unshift ( ThreadContext TC, RakudoObject LLList, RakudoObject item ) : RakudoObject

Unshifts a value to a low level list (something that uses the P6list representation).

llmapping_bind_at_key ( ThreadContext TC, RakudoObject LLMapping, RakudoObject Key, RakudoObject Value ) : RakudoObject

Binds a value at a given key from a low level mapping (something that uses the P6mapping representation).

llmapping_elems ( ThreadContext TC, RakudoObject LLMapping ) : RakudoObject

Gets the number of elements in a low level mapping (something that uses the P6mapping representation).

llmapping_get_at_key ( ThreadContext TC, RakudoObject LLMapping, RakudoObject Key ) : RakudoObject

Gets a value at a given key from a low level mapping (something that uses the P6mapping representation).

load_module ( ThreadContext TC, RakudoObject Path ) : RakudoObject

Loads a module (that is, some pre-compiled compilation unit that was compiled using NQP). Expects the path minus an extension (that is, the .dll will be added). Returns what the body of the compilation unit evaluated to.

logical_not_int ( ThreadContext TC, int x ) : int

Logical not.

mod_int ( ThreadContext TC, int x, int y ) : int

Performs an integer modulo.

mul_int ( ThreadContext TC, int x, int y ) : int

Performs an integer multiplication.

mul_num ( ThreadContext TC, RakudoObject x, RakudoObject y ) : RakudoObject

Performs a numeric multiplication.

multi_dispatch_over_lexical_candidates ( ThreadContext TC ) : RakudoObject

Entry point to multi-dispatch over the current dispatchee list.

new_closure ( ThreadContext TC, RakudoCodeRef Block ) : RakudoObject

Creates a clone of the given code object, and makes its outer context be set to the current context.

publish_method_cache ( ThreadContext TC, RakudoObject WHAT, RakudoObject MethodCacheHash ) : RakudoObject

Publishes a method dispatch cache - essentially, a set of name to code object mappings.

publish_type_check_cache ( ThreadContext TC, RakudoObject WHAT, RakudoObject TypeList ) : RakudoObject

Publishes a type check cache. The list of accepted types must use the P6list representation.

push_dispatchee ( ThreadContext TC, RakudoObject Dispatcher, RakudoObject Dispatchee ) : RakudoObject

Adds a single new candidate to the end of a dispatcher's candidate list.

repr_defined ( ThreadContext TC, RakudoObject Obj ) : RakudoObject

Checks if the representation considers the object defined.

set_dispatchees ( ThreadContext TC, RakudoObject CodeObject, RakudoObject Dispatchees ) : RakudoObject

Sets the dispatches of the given code object. Expects something with RakudoCodeRef and P6list representation respectively.

split_str ( ThreadContext TC, RakudoObject x, RakudoObject y ) : RakudoObject

Split the first string by the first character of the second string returning an NQPList of the results.

sub_int ( ThreadContext TC, int x, int y ) : int

Performs an integer subtraction.

sub_num ( ThreadContext TC, RakudoObject x, RakudoObject y ) : RakudoObject

Performs a numeric subtraction.

substr ( ThreadContext TC, RakudoObject x, RakudoObject y ) : RakudoObject

Performs a string substring.

substr ( ThreadContext TC, RakudoObject x, RakudoObject y, RakudoObject z ) : RakudoObject

Performs a string substring.

throw_dynamic ( ThreadContext TC, RakudoObject ExceptionObject, RakudoObject ExceptionType ) : RakudoObject

Throws the specified exception, looking for an exception handler in the dynamic scope.

throw_lexical ( ThreadContext TC, RakudoObject ExceptionObject, RakudoObject ExceptionType ) : RakudoObject

Throws the specified exception, looking for an exception handler in the lexical scope.

type_check ( ThreadContext TC, RakudoObject ToCheck, RakudoObject WantedType ) : RakudoObject

Checks if the given object's type accepts the checked type, using the type check cache if one was published.

type_object_for ( ThreadContext TC, RakudoObject HOW, RakudoObject REPRName ) : RakudoObject

Creates a type object associated with the given HOW and of the given representation.

unbox_int ( ThreadContext TC, RakudoObject Boxed ) : int

Unboxes a boxed int.

unbox_num ( ThreadContext TC, RakudoObject Boxed ) : double

Unboxes a boxed num.

unbox_str ( ThreadContext TC, RakudoObject Boxed ) : string

Unboxes a boxed string.

vivify ( ThreadContext TC, RakudoObject Check, RakudoObject VivifyWith ) : RakudoObject

If the first passed object reference is not null, returns it. Otherwise, returns the second passed object reference. (Note, we should one day drop this and implement it as a compiler transformation, to avoid having to look up the thing to vivify).

Private Methods

Method Description
is_cclass ( string target, int index, CCLASS cclass ) : bool

Method Details

add_int() public static method

Performs an integer addition.
public static add_int ( ThreadContext TC, int x, int y ) : int
TC ThreadContext
x int
y int
return int

add_num() public static method

Performs a numeric addition.
public static add_num ( ThreadContext TC, RakudoObject x, RakudoObject y ) : RakudoObject
TC ThreadContext
x Rakudo.Metamodel.RakudoObject
y Rakudo.Metamodel.RakudoObject
return Rakudo.Metamodel.RakudoObject

bind_attr() public static method

Binds the value of an attribute to the given value.
public static bind_attr ( ThreadContext TC, RakudoObject Object, RakudoObject Class, RakudoObject Name, RakudoObject Value ) : RakudoObject
TC ThreadContext
Object Rakudo.Metamodel.RakudoObject
Class Rakudo.Metamodel.RakudoObject
Name Rakudo.Metamodel.RakudoObject
Value Rakudo.Metamodel.RakudoObject
return Rakudo.Metamodel.RakudoObject

bind_attr() public static method

Binds the value of an attribute to the given value.
public static bind_attr ( ThreadContext TC, RakudoObject Object, RakudoObject Class, string Name, RakudoObject Value ) : RakudoObject
TC ThreadContext
Object Rakudo.Metamodel.RakudoObject
Class Rakudo.Metamodel.RakudoObject
Name string
Value Rakudo.Metamodel.RakudoObject
return Rakudo.Metamodel.RakudoObject

bind_attr_with_hint() public static method

Binds the value of an attribute to the given value, using the given hint.
public static bind_attr_with_hint ( ThreadContext TC, RakudoObject Object, RakudoObject Class, string Name, int Hint, RakudoObject Value ) : RakudoObject
TC ThreadContext
Object Rakudo.Metamodel.RakudoObject
Class Rakudo.Metamodel.RakudoObject
Name string
Hint int
Value Rakudo.Metamodel.RakudoObject
return Rakudo.Metamodel.RakudoObject

bind_dynamic() public static method

Binds the given value to a variable in the dynamic scope.
public static bind_dynamic ( ThreadContext TC, string Name, RakudoObject Value ) : RakudoObject
TC ThreadContext
Name string
Value Rakudo.Metamodel.RakudoObject
return Rakudo.Metamodel.RakudoObject

bind_lex() public static method

Binds the given value to a lexical variable of the given name.
public static bind_lex ( ThreadContext TC, string Name, RakudoObject Value ) : RakudoObject
TC ThreadContext
Name string
Value Rakudo.Metamodel.RakudoObject
return Rakudo.Metamodel.RakudoObject

bitwise_and_int() public static method

Performs a bitwise and on ints.
public static bitwise_and_int ( ThreadContext TC, RakudoObject x, RakudoObject y ) : RakudoObject
TC ThreadContext
x Rakudo.Metamodel.RakudoObject
y Rakudo.Metamodel.RakudoObject
return Rakudo.Metamodel.RakudoObject

bitwise_and_num() public static method

Performs a bitwise and on nums.
public static bitwise_and_num ( ThreadContext TC, RakudoObject x, RakudoObject y ) : RakudoObject
TC ThreadContext
x Rakudo.Metamodel.RakudoObject
y Rakudo.Metamodel.RakudoObject
return Rakudo.Metamodel.RakudoObject

bitwise_or_int() public static method

Performs a bitwise or on ints.
public static bitwise_or_int ( ThreadContext TC, RakudoObject x, RakudoObject y ) : RakudoObject
TC ThreadContext
x Rakudo.Metamodel.RakudoObject
y Rakudo.Metamodel.RakudoObject
return Rakudo.Metamodel.RakudoObject

bitwise_or_num() public static method

Performs a bitwise or on nums.
public static bitwise_or_num ( ThreadContext TC, RakudoObject x, RakudoObject y ) : RakudoObject
TC ThreadContext
x Rakudo.Metamodel.RakudoObject
y Rakudo.Metamodel.RakudoObject
return Rakudo.Metamodel.RakudoObject

bitwise_xor_int() public static method

Performs a bitwise xor on ints.
public static bitwise_xor_int ( ThreadContext TC, RakudoObject x, RakudoObject y ) : RakudoObject
TC ThreadContext
x Rakudo.Metamodel.RakudoObject
y Rakudo.Metamodel.RakudoObject
return Rakudo.Metamodel.RakudoObject

bitwise_xor_num() public static method

Performs a bitwise xor on nums.
public static bitwise_xor_num ( ThreadContext TC, RakudoObject x, RakudoObject y ) : RakudoObject
TC ThreadContext
x Rakudo.Metamodel.RakudoObject
y Rakudo.Metamodel.RakudoObject
return Rakudo.Metamodel.RakudoObject

box_int() public static method

Boxes a native int into its matching value type.
public static box_int ( ThreadContext TC, int Value ) : RakudoObject
TC ThreadContext
Value int
return Rakudo.Metamodel.RakudoObject

box_int() public static method

Boxes a native int into its matching value type.
public static box_int ( ThreadContext TC, int Value, RakudoObject To ) : RakudoObject
TC ThreadContext
Value int
To Rakudo.Metamodel.RakudoObject
return Rakudo.Metamodel.RakudoObject

box_num() public static method

Boxes a native num into its matching value type.
public static box_num ( ThreadContext TC, double Value, RakudoObject To ) : RakudoObject
TC ThreadContext
Value double
To Rakudo.Metamodel.RakudoObject
return Rakudo.Metamodel.RakudoObject

box_num() public static method

Boxes a native num into its matching value type.
public static box_num ( ThreadContext TC, int Value ) : RakudoObject
TC ThreadContext
Value int
return Rakudo.Metamodel.RakudoObject

box_str() public static method

Boxes a native string into its matching value type.
public static box_str ( ThreadContext TC, string Value ) : RakudoObject
TC ThreadContext
Value string
return Rakudo.Metamodel.RakudoObject

box_str() public static method

Boxes a native string into its matching value type.
public static box_str ( ThreadContext TC, string Value, RakudoObject To ) : RakudoObject
TC ThreadContext
Value string
To Rakudo.Metamodel.RakudoObject
return Rakudo.Metamodel.RakudoObject

capture_outer() public static method

Makes the outer context of the provided block be set to the current context.
public static capture_outer ( ThreadContext TC, RakudoCodeRef Block ) : RakudoObject
TC ThreadContext
Block Rakudo.Metamodel.Representations.RakudoCodeRef
return Rakudo.Metamodel.RakudoObject

coerce_int_to_num() public static method

Coerces an integer into a floating point number.
public static coerce_int_to_num ( ThreadContext TC, RakudoObject Int, RakudoObject TargetType ) : RakudoObject
TC ThreadContext
Int Rakudo.Metamodel.RakudoObject
TargetType Rakudo.Metamodel.RakudoObject
return Rakudo.Metamodel.RakudoObject

coerce_int_to_str() public static method

Coerces an integer into a string.
public static coerce_int_to_str ( ThreadContext TC, RakudoObject Int, RakudoObject TargetType ) : RakudoObject
TC ThreadContext
Int Rakudo.Metamodel.RakudoObject
TargetType Rakudo.Metamodel.RakudoObject
return Rakudo.Metamodel.RakudoObject

coerce_num_to_int() public static method

Coerces a floating point number into an integer.
public static coerce_num_to_int ( ThreadContext TC, RakudoObject Num, RakudoObject TargetType ) : RakudoObject
TC ThreadContext
Num Rakudo.Metamodel.RakudoObject
TargetType Rakudo.Metamodel.RakudoObject
return Rakudo.Metamodel.RakudoObject

coerce_num_to_str() public static method

Coerces a floating point number into a string.
public static coerce_num_to_str ( ThreadContext TC, RakudoObject Num, RakudoObject TargetType ) : RakudoObject
TC ThreadContext
Num Rakudo.Metamodel.RakudoObject
TargetType Rakudo.Metamodel.RakudoObject
return Rakudo.Metamodel.RakudoObject

coerce_str_to_int() public static method

Coerces a string into an integer.
public static coerce_str_to_int ( ThreadContext TC, RakudoObject Str, RakudoObject TargetType ) : RakudoObject
TC ThreadContext
Str Rakudo.Metamodel.RakudoObject
TargetType Rakudo.Metamodel.RakudoObject
return Rakudo.Metamodel.RakudoObject

coerce_str_to_num() public static method

Coerces a string into an number.
public static coerce_str_to_num ( ThreadContext TC, RakudoObject Str, RakudoObject TargetType ) : RakudoObject
TC ThreadContext
Str Rakudo.Metamodel.RakudoObject
TargetType Rakudo.Metamodel.RakudoObject
return Rakudo.Metamodel.RakudoObject

concat() public static method

Performs a string concatenation.
public static concat ( ThreadContext TC, RakudoObject x, RakudoObject y ) : RakudoObject
TC ThreadContext
x Rakudo.Metamodel.RakudoObject
y Rakudo.Metamodel.RakudoObject
return Rakudo.Metamodel.RakudoObject

create_dispatch_and_add_candidates() public static method

Creates an instantiation of the dispatch routine (or proto, which may serve as one) supplied and augments it with the provided candidates. It relies on being passed the instantiation of the dispatcher from the last outer scope that had an instantiation, and we thus take its candidates. This may or may not hold up in the long run; it works out in the Perl 6-y "you can make a new instance from any object" sense though, and seems more likely to get the closure semantics right than any of the other approaches I've considered so far.
public static create_dispatch_and_add_candidates ( ThreadContext TC, RakudoObject ToInstantiate, RakudoObject ExtraDispatchees ) : RakudoObject
TC ThreadContext
ToInstantiate Rakudo.Metamodel.RakudoObject
ExtraDispatchees Rakudo.Metamodel.RakudoObject
return Rakudo.Metamodel.RakudoObject

div_int() public static method

Performs an integer division.
public static div_int ( ThreadContext TC, int x, int y ) : int
TC ThreadContext
x int
y int
return int

div_num() public static method

Performs a numeric division.
public static div_num ( ThreadContext TC, RakudoObject x, RakudoObject y ) : RakudoObject
TC ThreadContext
x Rakudo.Metamodel.RakudoObject
y Rakudo.Metamodel.RakudoObject
return Rakudo.Metamodel.RakudoObject

equal_ints() public static method

Compares two integers for equality.
public static equal_ints ( ThreadContext TC, int x, int y ) : int
TC ThreadContext
x int
y int
return int

equal_nums() public static method

Compares two floating point numbers for equality.
public static equal_nums ( ThreadContext TC, double x, double y ) : int
TC ThreadContext
x double
y double
return int

equal_refs() public static method

Compares reference equality.
public static equal_refs ( ThreadContext TC, RakudoObject x, RakudoObject y ) : RakudoObject
TC ThreadContext
x Rakudo.Metamodel.RakudoObject
y Rakudo.Metamodel.RakudoObject
return Rakudo.Metamodel.RakudoObject

equal_strs() public static method

Compares two strings for equality.
public static equal_strs ( ThreadContext TC, string x, string y ) : int
TC ThreadContext
x string
y string
return int

find_method() public static method

Finds a method to call by name.
public static find_method ( ThreadContext TC, RakudoObject Object, string Name ) : RakudoObject
TC ThreadContext
Object Rakudo.Metamodel.RakudoObject
Name string
return Rakudo.Metamodel.RakudoObject

find_method_with_hint() public static method

Finds a method to call, using the hint if available.
public static find_method_with_hint ( ThreadContext TC, RakudoObject Object, string Name, int Hint ) : RakudoObject
TC ThreadContext
Object Rakudo.Metamodel.RakudoObject
Name string
Hint int
return Rakudo.Metamodel.RakudoObject

format_str() public static method

Performs a string format.
public static format_str ( ThreadContext TC, RakudoObject x ) : RakudoObject
TC ThreadContext
x Rakudo.Metamodel.RakudoObject
return Rakudo.Metamodel.RakudoObject

get_attr() public static method

Gets the value of an attribute.
public static get_attr ( ThreadContext TC, RakudoObject Object, RakudoObject Class, RakudoObject Name ) : RakudoObject
TC ThreadContext
Object Rakudo.Metamodel.RakudoObject
Class Rakudo.Metamodel.RakudoObject
Name Rakudo.Metamodel.RakudoObject
return Rakudo.Metamodel.RakudoObject

get_attr() public static method

Gets the value of an attribute.
public static get_attr ( ThreadContext TC, RakudoObject Object, RakudoObject Class, string Name ) : RakudoObject
TC ThreadContext
Object Rakudo.Metamodel.RakudoObject
Class Rakudo.Metamodel.RakudoObject
Name string
return Rakudo.Metamodel.RakudoObject

get_attr_with_hint() public static method

Gets the value of an attribute, using the given hint.
public static get_attr_with_hint ( ThreadContext TC, RakudoObject Object, RakudoObject Class, string Name, int Hint ) : RakudoObject
TC ThreadContext
Object Rakudo.Metamodel.RakudoObject
Class Rakudo.Metamodel.RakudoObject
Name string
Hint int
return Rakudo.Metamodel.RakudoObject

get_dynamic() public static method

Looks up a variable in the dynamic scope.
public static get_dynamic ( ThreadContext TC, string Name ) : RakudoObject
TC ThreadContext
Name string
return Rakudo.Metamodel.RakudoObject

get_how() public static method

Gets the HOW (higher order workings, e.g. meta-package).
public static get_how ( ThreadContext TC, RakudoObject Obj ) : RakudoObject
TC ThreadContext
Obj Rakudo.Metamodel.RakudoObject
return Rakudo.Metamodel.RakudoObject

get_lex() public static method

Gets a lexical variable of the given name.
public static get_lex ( ThreadContext TC, string Name ) : RakudoObject
TC ThreadContext
Name string
return Rakudo.Metamodel.RakudoObject

get_lex_skip_current() public static method

Gets a lexical variable of the given name, but skips the current scope.
public static get_lex_skip_current ( ThreadContext TC, string Name ) : RakudoObject
TC ThreadContext
Name string
return Rakudo.Metamodel.RakudoObject

get_what() public static method

Gets the WHAT (type object).
public static get_what ( ThreadContext TC, RakudoObject Obj ) : RakudoObject
TC ThreadContext
Obj Rakudo.Metamodel.RakudoObject
return Rakudo.Metamodel.RakudoObject

greater_than_ints() public static method

Compares two integers for greater-than inequality.
public static greater_than_ints ( ThreadContext TC, RakudoObject x, RakudoObject y ) : RakudoObject
TC ThreadContext
x Rakudo.Metamodel.RakudoObject
y Rakudo.Metamodel.RakudoObject
return Rakudo.Metamodel.RakudoObject

greater_than_nums() public static method

Compares two floating point numbers for greater-than inequality.
public static greater_than_nums ( ThreadContext TC, RakudoObject x, RakudoObject y ) : RakudoObject
TC ThreadContext
x Rakudo.Metamodel.RakudoObject
y Rakudo.Metamodel.RakudoObject
return Rakudo.Metamodel.RakudoObject

greater_than_or_equal_ints() public static method

Compares two integers for greater-than-or-equal inequality.
public static greater_than_or_equal_ints ( ThreadContext TC, RakudoObject x, RakudoObject y ) : RakudoObject
TC ThreadContext
x Rakudo.Metamodel.RakudoObject
y Rakudo.Metamodel.RakudoObject
return Rakudo.Metamodel.RakudoObject

greater_than_or_equal_nums() public static method

Compares two floating point numbers for greater-than-or-equal inequality.
public static greater_than_or_equal_nums ( ThreadContext TC, RakudoObject x, RakudoObject y ) : RakudoObject
TC ThreadContext
x RakudoObject
y RakudoObject
return RakudoObject

greater_than_or_equal_strs() public static method

Compares two strings for greater-than-or-equal inequality.
public static greater_than_or_equal_strs ( ThreadContext TC, RakudoObject x, RakudoObject y ) : RakudoObject
TC ThreadContext
x RakudoObject
y RakudoObject
return RakudoObject

greater_than_strs() public static method

Compares two strings for greater-than inequality.
public static greater_than_strs ( ThreadContext TC, RakudoObject x, RakudoObject y ) : RakudoObject
TC ThreadContext
x RakudoObject
y RakudoObject
return RakudoObject

index_str() public static method

Search for the first occurrence of a substring within a string and returns its zero-based index if it's found and -1 if it's not.
public static index_str ( ThreadContext TC, RakudoObject x, RakudoObject y ) : RakudoObject
TC ThreadContext
x RakudoObject
y RakudoObject
return RakudoObject

index_str_index() public static method

Search for the first occurrence of a substring within a string and returns its zero-based index if it's found and -1 if it's not, starting at a specified index.
public static index_str_index ( ThreadContext TC, RakudoObject x, RakudoObject y, RakudoObject z ) : RakudoObject
TC ThreadContext
x RakudoObject
y RakudoObject
z RakudoObject
return RakudoObject

instance_of() public static method

Create an instance of an object.
public static instance_of ( ThreadContext TC, RakudoObject WHAT ) : RakudoObject
TC ThreadContext
WHAT RakudoObject
return RakudoObject

invoke() public static method

Invokes the given method.
public static invoke ( ThreadContext TC, RakudoObject Invokee, RakudoObject Capture ) : RakudoObject
TC ThreadContext
Invokee RakudoObject
Capture RakudoObject
return RakudoObject

is_cclass_str() public static method

Checks whether a character is a member of a particular character class.
public static is_cclass_str ( ThreadContext TC, RakudoObject x, RakudoObject y ) : RakudoObject
TC ThreadContext
x RakudoObject name of the character class as a string
y RakudoObject target string
return RakudoObject

is_cclass_str_index() public static method

Checks whether a character at a particular index in a string is a member of a particular character class.
public static is_cclass_str_index ( ThreadContext TC, RakudoObject x, RakudoObject y, RakudoObject z ) : RakudoObject
TC ThreadContext
x RakudoObject name of the character class as a string
y RakudoObject target string
z RakudoObject integer index into the target string
return RakudoObject

is_dispatcher() public static method

Checks if a routine is considered a dispatcher (that is, if it has a candidate list).
public static is_dispatcher ( ThreadContext TC, RakudoObject Check ) : RakudoObject
TC ThreadContext
Check RakudoObject
return RakudoObject

leave_block() public static method

Leaves the specified block, returning the specified value from it. This unwinds the stack.
public static leave_block ( ThreadContext TC, RakudoObject Block, RakudoObject ReturnValue ) : RakudoObject
TC ThreadContext
Block RakudoObject
ReturnValue RakudoObject
return RakudoObject

length_str() public static method

Returns the length of the string.
public static length_str ( ThreadContext TC, RakudoObject x ) : RakudoObject
TC ThreadContext
x RakudoObject
return RakudoObject

less_than_ints() public static method

Compares two integers for less-than inequality.
public static less_than_ints ( ThreadContext TC, RakudoObject x, RakudoObject y ) : RakudoObject
TC ThreadContext
x RakudoObject
y RakudoObject
return RakudoObject

less_than_nums() public static method

Compares two floating point numbers for less-than inequality.
public static less_than_nums ( ThreadContext TC, RakudoObject x, RakudoObject y ) : RakudoObject
TC ThreadContext
x RakudoObject
y RakudoObject
return RakudoObject

less_than_or_equal_ints() public static method

Compares two integers for less-than-or-equal inequality.
public static less_than_or_equal_ints ( ThreadContext TC, RakudoObject x, RakudoObject y ) : RakudoObject
TC ThreadContext
x RakudoObject
y RakudoObject
return RakudoObject

less_than_or_equal_nums() public static method

Compares two floating point numbers for less-than-or-equal inequality.
public static less_than_or_equal_nums ( ThreadContext TC, RakudoObject x, RakudoObject y ) : RakudoObject
TC ThreadContext
x RakudoObject
y RakudoObject
return RakudoObject

less_than_or_equal_strs() public static method

Compares two strings for less-than-or-equal inequality.
public static less_than_or_equal_strs ( ThreadContext TC, RakudoObject x, RakudoObject y ) : RakudoObject
TC ThreadContext
x RakudoObject
y RakudoObject
return RakudoObject

less_than_strs() public static method

Compares two strings for less-than inequality.
public static less_than_strs ( ThreadContext TC, RakudoObject x, RakudoObject y ) : RakudoObject
TC ThreadContext
x RakudoObject
y RakudoObject
return RakudoObject

lllist_bind_at_pos() public static method

Binds a value at a given positional index from a low level list (something that uses the P6list representation).
public static lllist_bind_at_pos ( ThreadContext TC, RakudoObject LLList, RakudoObject IndexObj, RakudoObject Value ) : RakudoObject
TC ThreadContext
LLList RakudoObject
IndexObj RakudoObject
Value RakudoObject
return RakudoObject

lllist_elems() public static method

Gets the number of elements in a low level list (something that uses the P6list representation).
public static lllist_elems ( ThreadContext TC, RakudoObject LLList ) : RakudoObject
TC ThreadContext
LLList RakudoObject
return RakudoObject

lllist_get_at_pos() public static method

Gets a value at a given positional index from a low level list (something that uses the P6list representation).
public static lllist_get_at_pos ( ThreadContext TC, RakudoObject LLList, RakudoObject Index ) : RakudoObject
TC ThreadContext
LLList RakudoObject
Index RakudoObject
return RakudoObject

lllist_get_at_pos() public static method

public static lllist_get_at_pos ( ThreadContext TC, RakudoObject LLList, int index ) : RakudoObject
TC ThreadContext
LLList RakudoObject
index int
return RakudoObject

lllist_pop() public static method

Pops a value from a low level list (something that uses the P6list representation).
public static lllist_pop ( ThreadContext TC, RakudoObject LLList ) : RakudoObject
TC ThreadContext
LLList RakudoObject
return RakudoObject

lllist_push() public static method

Pushes a value to a low level list (something that uses the P6list representation).
public static lllist_push ( ThreadContext TC, RakudoObject LLList, RakudoObject item ) : RakudoObject
TC ThreadContext
LLList RakudoObject
item RakudoObject
return RakudoObject

lllist_shift() public static method

Shifts a value from a low level list (something that uses the P6list representation).
public static lllist_shift ( ThreadContext TC, RakudoObject LLList ) : RakudoObject
TC ThreadContext
LLList RakudoObject
return RakudoObject

lllist_truncate_to() public static method

Truncates a LLList to a prescribed length. Mimics parrot's assign integer to array.
public static lllist_truncate_to ( ThreadContext TC, RakudoObject LLList, RakudoObject Length ) : RakudoObject
TC ThreadContext
LLList RakudoObject
Length RakudoObject
return RakudoObject

lllist_unshift() public static method

Unshifts a value to a low level list (something that uses the P6list representation).
public static lllist_unshift ( ThreadContext TC, RakudoObject LLList, RakudoObject item ) : RakudoObject
TC ThreadContext
LLList RakudoObject
item RakudoObject
return RakudoObject

llmapping_bind_at_key() public static method

Binds a value at a given key from a low level mapping (something that uses the P6mapping representation).
public static llmapping_bind_at_key ( ThreadContext TC, RakudoObject LLMapping, RakudoObject Key, RakudoObject Value ) : RakudoObject
TC ThreadContext
LLMapping RakudoObject
Key RakudoObject
Value RakudoObject
return RakudoObject

llmapping_elems() public static method

Gets the number of elements in a low level mapping (something that uses the P6mapping representation).
public static llmapping_elems ( ThreadContext TC, RakudoObject LLMapping ) : RakudoObject
TC ThreadContext
LLMapping RakudoObject
return RakudoObject

llmapping_get_at_key() public static method

Gets a value at a given key from a low level mapping (something that uses the P6mapping representation).
public static llmapping_get_at_key ( ThreadContext TC, RakudoObject LLMapping, RakudoObject Key ) : RakudoObject
TC ThreadContext
LLMapping RakudoObject
Key RakudoObject
return RakudoObject

load_module() public static method

Loads a module (that is, some pre-compiled compilation unit that was compiled using NQP). Expects the path minus an extension (that is, the .dll will be added). Returns what the body of the compilation unit evaluated to.
public static load_module ( ThreadContext TC, RakudoObject Path ) : RakudoObject
TC ThreadContext
Path RakudoObject
return RakudoObject

logical_not_int() public static method

Logical not.
public static logical_not_int ( ThreadContext TC, int x ) : int
TC ThreadContext
x int
return int

mod_int() public static method

Performs an integer modulo.
public static mod_int ( ThreadContext TC, int x, int y ) : int
TC ThreadContext
x int
y int
return int

mul_int() public static method

Performs an integer multiplication.
public static mul_int ( ThreadContext TC, int x, int y ) : int
TC ThreadContext
x int
y int
return int

mul_num() public static method

Performs a numeric multiplication.
public static mul_num ( ThreadContext TC, RakudoObject x, RakudoObject y ) : RakudoObject
TC ThreadContext
x RakudoObject
y RakudoObject
return RakudoObject

multi_dispatch_over_lexical_candidates() public static method

Entry point to multi-dispatch over the current dispatchee list.
public static multi_dispatch_over_lexical_candidates ( ThreadContext TC ) : RakudoObject
TC ThreadContext
return RakudoObject

new_closure() public static method

Creates a clone of the given code object, and makes its outer context be set to the current context.
public static new_closure ( ThreadContext TC, RakudoCodeRef Block ) : RakudoObject
TC ThreadContext
Block RakudoCodeRef
return RakudoObject

publish_method_cache() public static method

Publishes a method dispatch cache - essentially, a set of name to code object mappings.
public static publish_method_cache ( ThreadContext TC, RakudoObject WHAT, RakudoObject MethodCacheHash ) : RakudoObject
TC ThreadContext
WHAT RakudoObject
MethodCacheHash RakudoObject
return RakudoObject

publish_type_check_cache() public static method

Publishes a type check cache. The list of accepted types must use the P6list representation.
public static publish_type_check_cache ( ThreadContext TC, RakudoObject WHAT, RakudoObject TypeList ) : RakudoObject
TC ThreadContext
WHAT RakudoObject
TypeList RakudoObject
return RakudoObject

push_dispatchee() public static method

Adds a single new candidate to the end of a dispatcher's candidate list.
public static push_dispatchee ( ThreadContext TC, RakudoObject Dispatcher, RakudoObject Dispatchee ) : RakudoObject
TC ThreadContext
Dispatcher RakudoObject
Dispatchee RakudoObject
return RakudoObject

repr_defined() public static method

Checks if the representation considers the object defined.
public static repr_defined ( ThreadContext TC, RakudoObject Obj ) : RakudoObject
TC ThreadContext
Obj RakudoObject
return RakudoObject

set_dispatchees() public static method

Sets the dispatches of the given code object. Expects something with RakudoCodeRef and P6list representation respectively.
public static set_dispatchees ( ThreadContext TC, RakudoObject CodeObject, RakudoObject Dispatchees ) : RakudoObject
TC ThreadContext
CodeObject RakudoObject
Dispatchees RakudoObject
return RakudoObject

split_str() public static method

Split the first string by the first character of the second string returning an NQPList of the results.
public static split_str ( ThreadContext TC, RakudoObject x, RakudoObject y ) : RakudoObject
TC ThreadContext
x RakudoObject
y RakudoObject
return RakudoObject

sub_int() public static method

Performs an integer subtraction.
public static sub_int ( ThreadContext TC, int x, int y ) : int
TC ThreadContext
x int
y int
return int

sub_num() public static method

Performs a numeric subtraction.
public static sub_num ( ThreadContext TC, RakudoObject x, RakudoObject y ) : RakudoObject
TC ThreadContext
x RakudoObject
y RakudoObject
return RakudoObject

substr() public static method

Performs a string substring.
public static substr ( ThreadContext TC, RakudoObject x, RakudoObject y ) : RakudoObject
TC ThreadContext
x RakudoObject
y RakudoObject
return RakudoObject

substr() public static method

Performs a string substring.
public static substr ( ThreadContext TC, RakudoObject x, RakudoObject y, RakudoObject z ) : RakudoObject
TC ThreadContext
x RakudoObject
y RakudoObject
z RakudoObject
return RakudoObject

throw_dynamic() public static method

Throws the specified exception, looking for an exception handler in the dynamic scope.
public static throw_dynamic ( ThreadContext TC, RakudoObject ExceptionObject, RakudoObject ExceptionType ) : RakudoObject
TC ThreadContext
ExceptionObject RakudoObject
ExceptionType RakudoObject
return RakudoObject

throw_lexical() public static method

Throws the specified exception, looking for an exception handler in the lexical scope.
public static throw_lexical ( ThreadContext TC, RakudoObject ExceptionObject, RakudoObject ExceptionType ) : RakudoObject
TC ThreadContext
ExceptionObject RakudoObject
ExceptionType RakudoObject
return RakudoObject

type_check() public static method

Checks if the given object's type accepts the checked type, using the type check cache if one was published.
public static type_check ( ThreadContext TC, RakudoObject ToCheck, RakudoObject WantedType ) : RakudoObject
TC ThreadContext
ToCheck RakudoObject
WantedType RakudoObject
return RakudoObject

type_object_for() public static method

Creates a type object associated with the given HOW and of the given representation.
public static type_object_for ( ThreadContext TC, RakudoObject HOW, RakudoObject REPRName ) : RakudoObject
TC ThreadContext
HOW RakudoObject
REPRName RakudoObject
return RakudoObject

unbox_int() public static method

Unboxes a boxed int.
public static unbox_int ( ThreadContext TC, RakudoObject Boxed ) : int
TC ThreadContext
Boxed RakudoObject
return int

unbox_num() public static method

Unboxes a boxed num.
public static unbox_num ( ThreadContext TC, RakudoObject Boxed ) : double
TC ThreadContext
Boxed RakudoObject
return double

unbox_str() public static method

Unboxes a boxed string.
public static unbox_str ( ThreadContext TC, RakudoObject Boxed ) : string
TC ThreadContext
Boxed RakudoObject
return string

vivify() public static method

If the first passed object reference is not null, returns it. Otherwise, returns the second passed object reference. (Note, we should one day drop this and implement it as a compiler transformation, to avoid having to look up the thing to vivify).
public static vivify ( ThreadContext TC, RakudoObject Check, RakudoObject VivifyWith ) : RakudoObject
TC ThreadContext
Check RakudoObject
VivifyWith RakudoObject
return RakudoObject