#include "WfRuntime.h"
#include <math.h>
#ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA
namespace
{
namespace
{
namespace
{
using
namespace
collections
;
using
namespace
reflection
;
using
namespace
reflection
::
description
;
using
namespace
typeimpl
;
#define INTERNAL_ERROR(MESSAGE)\
do{\
context.RaiseException(WString(L"Internal error: " MESSAGE), true);\
return WfRuntimeExecutionAction::Nop; \
} while (0)\
#define CONTEXT_ACTION(ACTION, MESSAGE)\
do{\
if ((context.ACTION) != WfRuntimeThreadContextError::Success)\
{\
INTERNAL_ERROR(MESSAGE);\
}\
} while (0)\
#define UNARY_OPERATOR(NAME, OPERATOR)\
template<typename T>\
WfRuntimeExecutionAction OPERATOR_##NAME(WfRuntimeThreadContext& context)\
{\
Value operand;\
CONTEXT_ACTION(PopValue(operand), L"failed to pop a value from the stack.");\
T value = OPERATOR UnboxValue<T>(operand);\
CONTEXT_ACTION(PushValue(BoxValue(value)), L"failed to push a value to the stack.");\
return WfRuntimeExecutionAction::ExecuteInstruction;\
}\
#define BINARY_OPERATOR(NAME, OPERATOR)\
template<typename T>\
WfRuntimeExecutionAction OPERATOR_##NAME(WfRuntimeThreadContext& context)\
{\
Value first, second;\
CONTEXT_ACTION(PopValue(second), L"failed to pop a value from the stack.");\
CONTEXT_ACTION(PopValue(first), L"failed to pop a value from the stack.");\
T value = UnboxValue<T>(first) OPERATOR UnboxValue<T>(second);\
CONTEXT_ACTION(PushValue(BoxValue(value)), L"failed to push a value to the stack.");\
return WfRuntimeExecutionAction::ExecuteInstruction;\
}\
UNARY_OPERATOR(OpNot, ~)
template
<
typename
>
(
&
) {
;
do
{
if
((
.
(
operand
)) !=
WfRuntimeThreadContextError
::
) {
do
{
.
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
= ~
<
>(
operand
);
do
{
if
((
.
(
(
value
))) !=
WfRuntimeThreadContextError
::
) {
do
{
.
(
(
L"Internal error: "
L"failed to push a value to the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
return
::
; }
UNARY_OPERATOR(OpNot_Bool, !)
template
<
typename
>
(
&
) {
;
do
{
if
((
.
(
operand
)) !=
WfRuntimeThreadContextError
::
) {
do
{
.
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
= !
<
>(
operand
);
do
{
if
((
.
(
(
value
))) !=
WfRuntimeThreadContextError
::
) {
do
{
.
(
(
L"Internal error: "
L"failed to push a value to the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
return
::
; }
UNARY_OPERATOR(OpPositive, +)
template
<
typename
>
(
&
) {
;
do
{
if
((
.
(
operand
)) !=
WfRuntimeThreadContextError
::
) {
do
{
.
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
= +
<
>(
operand
);
do
{
if
((
.
(
(
value
))) !=
WfRuntimeThreadContextError
::
) {
do
{
.
(
(
L"Internal error: "
L"failed to push a value to the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
return
::
; }
UNARY_OPERATOR(OpNegative, -)
template
<
typename
>
(
&
) {
;
do
{
if
((
.
(
operand
)) !=
WfRuntimeThreadContextError
::
) {
do
{
.
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
= -
<
>(
operand
);
do
{
if
((
.
(
(
value
))) !=
WfRuntimeThreadContextError
::
) {
do
{
.
(
(
L"Internal error: "
L"failed to push a value to the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
return
::
; }
BINARY_OPERATOR(OpAdd, +)
template
<
typename
>
(
&
) {
,
;
do
{
if
((
.
(
second
)) !=
WfRuntimeThreadContextError
::
) {
do
{
.
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
do
{
if
((
.
(
first
)) !=
WfRuntimeThreadContextError
::
) {
do
{
.
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
=
<
>(
first
) +
<
>(
second
);
do
{
if
((
.
(
(
value
))) !=
WfRuntimeThreadContextError
::
) {
do
{
.
(
(
L"Internal error: "
L"failed to push a value to the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
return
::
; }
BINARY_OPERATOR(OpSub, -)
template
<
typename
>
(
&
) {
,
;
do
{
if
((
.
(
second
)) !=
WfRuntimeThreadContextError
::
) {
do
{
.
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
do
{
if
((
.
(
first
)) !=
WfRuntimeThreadContextError
::
) {
do
{
.
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
=
<
>(
first
) -
<
>(
second
);
do
{
if
((
.
(
(
value
))) !=
WfRuntimeThreadContextError
::
) {
do
{
.
(
(
L"Internal error: "
L"failed to push a value to the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
return
::
; }
BINARY_OPERATOR(OpMul, *)
template
<
typename
>
(
&
) {
,
;
do
{
if
((
.
(
second
)) !=
WfRuntimeThreadContextError
::
) {
do
{
.
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
do
{
if
((
.
(
first
)) !=
WfRuntimeThreadContextError
::
) {
do
{
.
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
=
<
>(
first
) *
<
>(
second
);
do
{
if
((
.
(
(
value
))) !=
WfRuntimeThreadContextError
::
) {
do
{
.
(
(
L"Internal error: "
L"failed to push a value to the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
return
::
; }
BINARY_OPERATOR(OpDiv, /)
template
<
typename
>
(
&
) {
,
;
do
{
if
((
.
(
second
)) !=
WfRuntimeThreadContextError
::
) {
do
{
.
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
do
{
if
((
.
(
first
)) !=
WfRuntimeThreadContextError
::
) {
do
{
.
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
=
<
>(
first
) /
<
>(
second
);
do
{
if
((
.
(
(
value
))) !=
WfRuntimeThreadContextError
::
) {
do
{
.
(
(
L"Internal error: "
L"failed to push a value to the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
return
::
; }
BINARY_OPERATOR(OpMod, %)
template
<
typename
>
(
&
) {
,
;
do
{
if
((
.
(
second
)) !=
WfRuntimeThreadContextError
::
) {
do
{
.
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
do
{
if
((
.
(
first
)) !=
WfRuntimeThreadContextError
::
) {
do
{
.
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
=
<
>(
first
) %
<
>(
second
);
do
{
if
((
.
(
(
value
))) !=
WfRuntimeThreadContextError
::
) {
do
{
.
(
(
L"Internal error: "
L"failed to push a value to the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
return
::
; }
BINARY_OPERATOR(OpShl, <<)
template
<
typename
>
(
&
) {
,
;
do
{
if
((
.
(
second
)) !=
WfRuntimeThreadContextError
::
) {
do
{
.
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
do
{
if
((
.
(
first
)) !=
WfRuntimeThreadContextError
::
) {
do
{
.
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
=
<
>(
first
) <<
<
>(
second
);
do
{
if
((
.
(
(
value
))) !=
WfRuntimeThreadContextError
::
) {
do
{
.
(
(
L"Internal error: "
L"failed to push a value to the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
return
::
; }
BINARY_OPERATOR(OpShr, >>)
template
<
typename
>
(
&
) {
,
;
do
{
if
((
.
(
second
)) !=
WfRuntimeThreadContextError
::
) {
do
{
.
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
do
{
if
((
.
(
first
)) !=
WfRuntimeThreadContextError
::
) {
do
{
.
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
=
<
>(
first
) >>
<
>(
second
);
do
{
if
((
.
(
(
value
))) !=
WfRuntimeThreadContextError
::
) {
do
{
.
(
(
L"Internal error: "
L"failed to push a value to the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
return
::
; }
BINARY_OPERATOR(OpAnd, &)
template
<
typename
>
(
&
) {
,
;
do
{
if
((
.
(
second
)) !=
WfRuntimeThreadContextError
::
) {
do
{
.
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
do
{
if
((
.
(
first
)) !=
WfRuntimeThreadContextError
::
) {
do
{
.
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
=
<
>(
first
) &
<
>(
second
);
do
{
if
((
.
(
(
value
))) !=
WfRuntimeThreadContextError
::
) {
do
{
.
(
(
L"Internal error: "
L"failed to push a value to the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
return
::
; }
BINARY_OPERATOR(OpAnd_Bool, &&)
template
<
typename
>
(
&
) {
,
;
do
{
if
((
.
(
second
)) !=
WfRuntimeThreadContextError
::
) {
do
{
.
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
do
{
if
((
.
(
first
)) !=
WfRuntimeThreadContextError
::
) {
do
{
.
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
=
<
>(
first
) &&
<
>(
second
);
do
{
if
((
.
(
(
value
))) !=
WfRuntimeThreadContextError
::
) {
do
{
.
(
(
L"Internal error: "
L"failed to push a value to the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
return
::
; }
BINARY_OPERATOR(OpOr, |)
template
<
typename
>
(
&
) {
,
;
do
{
if
((
.
(
second
)) !=
WfRuntimeThreadContextError
::
) {
do
{
.
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
do
{
if
((
.
(
first
)) !=
WfRuntimeThreadContextError
::
) {
do
{
.
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
=
<
>(
first
) |
<
>(
second
);
do
{
if
((
.
(
(
value
))) !=
WfRuntimeThreadContextError
::
) {
do
{
.
(
(
L"Internal error: "
L"failed to push a value to the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
return
::
; }
BINARY_OPERATOR(OpOr_Bool, ||)
template
<
typename
>
(
&
) {
,
;
do
{
if
((
.
(
second
)) !=
WfRuntimeThreadContextError
::
) {
do
{
.
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
do
{
if
((
.
(
first
)) !=
WfRuntimeThreadContextError
::
) {
do
{
.
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
=
<
>(
first
) ||
<
>(
second
);
do
{
if
((
.
(
(
value
))) !=
WfRuntimeThreadContextError
::
) {
do
{
.
(
(
L"Internal error: "
L"failed to push a value to the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
return
::
; }
BINARY_OPERATOR(OpXor, ^)
template
<
typename
>
(
&
) {
,
;
do
{
if
((
.
(
second
)) !=
WfRuntimeThreadContextError
::
) {
do
{
.
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
do
{
if
((
.
(
first
)) !=
WfRuntimeThreadContextError
::
) {
do
{
.
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
=
<
>(
first
) ^
<
>(
second
);
do
{
if
((
.
(
(
value
))) !=
WfRuntimeThreadContextError
::
) {
do
{
.
(
(
L"Internal error: "
L"failed to push a value to the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
return
::
; }
template
<
typename
>
(
&
)
{
,
;
CONTEXT_ACTION(PopValue(second), L"failed to pop a value from the stack.");
do
{
if
((
.
(
second
)) !=
WfRuntimeThreadContextError
::
) {
do
{
.
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
CONTEXT_ACTION(PopValue(first), L"failed to pop a value from the stack.");
do
{
if
((
.
(
first
)) !=
WfRuntimeThreadContextError
::
) {
do
{
.
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
=
<
>(
first
);
=
<
>(
second
);
= (
)
(
secondValue
*
(
firstValue
));
CONTEXT_ACTION(PushValue(BoxValue(value)), L"failed to push a value to the stack.");
do
{
if
((
.
(
(
value
))) !=
WfRuntimeThreadContextError
::
) {
do
{
.
(
(
L"Internal error: "
L"failed to push a value to the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
return
::
;
}
template
<
typename
>
(
&
)
{
,
;
CONTEXT_ACTION(PopValue(second), L"failed to pop a value from the stack.");
do
{
if
((
.
(
second
)) !=
WfRuntimeThreadContextError
::
) {
do
{
.
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
CONTEXT_ACTION(PopValue(first), L"failed to pop a value from the stack.");
do
{
if
((
.
(
first
)) !=
WfRuntimeThreadContextError
::
) {
do
{
.
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
bool
=
first
.
() ==
::
;
bool
=
second
.
() ==
::
;
if
(
firstNull
)
{
if
(
secondNull
)
{
CONTEXT_ACTION(PushValue(BoxValue((vint)0)), L"failed to push a value to the stack.");
do
{
if
((
.
(
((
)
0
))) !=
WfRuntimeThreadContextError
::
) {
do
{
.
(
(
L"Internal error: "
L"failed to push a value to the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
}
else
{
CONTEXT_ACTION(PushValue(BoxValue((vint)-1)), L"failed to push a value to the stack.");
do
{
if
((
.
(
((
)-
1
))) !=
WfRuntimeThreadContextError
::
) {
do
{
.
(
(
L"Internal error: "
L"failed to push a value to the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
}
}
else
{
if
(
secondNull
)
{
CONTEXT_ACTION(PushValue(BoxValue((vint)1)), L"failed to push a value to the stack.");
do
{
if
((
.
(
((
)
1
))) !=
WfRuntimeThreadContextError
::
) {
do
{
.
(
(
L"Internal error: "
L"failed to push a value to the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
}
else
{
=
<
>(
first
);
=
<
>(
second
);
if
(
firstValue
<
secondValue
)
{
CONTEXT_ACTION(PushValue(BoxValue((vint)-1)), L"failed to push a value to the stack.");
do
{
if
((
.
(
((
)-
1
))) !=
WfRuntimeThreadContextError
::
) {
do
{
.
(
(
L"Internal error: "
L"failed to push a value to the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
}
else
if
(
firstValue
>
secondValue
)
{
CONTEXT_ACTION(PushValue(BoxValue((vint)1)), L"failed to push a value to the stack.");
do
{
if
((
.
(
((
)
1
))) !=
WfRuntimeThreadContextError
::
) {
do
{
.
(
(
L"Internal error: "
L"failed to push a value to the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
}
else
{
CONTEXT_ACTION(PushValue(BoxValue((vint)0)), L"failed to push a value to the stack.");
do
{
if
((
.
(
((
)
0
))) !=
WfRuntimeThreadContextError
::
) {
do
{
.
(
(
L"Internal error: "
L"failed to push a value to the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
}
}
}
return
::
;
}
bool
(
const
&
,
&
,
const
&
)
{
switch
(
.
)
{
case
::
:
return
false
;
case
::
:
if
(
.
() ==
::
)
{
return
false
;
}
else
if
(
.
())
{
if
(
.
()->
(
.
))
{
::
(
.
());
}
else
{
return
false
;
}
}
break
;
case
::
:
if
(
.
() ==
::
)
{
return
false
;
}
else
if
(
.
())
{
if
(
.
()->
(
.
))
{
::
(
<
>(
.
()));
}
else
{
return
false
;
}
}
break
;
case
::
:
if
(
.
() !=
::
)
{
return
false
;
}
if
(
.
() ==
.
)
{
;
return
true
;
}
if
(
auto
=
.
()->
())
{
if
(
auto
=
.
->
())
{
;
return
stFrom
->
(
,
text
) &&
stTo
->
(
text
,
);
}
else
{
switch
(
.
->
())
{
case
::
:
case
::
:
if
(
.
() !=
<
>())
{
return
false
;
}
else
{
auto
=
.
().
<
::
<
>>()
;
.
->
()->
(
intValue
);
}
break
;
default
:
return
false
;
}
}
}
else
{
switch
(
.
()->
())
{
case
::
:
case
::
:
if
(
.
!=
<
>())
{
return
false
;
}
else
{
auto
=
.
()->
()->
(
);
<
>(
intValue
);
}
break
;
default
:
return
false
;
}
}
}
return
true
;
}
template
<
typename
>
(
&
)
{
,
;
CONTEXT_ACTION(PopValue(second), L"failed to pop a value from the stack.");
do
{
if
((
.
(
second
)) !=
WfRuntimeThreadContextError
::
) {
do
{
.
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
CONTEXT_ACTION(PopValue(first), L"failed to pop a value from the stack.");
do
{
if
((
.
(
first
)) !=
WfRuntimeThreadContextError
::
) {
do
{
.
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
=
<
>(
first
);
=
<
>(
second
);
auto
=
<
<
>>(
firstValue
,
secondValue
);
CONTEXT_ACTION(PushValue(Value::From(enumerable)), L"failed to push a value to the stack.");
do
{
if
((
.
(
::
(
enumerable
))) !=
WfRuntimeThreadContextError
::
) {
do
{
.
(
(
L"Internal error: "
L"failed to push a value to the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
return
::
;
}
#undef INTERNAL_ERROR
#undef CONTEXT_ACTION
#undef UNARY_OPERATOR
#undef BINARY_OPERATOR
<
reflection
::
description
::
>
(
<
>
,
const
&
)
{
const
auto
&
=
];
CHECK_ERROR(names.Count() == 1, L"vl::workflow::runtime::LoadFunction(Ptr<WfRUntimeGlobalContext>, const WString&)#Multiple functions are found.");
do
{
if
(!(
names
.
() ==
1
))
throw
(
L"vl::workflow::runtime::LoadFunction(Ptr<WfRUntimeGlobalContext>, const WString&)#Multiple functions are found."
);}
while
(
0
);
=
names
0
];
auto
=
<
>(
,
nullptr
,
functionIndex
);
return
lambda
;
}
#define INTERNAL_ERROR(MESSAGE)\
do{\
RaiseException(WString(L"Internal error: " MESSAGE), true);\
return WfRuntimeExecutionAction::Nop; \
} while (0)\
#define CONTEXT_ACTION(ACTION, MESSAGE)\
do{\
if ((ACTION) != WfRuntimeThreadContextError::Success)\
{\
INTERNAL_ERROR(MESSAGE);\
}\
} while (0)\
#define CALL_DEBUGGER(ACTION)\
do {\
if (callback)\
{\
if (ACTION)\
{\
if (!callback->WaitForContinue())\
{\
INTERNAL_ERROR(L"Debugger stopped the program.");\
}\
}\
}\
} while (0)\
#define TYPE_OF_Bool bool
#define TYPE_OF_I1 vint8_t
#define TYPE_OF_I2 vint16_t
#define TYPE_OF_I4 vint32_t
#define TYPE_OF_I8 vint64_t
#define TYPE_OF_U1 vuint8_t
#define TYPE_OF_U2 vuint16_t
#define TYPE_OF_U4 vuint32_t
#define TYPE_OF_U8 vuint64_t
#define TYPE_OF_F4 float
#define TYPE_OF_F8 double
#define TYPE_OF_String WString
#define EXECUTE(OPERATION, TYPE) case WfInsType::TYPE: return OPERATOR_##OPERATION<TYPE_OF_##TYPE>(*this);
#define BEGIN_TYPE switch(ins.typeParameter) {
#define END_TYPE default: INTERNAL_ERROR(L"unexpected type argument."); }
::
(
&
,
&
,
*
)
{
switch
(
.
)
{
case
::
:
CONTEXT_ACTION(PushRuntimeValue(ins.valueParameter), L"failed to push a value to the stack.");
do
{
if
((
(
.
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to push a value to the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
return
::
;
case
::
:
{
CONTEXT_ACTION(PushValue(BoxValue(ins.indexParameter)), L"failed to push a value to the stack.");
do
{
if
((
(
(
.
))) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to push a value to the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
return
::
;
}
case
::
:
{
CONTEXT_ACTION(PushValue(BoxValue(exceptionInfo)), L"failed to push a value to the stack.");
do
{
if
((
(
(
))) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to push a value to the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
return
::
;
}
case
::
:
{
;
CONTEXT_ACTION(LoadLocalVariable(ins.indexParameter, operand), L"illegal local variable index.");
do
{
if
((
(
.
,
operand
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"illegal local variable index."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
CONTEXT_ACTION(PushValue(operand), L"failed to push a value to the stack.");
do
{
if
((
(
operand
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to push a value to the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
return
::
;
}
case
::
:
{
;
CONTEXT_ACTION(LoadCapturedVariable(ins.indexParameter, operand), L"illegal captured variable index.");
do
{
if
((
(
.
,
operand
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"illegal captured variable index."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
CONTEXT_ACTION(PushValue(operand), L"failed to push a value to the stack.");
do
{
if
((
(
operand
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to push a value to the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
return
::
;
}
case
::
:
{
CALL_DEBUGGER(callback->BreakRead(globalContext->assembly.Obj(), ins.indexParameter));
do
{
if
(
) {
if
(
->
(
.
(),
.
)) {
if
(!
->
()) {
do
{
(
(
L"Internal error: "
L"Debugger stopped the program."
),
true
);
return
::
; }
while
(
0
); } } } }
while
(
0
);
;
CONTEXT_ACTION(LoadGlobalVariable(ins.indexParameter, operand), L"illegal global variable index.");
do
{
if
((
(
.
,
operand
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"illegal global variable index."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
CONTEXT_ACTION(PushValue(operand), L"failed to push a value to the stack.");
do
{
if
((
(
operand
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to push a value to the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
return
::
;
}
case
::
:
{
CONTEXT_ACTION(PushValue(Value::From(ins.methodParameter)), L"failed to push a value to the stack.");
do
{
if
((
(
::
(
.
))) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to push a value to the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
return
::
;
}
case
::
:
{
;
CONTEXT_ACTION(PopValue(operand), L"failed to pop a value from the stack.");
do
{
if
((
(
operand
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
auto
=
.
->
(
operand
);
CONTEXT_ACTION(PushValue(closure), L"failed to push a value to the stack.");
do
{
if
((
(
closure
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to push a value to the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
return
::
;
}
case
::
:
{
auto
=
().
;
CONTEXT_ACTION(PushValue(Value::From(capturedVariables)), L"failed to push a value to the stack.");
do
{
if
((
(
::
(
capturedVariables
))) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to push a value to the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
return
::
;
}
case
::
:
{
;
CONTEXT_ACTION(PopValue(operand), L"failed to pop a value from the stack.");
do
{
if
((
(
operand
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
CONTEXT_ACTION(StoreLocalVariable(ins.indexParameter, operand), L"illegal local variable index.");
do
{
if
((
(
.
,
operand
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"illegal local variable index."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
return
::
;
}
case
::
:
{
;
CONTEXT_ACTION(PopValue(operand), L"failed to pop a value from the stack.");
do
{
if
((
(
operand
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
CONTEXT_ACTION(StoreCapturedVariable(ins.indexParameter, operand), L"illegal global variable index.");
do
{
if
((
(
.
,
operand
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"illegal global variable index."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
return
::
;
}
case
::
:
{
CALL_DEBUGGER(callback->BreakWrite(globalContext->assembly.Obj(), ins.indexParameter));
do
{
if
(
) {
if
(
->
(
.
(),
.
)) {
if
(!
->
()) {
do
{
(
(
L"Internal error: "
L"Debugger stopped the program."
),
true
);
return
::
; }
while
(
0
); } } } }
while
(
0
);
;
CONTEXT_ACTION(PopValue(operand), L"failed to pop a value from the stack.");
do
{
if
((
(
operand
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
CONTEXT_ACTION(StoreGlobalVariable(ins.indexParameter, operand), L"illegal global variable index.");
do
{
if
((
(
.
,
operand
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"illegal global variable index."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
return
::
;
}
case
::
:
{
=
.
() -
1
-
.
;
;
CONTEXT_ACTION(LoadStackValue(index, operand), L"failed to duplicate a value from the stack.");
do
{
if
((
(
index
,
operand
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to duplicate a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
CONTEXT_ACTION(PushValue(operand), L"failed to push a value to the stack.");
do
{
if
((
(
operand
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to push a value to the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
return
::
;
}
case
::
:
{
;
CONTEXT_ACTION(PopValue(operand), L"failed to pop a value from the stack.");
do
{
if
((
(
operand
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
return
::
;
}
case
::
:
{
;
CONTEXT_ACTION(PopValue(operand), L"failed to pop the function result.");
do
{
if
((
(
operand
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to pop the function result."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
CONTEXT_ACTION(PopStackFrame(), L"failed to pop the stack frame.");
do
{
if
((
()) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to pop the stack frame."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
CONTEXT_ACTION(PushValue(operand), L"failed to push a value to the stack.");
do
{
if
((
(
operand
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to push a value to the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
if
(
.
() ==
0
)
{
=
::
;
}
return
::
;
}
case
::
:
{
auto
=
::
();
;
for
(
=
0
;
i
<
.
;
i
++)
{
CONTEXT_ACTION(PopValue(operand), L"failed to pop a value from the stack.");
do
{
if
((
(
operand
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
list
(
operand
);
}
CONTEXT_ACTION(PushValue(Value::From(list)), L"failed to push a value to the stack.");
do
{
if
((
(
::
(
list
))) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to push a value to the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
return
::
;
}
case
::
:
{
auto
=
::
();
;
for
(
=
0
;
i
<
.
;
i
++)
{
CONTEXT_ACTION(PopValue(operand), L"failed to pop a value from the stack.");
do
{
if
((
(
operand
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
list
(
operand
);
}
CONTEXT_ACTION(PushValue(Value::From(list)), L"failed to push a value to the stack.");
do
{
if
((
(
::
(
list
))) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to push a value to the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
return
::
;
}
case
::
:
{
auto
=
::
();
,
;
for
(
=
0
;
i
<
.
;
i
+=
2
)
{
CONTEXT_ACTION(PopValue(value), L"failed to pop a value from the stack.");
do
{
if
((
(
value
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
CONTEXT_ACTION(PopValue(key), L"failed to pop a value from the stack.");
do
{
if
((
(
key
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
map
(
key
,
value
);
}
CONTEXT_ACTION(PushValue(Value::From(map)), L"failed to push a value to the stack.");
do
{
if
((
(
::
(
map
))) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to push a value to the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
return
::
;
}
case
::
:
{
<
>
;
if
(
.
>
0
)
{
capturedVariables
new
;
capturedVariables
.
(
.
);
;
for
(
=
0
;
i
<
.
;
i
++)
{
CONTEXT_ACTION(PopValue(operand), L"failed to pop a value from the stack.");
do
{
if
((
(
operand
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
capturedVariables
.
-
1
-
i
]
operand
;
}
}
CONTEXT_ACTION(PushValue(Value::From(capturedVariables)), L"failed to push a value to the stack.");
do
{
if
((
(
::
(
capturedVariables
))) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to push a value to the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
return
::
;
}
case
::
:
{
,
;
CONTEXT_ACTION(PopValue(function), L"failed to pop a value from the stack.");
do
{
if
((
(
function
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
CONTEXT_ACTION(PopValue(context), L"failed to pop a value from the stack.");
do
{
if
((
(
context
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
auto
=
context
.
().
<
>();
auto
=
<
>(
function
);
auto
=
<
>(
,
capturedVariables
,
functionIndex
);
CONTEXT_ACTION(PushValue(Value::From(lambda)), L"failed to push a value to the stack.");
do
{
if
((
(
::
(
lambda
))) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to push a value to the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
return
::
;
}
case
::
:
{
auto
=
<
WfRuntimeInterfaceInstance
>();
,
,
;
for
(
=
0
;
i
<
.
;
i
+=
2
)
{
CONTEXT_ACTION(PopValue(value), L"failed to pop a value from the stack.");
do
{
if
((
(
value
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
CONTEXT_ACTION(PopValue(key), L"failed to pop a value from the stack.");
do
{
if
((
(
key
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
auto
=
<
*>(
key
);
auto
=
<
>(
value
);
proxy
.
(
name
,
func
);
}
CONTEXT_ACTION(PopValue(operand), L"failed to pop a value from the stack.");
do
{
if
((
(
operand
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
auto
=
operand
.
().
<
>();
proxy
capturedVariables
;
proxy
;
<
>
(
1
);
arguments
0
]
::
(
proxy
);
auto
=
.
->
(
(),
arguments
);
capturedVariables
capturedVariables
.
() -
1
]
::
(
obj
.
());
CONTEXT_ACTION(PushValue(obj), L"failed to push a value to the stack.");
do
{
if
((
(
obj
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to push a value to the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
return
::
;
}
case
::
:
EXECUTE(OpCreateRange, I1)
case
::
:
return
<
>(*
this
);
EXECUTE(OpCreateRange, I2)
case
::
:
return
<
>(*
this
);
EXECUTE(OpCreateRange, I4)
case
::
:
return
<
>(*
this
);
EXECUTE(OpCreateRange, I8)
case
::
:
return
<
>(*
this
);
EXECUTE(OpCreateRange, U1)
case
::
:
return
<
>(*
this
);
EXECUTE(OpCreateRange, U2)
case
::
:
return
<
>(*
this
);
EXECUTE(OpCreateRange, U4)
case
::
:
return
<
>(*
this
);
EXECUTE(OpCreateRange, U8)
case
::
:
return
<
>(*
this
);
END_TYPE
default
:
do
{
(
(
L"Internal error: "
L"unexpected type argument."
),
true
);
return
::
; }
while
(
0
); }
case
::
:
{
if
(
.
->
() !=
::
)
{
INTERNAL_ERROR(L"Type \"" + ins.typeDescriptorParameter->GetTypeName() + L"\" is not a struct.");
do
{
(
(
L"Internal error: "
L"Type \""
+
.
->
() +
L"\" is not a struct."
),
true
);
return
::
; }
while
(
0
);
}
=
.
->
()->
();
CONTEXT_ACTION(PushValue(result), L"failed to push a value to the stack.");
do
{
if
((
(
result
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to push a value to the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
return
::
;
}
case
::
:
{
;
CONTEXT_ACTION(PopValue(operand), L"failed to pop a value from the stack.");
do
{
if
((
(
operand
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
operand
.
();
return
::
;
}
case
::
:
{
,
;
CONTEXT_ACTION(PopValue(result), L"failed to pop a value from the stack.");
do
{
if
((
(
result
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
if
(
(
result
,
converted
,
))
{
CONTEXT_ACTION(PushValue(converted), L"failed to push a value to the stack.");
do
{
if
((
(
converted
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to push a value to the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
}
else
{
;
if
(
result
.
())
{
from
=
L"<null>"
;
}
else
{
if
(
auto
=
result
.
()->
())
{
;
st
->
(
result
,
text
);
from
=
L"<"
+
text
+
L"> of "
+
result
.
()->
();
}
else
{
from
result
.
()->
();
}
}
=
.
->
();
(
L"Failed to convert from \""
+
from
+
L"\" to \""
+
to
+
L"\"."
,
false
);
}
return
::
;
}
case
::
:
{
,
;
CONTEXT_ACTION(PopValue(result), L"failed to pop a value from the stack.");
do
{
if
((
(
result
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
if
(
(
result
,
converted
,
))
{
CONTEXT_ACTION(PushValue(converted), L"failed to push a value to the stack.");
do
{
if
((
(
converted
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to push a value to the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
}
else
{
CONTEXT_ACTION(PushValue(Value()), L"failed to push a value to the stack.");
do
{
if
((
(
())) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to push a value to the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
}
return
::
;
}
case
::
:
{
;
CONTEXT_ACTION(PopValue(operand), L"failed to pop a value from the stack.");
do
{
if
((
(
operand
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
if
(
operand
.
() &&
operand
.
() ==
.
&&
operand
.
()->
(
.
))
{
CONTEXT_ACTION(PushValue(BoxValue(true)), L"failed to push a value to the stack.");
do
{
if
((
(
(
true
))) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to push a value to the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
}
else
{
CONTEXT_ACTION(PushValue(BoxValue(false)), L"failed to push a value to the stack.");
do
{
if
((
(
(
false
))) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to push a value to the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
}
return
::
;
}
case
::
:
{
;
CONTEXT_ACTION(PopValue(operand), L"failed to pop a value from the stack.");
do
{
if
((
(
operand
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
CONTEXT_ACTION(PushValue(Value::From(operand.GetTypeDescriptor())), L"failed to push a value to the stack.");
do
{
if
((
(
::
(
operand
.
()))) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to push a value to the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
return
::
;
}
case
::
:
{
.
=
.
;
return
::
;
}
case
::
:
{
;
CONTEXT_ACTION(PopValue(operand), L"failed to pop a value from the stack.");
do
{
if
((
(
operand
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
if
(
<
bool
>(
operand
))
{
.
=
.
;
}
return
::
;
}
case
::
:
{
CONTEXT_ACTION(PushStackFrame(ins.indexParameter, ins.countParameter), L"failed to invoke a function.");
do
{
if
((
(
.
,
.
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to invoke a function."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
return
::
;
}
case
::
:
{
CONTEXT_ACTION(PushStackFrame(ins.indexParameter, ins.countParameter, GetCurrentStackFrame().capturedVariables), L"failed to invoke a function.");
do
{
if
((
(
.
,
.
,
().
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to invoke a function."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
return
::
;
}
case
::
:
{
;
CONTEXT_ACTION(PopValue(operand), L"failed to pop a value from the stack.");
do
{
if
((
(
operand
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
CALL_DEBUGGER(callback->BreakGet(operand.GetRawPtr(), ins.propertyParameter));
do
{
if
(
) {
if
(
->
(
operand
.
(),
.
)) {
if
(!
->
()) {
do
{
(
(
L"Internal error: "
L"Debugger stopped the program."
),
true
);
return
::
; }
while
(
0
); } } } }
while
(
0
);
=
.
->
(
operand
);
CONTEXT_ACTION(PushValue(result), L"failed to push a value to the stack.");
do
{
if
((
(
result
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to push a value to the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
return
::
;
}
case
::
:
{
,
;
CONTEXT_ACTION(PopValue(operand), L"failed to pop a value from the stack.");
do
{
if
((
(
operand
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
CONTEXT_ACTION(PopValue(value), L"failed to pop a value from the stack.");
do
{
if
((
(
value
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
CALL_DEBUGGER(callback->BreakSet(operand.GetRawPtr(), ins.propertyParameter));
do
{
if
(
) {
if
(
->
(
operand
.
(),
.
)) {
if
(!
->
()) {
do
{
(
(
L"Internal error: "
L"Debugger stopped the program."
),
true
);
return
::
; }
while
(
0
); } } } }
while
(
0
);
.
->
(
operand
,
value
);
return
::
;
}
case
::
:
{
,
;
CONTEXT_ACTION(PopValue(value), L"failed to pop a value from the stack.");
do
{
if
((
(
value
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
CONTEXT_ACTION(PopValue(operand), L"failed to pop a value from the stack.");
do
{
if
((
(
operand
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
CALL_DEBUGGER(callback->BreakSet(operand.GetRawPtr(), ins.propertyParameter));
do
{
if
(
) {
if
(
->
(
operand
.
(),
.
)) {
if
(!
->
()) {
do
{
(
(
L"Internal error: "
L"Debugger stopped the program."
),
true
);
return
::
; }
while
(
0
); } } } }
while
(
0
);
.
->
(
operand
,
value
);
CONTEXT_ACTION(PushValue(operand), L"failed to push a value to the stack.");
do
{
if
((
(
operand
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to push a value to the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
return
::
;
}
case
::
:
{
;
CONTEXT_ACTION(PopValue(thisValue), L"failed to pop a value from the stack.");
do
{
if
((
(
thisValue
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
auto
=
<
<
>>(
thisValue
);
if
(!
proxy
)
{
INTERNAL_ERROR(L"failed to invoke a null function proxy.");
do
{
(
(
L"Internal error: "
L"failed to invoke a null function proxy."
),
true
);
return
::
; }
while
(
0
);
return
::
;
}
if
(
auto
=
proxy
.
<
>())
{
if
(
lambda
)
{
CONTEXT_ACTION(PushStackFrame(lambda->functionIndex, ins.countParameter, lambda->capturedVariables), L"failed to invoke a function.");
do
{
if
((
(
lambda
,
.
,
lambda
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to invoke a function."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
return
::
;
}
}
<
>
;
for
(
=
0
;
i
<
.
;
i
++)
{
;
CONTEXT_ACTION(PopValue(argument), L"failed to pop a value from the stack.");
do
{
if
((
(
argument
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
arguments
.
(
0
,
argument
);
}
<
>
=
new
<
<
>*>(&
arguments
);
=
proxy
(
list
);
CONTEXT_ACTION(PushValue(result), L"failed to push a value to the stack.");
do
{
if
((
(
result
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to push a value to the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
return
::
;
}
case
::
:
{
;
CONTEXT_ACTION(PopValue(thisValue), L"failed to pop a value from the stack.");
do
{
if
((
(
thisValue
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
CALL_DEBUGGER(callback->BreakInvoke(thisValue.GetRawPtr(), ins.methodParameter));
do
{
if
(
) {
if
(
->
(
thisValue
.
(),
.
)) {
if
(!
->
()) {
do
{
(
(
L"Internal error: "
L"Debugger stopped the program."
),
true
);
return
::
; }
while
(
0
); } } } }
while
(
0
);
if
(
auto
=
dynamic_cast
<
*>(
.
))
{
if
(
staticMethod
->
() ==
.
())
{
CONTEXT_ACTION(PushStackFrame(staticMethod->functionIndex, ins.countParameter, nullptr), L"failed to invoke a function.");
do
{
if
((
(
staticMethod
->
,
.
,
nullptr
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to invoke a function."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
return
::
;
}
}
if
(
auto
=
dynamic_cast
<
*>(
.
))
{
if
(
classMethod
->
() ==
.
())
{
auto
=
<
>();
capturedVariable
.
(
1
);
capturedVariable
0
]
::
(
thisValue
.
());
CONTEXT_ACTION(PushStackFrame(classMethod->functionIndex, ins.countParameter, capturedVariable), L"failed to invoke a function.");
do
{
if
((
(
classMethod
->
,
.
,
capturedVariable
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to invoke a function."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
return
::
;
}
}
<
>
(
.
);
for
(
=
0
;
i
<
.
;
i
++)
{
;
CONTEXT_ACTION(PopValue(argument), L"failed to pop a value from the stack.");
do
{
if
((
(
argument
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
arguments
.
-
i
-
1
]
argument
;
}
=
.
->
(
thisValue
,
arguments
);
CONTEXT_ACTION(PushValue(result), L"failed to push a value to the stack.");
do
{
if
((
(
result
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to push a value to the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
return
::
;
}
case
::
:
{
;
CONTEXT_ACTION(PopValue(thisValue), L"failed to pop a value from the stack.");
do
{
if
((
(
thisValue
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
CALL_DEBUGGER(callback->BreakInvoke(thisValue.GetRawPtr(), ins.eventParameter));
do
{
if
(
) {
if
(
->
(
thisValue
.
(),
.
)) {
if
(!
->
()) {
do
{
(
(
L"Internal error: "
L"Debugger stopped the program."
),
true
);
return
::
; }
while
(
0
); } } } }
while
(
0
);
auto
=
::
();
for
(
=
0
;
i
<
.
;
i
++)
{
;
CONTEXT_ACTION(PopValue(argument), L"failed to pop a value from the stack.");
do
{
if
((
(
argument
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
arguments
(
0
,
argument
);
}
.
->
(
thisValue
,
arguments
);
CONTEXT_ACTION(PushValue(Value()), L"failed to push a value to the stack.");
do
{
if
((
(
())) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to push a value to the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
return
::
;
}
case
::
:
{
;
CONTEXT_ACTION(PopValue(thisValue), L"failed to pop a value from the stack.");
do
{
if
((
(
thisValue
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
CALL_DEBUGGER(callback->BreakInvoke(thisValue.GetRawPtr(), ins.eventParameter));
do
{
if
(
) {
if
(
->
(
thisValue
.
(),
.
)) {
if
(!
->
()) {
do
{
(
(
L"Internal error: "
L"Debugger stopped the program."
),
true
);
return
::
; }
while
(
0
); } } } }
while
(
0
);
if
(
auto
=
dynamic_cast
<
*>(
.
))
{
if
(
ctor
->
() ==
.
())
{
auto
=
<
>();
capturedVariable
.
(
1
);
capturedVariable
0
]
::
(
thisValue
.
());
CONTEXT_ACTION(PushStackFrame(ctor->functionIndex, ins.countParameter, capturedVariable), L"failed to invoke a function.");
do
{
if
((
(
ctor
->
,
.
,
capturedVariable
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to invoke a function."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
return
::
;
}
}
<
>
(
.
);
for
(
=
0
;
i
<
.
;
i
++)
{
;
CONTEXT_ACTION(PopValue(argument), L"failed to pop a value from the stack.");
do
{
if
((
(
argument
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
arguments
.
-
i
-
1
]
argument
;
}
if
(
auto
=
dynamic_cast
<
*>(
.
))
{
ctor
->
(
thisValue
,
arguments
);
}
else
{
auto
=
dynamic_cast
<
*>(
thisValue
.
());
if
(!
instance
)
{
INTERNAL_ERROR(L"Wrong class instance for invoking base constructor.");
do
{
(
(
L"Internal error: "
L"Wrong class instance for invoking base constructor."
),
true
);
return
::
; }
while
(
0
);
}
=
.
->
(
(),
arguments
);
instance
->
(
.
->
(),
baseValue
);
}
CONTEXT_ACTION(PushValue(Value()), L"failed to push a value to the stack.");
do
{
if
((
(
())) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to push a value to the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
return
::
;
}
case
::
:
{
,
;
CONTEXT_ACTION(PopValue(function), L"failed to pop a value from the stack.");
do
{
if
((
(
function
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
CONTEXT_ACTION(PopValue(thisValue), L"failed to pop a value from the stack.");
do
{
if
((
(
thisValue
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
CALL_DEBUGGER(callback->BreakAttach(thisValue.GetRawPtr(), ins.eventParameter));
do
{
if
(
) {
if
(
->
(
thisValue
.
(),
.
)) {
if
(!
->
()) {
do
{
(
(
L"Internal error: "
L"Debugger stopped the program."
),
true
);
return
::
; }
while
(
0
); } } } }
while
(
0
);
auto
=
<
<
>>(
function
);
auto
=
.
->
(
thisValue
,
proxy
);
CONTEXT_ACTION(PushValue(Value::From(handler)), L"failed to push a value to the stack.");
do
{
if
((
(
::
(
handler
))) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to push a value to the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
return
::
;
}
case
::
:
{
,
;
CONTEXT_ACTION(PopValue(operand), L"failed to pop a value from the stack.");
do
{
if
((
(
operand
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
CONTEXT_ACTION(PopValue(thisValue), L"failed to pop a value from the stack.");
do
{
if
((
(
thisValue
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
CALL_DEBUGGER(callback->BreakDetach(thisValue.GetRawPtr(), ins.eventParameter));
do
{
if
(
) {
if
(
->
(
thisValue
.
(),
.
)) {
if
(!
->
()) {
do
{
(
(
L"Internal error: "
L"Debugger stopped the program."
),
true
);
return
::
; }
while
(
0
); } } } }
while
(
0
);
auto
=
<
<
>>(
operand
);
auto
=
.
->
(
thisValue
,
handler
);
CONTEXT_ACTION(PushValue(BoxValue(result)), L"failed to push a value to the stack.");
do
{
if
((
(
(
result
))) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to push a value to the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
return
::
;
}
case
::
:
CONTEXT_ACTION(PushTrapFrame(ins.indexParameter), L"failed to push a trap frame");
do
{
if
((
(
.
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to push a trap frame"
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
return
::
;
case
::
:
{
if
(
.
() ==
0
)
{
INTERNAL_ERROR(L"failed to pop the trap frame.");
do
{
(
(
L"Internal error: "
L"failed to pop the trap frame."
),
true
);
return
::
; }
while
(
0
);
}
auto
=
();
CONTEXT_ACTION(PopTrapFrame(ins.countParameter), L"failed to pop the trap frame.");
do
{
if
((
(
.
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to pop the trap frame."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
return
::
;
}
case
::
:
{
;
CONTEXT_ACTION(PopValue(operand), L"failed to pop a value from the stack.");
do
{
if
((
(
operand
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
if
(
operand
.
() ==
::
)
{
;
operand
.
()->
()->
(
operand
,
text
);
(
text
,
false
);
}
else
if
(
auto
=
operand
.
().
<
>())
{
(
info
);
}
else
if
(
auto
=
operand
.
().
<
>())
{
RaiseException(ex->GetMessage(), false);
(
ex
GetMessageW(),
false
);
}
else
{
INTERNAL_ERROR(L"failed to raise an exception which is neither a string nor a WfRuntimeExceptionInfo.");
do
{
(
(
L"Internal error: "
L"failed to raise an exception which is neither a string nor a WfRuntimeExceptionInfo."
),
true
);
return
::
; }
while
(
0
);
}
return
::
;
}
case
::
:
{
,
;
CONTEXT_ACTION(PopValue(set), L"failed to pop a value from the stack.");
do
{
if
((
(
set
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
CONTEXT_ACTION(PopValue(element), L"failed to pop a value from the stack.");
do
{
if
((
(
element
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
auto
=
<
<
>>(
set
);
auto
=
enumerable
();
while
(
enumerator
())
{
if
(
enumerator
()
element
)
{
CONTEXT_ACTION(PushValue(BoxValue(true)), L"failed to push a value to the stack.");
do
{
if
((
(
(
true
))) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to push a value to the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
return
::
;
}
}
CONTEXT_ACTION(PushValue(BoxValue(false)), L"failed to push a value to the stack.");
do
{
if
((
(
(
false
))) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to push a value to the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
return
::
;
}
case
::
:
EXECUTE(OpCompare, Bool)
case
::
:
return
<
bool
>(*
this
);
EXECUTE(OpCompare, I1)
case
::
:
return
<
>(*
this
);
EXECUTE(OpCompare, I2)
case
::
:
return
<
>(*
this
);
EXECUTE(OpCompare, I4)
case
::
:
return
<
>(*
this
);
EXECUTE(OpCompare, I8)
case
::
:
return
<
>(*
this
);
EXECUTE(OpCompare, U1)
case
::
:
return
<
>(*
this
);
EXECUTE(OpCompare, U2)
case
::
:
return
<
>(*
this
);
EXECUTE(OpCompare, U4)
case
::
:
return
<
>(*
this
);
EXECUTE(OpCompare, U8)
case
::
:
return
<
>(*
this
);
EXECUTE(OpCompare, F4)
case
::
:
return
<
float
>(*
this
);
EXECUTE(OpCompare, F8)
case
::
:
return
<
double
>(*
this
);
EXECUTE(OpCompare, String)
case
::
:
return
<
>(*
this
);
END_TYPE
default
:
do
{
(
(
L"Internal error: "
L"unexpected type argument."
),
true
);
return
::
; }
while
(
0
); }
case
::
:
{
,
;
CONTEXT_ACTION(PopValue(second), L"failed to pop a value from the stack.");
do
{
if
((
(
second
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
CONTEXT_ACTION(PopValue(first), L"failed to pop a value from the stack.");
do
{
if
((
(
first
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
bool
=
first
.
() !=
::
&&
second
.
() !=
::
&&
first
.
() ==
second
.
();
CONTEXT_ACTION(PushValue(BoxValue(result)), L"failed to push a value to the stack.");
do
{
if
((
(
(
result
))) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to push a value to the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
return
::
;
}
case
::
:
{
,
;
CONTEXT_ACTION(PopValue(second), L"failed to pop a value from the stack.");
do
{
if
((
(
second
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
CONTEXT_ACTION(PopValue(first), L"failed to pop a value from the stack.");
do
{
if
((
(
first
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
bool
=
first
second
;
CONTEXT_ACTION(PushValue(BoxValue(result)), L"failed to push a value to the stack.");
do
{
if
((
(
(
result
))) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to push a value to the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
return
::
;
}
case
::
:
EXECUTE(OpNot_Bool, Bool)
case
::
:
return
<
bool
>(*
this
);
EXECUTE(OpNot, I1)
case
::
:
return
<
>(*
this
);
EXECUTE(OpNot, I2)
case
::
:
return
<
>(*
this
);
EXECUTE(OpNot, I4)
case
::
:
return
<
>(*
this
);
EXECUTE(OpNot, I8)
case
::
:
return
<
>(*
this
);
EXECUTE(OpNot, U1)
case
::
:
return
<
>(*
this
);
EXECUTE(OpNot, U2)
case
::
:
return
<
>(*
this
);
EXECUTE(OpNot, U4)
case
::
:
return
<
>(*
this
);
EXECUTE(OpNot, U8)
case
::
:
return
<
>(*
this
);
END_TYPE
default
:
do
{
(
(
L"Internal error: "
L"unexpected type argument."
),
true
);
return
::
; }
while
(
0
); }
case
::
:
EXECUTE(OpPositive, I1)
case
::
:
return
<
>(*
this
);
EXECUTE(OpPositive, I2)
case
::
:
return
<
>(*
this
);
EXECUTE(OpPositive, I4)
case
::
:
return
<
>(*
this
);
EXECUTE(OpPositive, I8)
case
::
:
return
<
>(*
this
);
EXECUTE(OpPositive, U1)
case
::
:
return
<
>(*
this
);
EXECUTE(OpPositive, U2)
case
::
:
return
<
>(*
this
);
EXECUTE(OpPositive, U4)
case
::
:
return
<
>(*
this
);
EXECUTE(OpPositive, U8)
case
::
:
return
<
>(*
this
);
EXECUTE(OpPositive, F4)
case
::
:
return
<
float
>(*
this
);
EXECUTE(OpPositive, F8)
case
::
:
return
<
double
>(*
this
);
END_TYPE
default
:
do
{
(
(
L"Internal error: "
L"unexpected type argument."
),
true
);
return
::
; }
while
(
0
); }
case
::
:
EXECUTE(OpNegative, I1)
case
::
:
return
<
>(*
this
);
EXECUTE(OpNegative, I2)
case
::
:
return
<
>(*
this
);
EXECUTE(OpNegative, I4)
case
::
:
return
<
>(*
this
);
EXECUTE(OpNegative, I8)
case
::
:
return
<
>(*
this
);
EXECUTE(OpNegative, F4)
case
::
:
return
<
float
>(*
this
);
EXECUTE(OpNegative, F8)
case
::
:
return
<
double
>(*
this
);
END_TYPE
default
:
do
{
(
(
L"Internal error: "
L"unexpected type argument."
),
true
);
return
::
; }
while
(
0
); }
case
::
:
{
,
;
CONTEXT_ACTION(PopValue(second), L"failed to pop a value from the stack.");
do
{
if
((
(
second
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
CONTEXT_ACTION(PopValue(first), L"failed to pop a value from the stack.");
do
{
if
((
(
first
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
,
;
first
.
()->
()->
(
first
,
firstText
);
first
.
()->
()->
(
second
,
secondText
);
CONTEXT_ACTION(PushValue(BoxValue(firstText + secondText)), L"failed to push a value to the stack.");
do
{
if
((
(
(
firstText
+
secondText
))) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to push a value to the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
return
::
;
}
case
::
:
EXECUTE(OpExp, F4)
case
::
:
return
<
float
>(*
this
);
EXECUTE(OpExp, F8)
case
::
:
return
<
double
>(*
this
);
END_TYPE
default
:
do
{
(
(
L"Internal error: "
L"unexpected type argument."
),
true
);
return
::
; }
while
(
0
); }
case
::
:
EXECUTE(OpAdd, I1)
case
::
:
return
<
>(*
this
);
EXECUTE(OpAdd, I2)
case
::
:
return
<
>(*
this
);
EXECUTE(OpAdd, I4)
case
::
:
return
<
>(*
this
);
EXECUTE(OpAdd, I8)
case
::
:
return
<
>(*
this
);
EXECUTE(OpAdd, U1)
case
::
:
return
<
>(*
this
);
EXECUTE(OpAdd, U2)
case
::
:
return
<
>(*
this
);
EXECUTE(OpAdd, U4)
case
::
:
return
<
>(*
this
);
EXECUTE(OpAdd, U8)
case
::
:
return
<
>(*
this
);
EXECUTE(OpAdd, F4)
case
::
:
return
<
float
>(*
this
);
EXECUTE(OpAdd, F8)
case
::
:
return
<
double
>(*
this
);
END_TYPE
default
:
do
{
(
(
L"Internal error: "
L"unexpected type argument."
),
true
);
return
::
; }
while
(
0
); }
case
::
:
EXECUTE(OpSub, I1)
case
::
:
return
<
>(*
this
);
EXECUTE(OpSub, I2)
case
::
:
return
<
>(*
this
);
EXECUTE(OpSub, I4)
case
::
:
return
<
>(*
this
);
EXECUTE(OpSub, I8)
case
::
:
return
<
>(*
this
);
EXECUTE(OpSub, U1)
case
::
:
return
<
>(*
this
);
EXECUTE(OpSub, U2)
case
::
:
return
<
>(*
this
);
EXECUTE(OpSub, U4)
case
::
:
return
<
>(*
this
);
EXECUTE(OpSub, U8)
case
::
:
return
<
>(*
this
);
EXECUTE(OpSub, F4)
case
::
:
return
<
float
>(*
this
);
EXECUTE(OpSub, F8)
case
::
:
return
<
double
>(*
this
);
END_TYPE
default
:
do
{
(
(
L"Internal error: "
L"unexpected type argument."
),
true
);
return
::
; }
while
(
0
); }
case
::
:
EXECUTE(OpMul, I1)
case
::
:
return
<
>(*
this
);
EXECUTE(OpMul, I2)
case
::
:
return
<
>(*
this
);
EXECUTE(OpMul, I4)
case
::
:
return
<
>(*
this
);
EXECUTE(OpMul, I8)
case
::
:
return
<
>(*
this
);
EXECUTE(OpMul, U1)
case
::
:
return
<
>(*
this
);
EXECUTE(OpMul, U2)
case
::
:
return
<
>(*
this
);
EXECUTE(OpMul, U4)
case
::
:
return
<
>(*
this
);
EXECUTE(OpMul, U8)
case
::
:
return
<
>(*
this
);
EXECUTE(OpMul, F4)
case
::
:
return
<
float
>(*
this
);
EXECUTE(OpMul, F8)
case
::
:
return
<
double
>(*
this
);
END_TYPE
default
:
do
{
(
(
L"Internal error: "
L"unexpected type argument."
),
true
);
return
::
; }
while
(
0
); }
case
::
:
EXECUTE(OpDiv, I1)
case
::
:
return
<
>(*
this
);
EXECUTE(OpDiv, I2)
case
::
:
return
<
>(*
this
);
EXECUTE(OpDiv, I4)
case
::
:
return
<
>(*
this
);
EXECUTE(OpDiv, I8)
case
::
:
return
<
>(*
this
);
EXECUTE(OpDiv, U1)
case
::
:
return
<
>(*
this
);
EXECUTE(OpDiv, U2)
case
::
:
return
<
>(*
this
);
EXECUTE(OpDiv, U4)
case
::
:
return
<
>(*
this
);
EXECUTE(OpDiv, U8)
case
::
:
return
<
>(*
this
);
EXECUTE(OpDiv, F4)
case
::
:
return
<
float
>(*
this
);
EXECUTE(OpDiv, F8)
case
::
:
return
<
double
>(*
this
);
END_TYPE
default
:
do
{
(
(
L"Internal error: "
L"unexpected type argument."
),
true
);
return
::
; }
while
(
0
); }
case
::
:
EXECUTE(OpMod, I1)
case
::
:
return
<
>(*
this
);
EXECUTE(OpMod, I2)
case
::
:
return
<
>(*
this
);
EXECUTE(OpMod, I4)
case
::
:
return
<
>(*
this
);
EXECUTE(OpMod, I8)
case
::
:
return
<
>(*
this
);
EXECUTE(OpMod, U1)
case
::
:
return
<
>(*
this
);
EXECUTE(OpMod, U2)
case
::
:
return
<
>(*
this
);
EXECUTE(OpMod, U4)
case
::
:
return
<
>(*
this
);
EXECUTE(OpMod, U8)
case
::
:
return
<
>(*
this
);
END_TYPE
default
:
do
{
(
(
L"Internal error: "
L"unexpected type argument."
),
true
);
return
::
; }
while
(
0
); }
case
::
:
EXECUTE(OpShl, I1)
case
::
:
return
<
>(*
this
);
EXECUTE(OpShl, I2)
case
::
:
return
<
>(*
this
);
EXECUTE(OpShl, I4)
case
::
:
return
<
>(*
this
);
EXECUTE(OpShl, I8)
case
::
:
return
<
>(*
this
);
EXECUTE(OpShl, U1)
case
::
:
return
<
>(*
this
);
EXECUTE(OpShl, U2)
case
::
:
return
<
>(*
this
);
EXECUTE(OpShl, U4)
case
::
:
return
<
>(*
this
);
EXECUTE(OpShl, U8)
case
::
:
return
<
>(*
this
);
END_TYPE
default
:
do
{
(
(
L"Internal error: "
L"unexpected type argument."
),
true
);
return
::
; }
while
(
0
); }
case
::
:
EXECUTE(OpShr, I1)
case
::
:
return
<
>(*
this
);
EXECUTE(OpShr, I2)
case
::
:
return
<
>(*
this
);
EXECUTE(OpShr, I4)
case
::
:
return
<
>(*
this
);
EXECUTE(OpShr, I8)
case
::
:
return
<
>(*
this
);
EXECUTE(OpShr, U1)
case
::
:
return
<
>(*
this
);
EXECUTE(OpShr, U2)
case
::
:
return
<
>(*
this
);
EXECUTE(OpShr, U4)
case
::
:
return
<
>(*
this
);
EXECUTE(OpShr, U8)
case
::
:
return
<
>(*
this
);
END_TYPE
default
:
do
{
(
(
L"Internal error: "
L"unexpected type argument."
),
true
);
return
::
; }
while
(
0
); }
case
::
:
EXECUTE(OpXor, Bool)
case
::
:
return
<
bool
>(*
this
);
EXECUTE(OpXor, I1)
case
::
:
return
<
>(*
this
);
EXECUTE(OpXor, I2)
case
::
:
return
<
>(*
this
);
EXECUTE(OpXor, I4)
case
::
:
return
<
>(*
this
);
EXECUTE(OpXor, I8)
case
::
:
return
<
>(*
this
);
EXECUTE(OpXor, U1)
case
::
:
return
<
>(*
this
);
EXECUTE(OpXor, U2)
case
::
:
return
<
>(*
this
);
EXECUTE(OpXor, U4)
case
::
:
return
<
>(*
this
);
EXECUTE(OpXor, U8)
case
::
:
return
<
>(*
this
);
END_TYPE
default
:
do
{
(
(
L"Internal error: "
L"unexpected type argument."
),
true
);
return
::
; }
while
(
0
); }
case
::
:
EXECUTE(OpAnd_Bool, Bool)
case
::
:
return
<
bool
>(*
this
);
EXECUTE(OpAnd, I1)
case
::
:
return
<
>(*
this
);
EXECUTE(OpAnd, I2)
case
::
:
return
<
>(*
this
);
EXECUTE(OpAnd, I4)
case
::
:
return
<
>(*
this
);
EXECUTE(OpAnd, I8)
case
::
:
return
<
>(*
this
);
EXECUTE(OpAnd, U1)
case
::
:
return
<
>(*
this
);
EXECUTE(OpAnd, U2)
case
::
:
return
<
>(*
this
);
EXECUTE(OpAnd, U4)
case
::
:
return
<
>(*
this
);
EXECUTE(OpAnd, U8)
case
::
:
return
<
>(*
this
);
END_TYPE
default
:
do
{
(
(
L"Internal error: "
L"unexpected type argument."
),
true
);
return
::
; }
while
(
0
); }
case
::
:
EXECUTE(OpOr_Bool, Bool)
case
::
:
return
<
bool
>(*
this
);
EXECUTE(OpOr, I1)
case
::
:
return
<
>(*
this
);
EXECUTE(OpOr, I2)
case
::
:
return
<
>(*
this
);
EXECUTE(OpOr, I4)
case
::
:
return
<
>(*
this
);
EXECUTE(OpOr, I8)
case
::
:
return
<
>(*
this
);
EXECUTE(OpOr, U1)
case
::
:
return
<
>(*
this
);
EXECUTE(OpOr, U2)
case
::
:
return
<
>(*
this
);
EXECUTE(OpOr, U4)
case
::
:
return
<
>(*
this
);
EXECUTE(OpOr, U8)
case
::
:
return
<
>(*
this
);
END_TYPE
default
:
do
{
(
(
L"Internal error: "
L"unexpected type argument."
),
true
);
return
::
; }
while
(
0
); }
case
::
:
{
;
CONTEXT_ACTION(PopValue(operand), L"failed to pop a value from the stack.");
do
{
if
((
(
operand
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
=
<
>(
operand
);
CONTEXT_ACTION(PushValue(BoxValue(value < 0)), L"failed to push a value to the stack.");
do
{
if
((
(
(
value
<
0
))) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to push a value to the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
return
::
;
}
break
;
case
::
:
{
;
CONTEXT_ACTION(PopValue(operand), L"failed to pop a value from the stack.");
do
{
if
((
(
operand
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
=
<
>(
operand
);
CONTEXT_ACTION(PushValue(BoxValue(value > 0)), L"failed to push a value to the stack.");
do
{
if
((
(
(
value
>
0
))) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to push a value to the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
return
::
;
}
break
;
case
::
:
{
;
CONTEXT_ACTION(PopValue(operand), L"failed to pop a value from the stack.");
do
{
if
((
(
operand
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
=
<
>(
operand
);
CONTEXT_ACTION(PushValue(BoxValue(value <= 0)), L"failed to push a value to the stack.");
do
{
if
((
(
(
value
<=
0
))) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to push a value to the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
return
::
;
}
break
;
case
::
:
{
;
CONTEXT_ACTION(PopValue(operand), L"failed to pop a value from the stack.");
do
{
if
((
(
operand
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
=
<
>(
operand
);
CONTEXT_ACTION(PushValue(BoxValue(value >= 0)), L"failed to push a value to the stack.");
do
{
if
((
(
(
value
>=
0
))) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to push a value to the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
return
::
;
}
break
;
case
::
:
{
;
CONTEXT_ACTION(PopValue(operand), L"failed to pop a value from the stack.");
do
{
if
((
(
operand
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
=
<
>(
operand
);
CONTEXT_ACTION(PushValue(BoxValue(value == 0)), L"failed to push a value to the stack.");
do
{
if
((
(
(
value
==
0
))) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to push a value to the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
return
::
;
}
break
;
case
::
:
{
;
CONTEXT_ACTION(PopValue(operand), L"failed to pop a value from the stack.");
do
{
if
((
(
operand
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to pop a value from the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
=
<
>(
operand
);
CONTEXT_ACTION(PushValue(BoxValue(value != 0)), L"failed to push a value to the stack.");
do
{
if
((
(
(
value
!=
0
))) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to push a value to the stack."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
return
::
;
}
break
;
default
:
return
::
;
}
}
::
(
*
)
{
try
{
switch
(
)
{
case
::
:
case
::
:
{
if
(
.
() ==
0
)
{
INTERNAL_ERROR(L"empty stack frame.");
do
{
(
(
L"Internal error: "
L"empty stack frame."
),
true
);
return
::
; }
while
(
0
);
}
auto
&
=
();
if
(
stackFrame
.
<
0
||
stackFrame
.
>=
.
())
{
INTERNAL_ERROR(L"illegal instruction index.");
do
{
(
(
L"Internal error: "
L"illegal instruction index."
),
true
);
return
::
; }
while
(
0
);
}
auto
=
stackFrame
.
;
CALL_DEBUGGER(callback->BreakIns(globalContext->assembly.Obj(), insIndex));
do
{
if
(
) {
if
(
->
(
.
(),
insIndex
)) {
if
(!
->
()) {
do
{
(
(
L"Internal error: "
L"Debugger stopped the program."
),
true
);
return
::
; }
while
(
0
); } } } }
while
(
0
);
stackFrame
.
++;
auto
&
=
insIndex
];
return
(
ins
,
stackFrame
,
);
}
break
;
case
::
:
if
(
.
() >
0
)
{
auto
=
();
if
(
trapFrame
.
==
.
() -
1
)
{
CONTEXT_ACTION(PopTrapFrame(0), L"failed to pop the trap frame");
do
{
if
((
(
0
)) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to pop the trap frame"
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
().
=
trapFrame
.
;
=
::
;
return
::
;
}
else
if
(
.
() >
0
)
{
CONTEXT_ACTION(PopStackFrame(), L"failed to pop the stack frame.");
do
{
if
((
()) !=
WfRuntimeThreadContextError
::
) {
do
{
(
(
L"Internal error: "
L"failed to pop the stack frame."
),
true
);
return
::
; }
while
(
0
); } }
while
(
0
);
return
::
;
}
}
break
;
default
:;
}
return
::
;
}
catch
(
const
&
)
{
if
(
ex
.
())
{
(
ex
.
());
}
else
{
(
ex
.
(),
ex
.
());
}
return
::
;
}
catch
(
const
&
)
{
(
ex
.
(),
false
);
return
::
;
}
}
#undef INTERNAL_ERROR
#undef CONTEXT_ACTION
#undef CALL_DEBUGGER
#undef TYPE_OF_Bool
#undef TYPE_OF_I1
#undef TYPE_OF_I2
#undef TYPE_OF_I4
#undef TYPE_OF_I8
#undef TYPE_OF_U1
#undef TYPE_OF_U2
#undef TYPE_OF_U4
#undef TYPE_OF_U8
#undef TYPE_OF_F4
#undef TYPE_OF_F8
#undef TYPE_OF_String
#undef EXECUTE
#undef BEGIN_TYPE
#undef END_TYPE
}
}
}
#endif