Convert builtin typeof to the new calling convention
authorSimon Hausmann <simon.hausmann@digia.com>
Thu, 14 Feb 2013 11:16:30 +0000 (12:16 +0100)
committerLars Knoll <lars.knoll@digia.com>
Thu, 14 Feb 2013 11:33:39 +0000 (12:33 +0100)
Change-Id: I40f268c53dacf2ee188b3d1df9391df3e5e812f8
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
src/v4/moth/qv4vme_moth.cpp
src/v4/qmljs_runtime.cpp
src/v4/qmljs_runtime.h
src/v4/qv4isel_masm.cpp

index cd6264a..e366ec3 100644 (file)
@@ -312,7 +312,7 @@ VM::Value VME::operator()(QQmlJS::VM::ExecutionContext *context, const uchar *co
     MOTH_END_INSTR(CallBuiltinDeleteName)
 
     MOTH_BEGIN_INSTR(CallBuiltinTypeofMember)
-        VALUE(instr.result) = __qmljs_builtin_typeof_member(VALUE(instr.base), instr.member, context);
+        __qmljs_builtin_typeof_member(context, VALUEPTR(instr.result), VALUE(instr.base), instr.member);
     MOTH_END_INSTR(CallBuiltinTypeofMember)
 
     MOTH_BEGIN_INSTR(CallBuiltinTypeofSubscript)
index 520c1e3..58ff36a 100644 (file)
@@ -1028,10 +1028,11 @@ Value __qmljs_builtin_typeof_name(String *name, ExecutionContext *context)
     return __qmljs_builtin_typeof(context->getPropertyNoThrow(name), context);
 }
 
-Value __qmljs_builtin_typeof_member(Value base, String *name, ExecutionContext *context)
+void __qmljs_builtin_typeof_member(ExecutionContext *context, Value *result, const Value &base, String *name)
 {
     Value obj = base.toObject(context);
-    return __qmljs_builtin_typeof(obj.objectValue()->__get__(context, name), context);
+    if (result)
+        *result = __qmljs_builtin_typeof(obj.objectValue()->__get__(context, name), context);
 }
 
 Value __qmljs_builtin_typeof_element(Value base, Value index, ExecutionContext *context)
index 4c50701..0a08b71 100644 (file)
@@ -103,7 +103,7 @@ Value __qmljs_construct_value(ExecutionContext *context, Value func, Value *args
 
 Value __qmljs_builtin_typeof(Value val, ExecutionContext *ctx);
 Value __qmljs_builtin_typeof_name(String *name, ExecutionContext *context);
-Value __qmljs_builtin_typeof_member(Value base, String *name, ExecutionContext *context);
+void __qmljs_builtin_typeof_member(ExecutionContext* context, Value* result, const Value &base, String *name);
 Value __qmljs_builtin_typeof_element(Value base, Value index, ExecutionContext *context);
 
 void __qmljs_builtin_post_increment(ExecutionContext *ctx, Value *result, Value *val);
index 467cc3e..1c14384 100644 (file)
@@ -480,7 +480,7 @@ void InstructionSelection::callBuiltinInvalid(IR::Name *func, IR::ExprList *args
 
 void InstructionSelection::callBuiltinTypeofMember(IR::Temp *base, const QString &name, IR::Temp *result)
 {
-    generateFunctionCall(result, __qmljs_builtin_typeof_member, base, identifier(name), Assembler::ContextRegister);
+    generateFunctionCall(Assembler::Void, __qmljs_builtin_typeof_member, Assembler::ContextRegister, Assembler::PointerToValue(result), Assembler::PointerToValue(base), identifier(name));
 }
 
 void InstructionSelection::callBuiltinTypeofSubscript(IR::Temp *base, IR::Temp *index, IR::Temp *result)