pair up stack for NativeCallingConvention

This commit is contained in:
Joshua Warner
2014-05-01 17:26:42 -06:00
parent 69edeaadee
commit f9cbca8f7d
4 changed files with 144 additions and 15 deletions

View File

@ -2460,7 +2460,7 @@ class MyCompiler: public Compiler {
unsigned footprint = 0;
unsigned size = TargetBytesPerWord;
RUNTIME_ARRAY(Value*, arguments, argumentCount);
RUNTIME_ARRAY(ir::Value*, arguments, argumentCount);
int index = 0;
for (unsigned i = 0; i < argumentCount; ++i) {
Value* o = va_arg(a, Value*);
@ -2484,20 +2484,23 @@ class MyCompiler: public Compiler {
Stack* argumentStack = c.stack;
for (int i = index - 1; i >= 0; --i) {
argumentStack = compiler::stack
(&c, RUNTIME_ARRAY_BODY(arguments)[i], argumentStack);
argumentStack = compiler::stack(
&c,
static_cast<Value*>(RUNTIME_ARRAY_BODY(arguments)[i]),
argumentStack);
}
Value* result = value(&c, resultType);
appendCall(&c,
static_cast<Value*>(address),
ir::NativeCallingConvention,
flags,
traceHandler,
result,
resultType.size(),
argumentStack,
index,
util::Slice<ir::Value*>(0, 0));
util::Slice<ir::Value*>(RUNTIME_ARRAY_BODY(arguments), index));
return result;
}
@ -2511,6 +2514,7 @@ class MyCompiler: public Compiler {
Value* result = value(&c, resultType);
appendCall(&c,
static_cast<Value*>(address),
ir::AvianCallingConvention,
flags,
traceHandler,
result,