Get rid of qmljs_get_this_object
authorLars Knoll <lars.knoll@digia.com>
Sun, 14 Apr 2013 20:37:54 +0000 (22:37 +0200)
committerSimon Hausmann <simon.hausmann@digia.com>
Mon, 15 Apr 2013 08:47:40 +0000 (10:47 +0200)
This is trivial to inline.

Change-Id: Idccfc3c39d19e85768ec1be4b3b62b67abf00325
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
src/v4/llvm_runtime.cpp
src/v4/moth/qv4vme_moth.cpp
src/v4/qv4isel_masm.cpp
src/v4/qv4runtime.h

index cd0789c..d7d4edc 100644 (file)
@@ -492,7 +492,7 @@ void __qmljs_llvm_foreach_next_property_name(Value *result, Value *it)
 
 void __qmljs_llvm_get_this_object(ExecutionContext *ctx, Value *result)
 {
-    __qmljs_get_thisObject(ctx, result);
+    *result = ctx->thisObject;
 }
 
 void __qmljs_llvm_delete_subscript(ExecutionContext *ctx, Value *result, Value *base, Value *index)
index 26bd76a..7dcf1aa 100644 (file)
@@ -479,7 +479,7 @@ VM::Value VME::run(QQmlJS::VM::ExecutionContext *context, const uchar *&code,
     MOTH_END_INSTR(Ret)
 
     MOTH_BEGIN_INSTR(LoadThis)
-        __qmljs_get_thisObject(context, VALUEPTR(instr.result));
+        VALUE(instr.result) = context->thisObject;
     MOTH_END_INSTR(LoadThis)
 
     MOTH_BEGIN_INSTR(InplaceElementOp)
index 80803e8..9a05ccb 100644 (file)
@@ -824,7 +824,8 @@ void InstructionSelection::callValue(V4IR::Temp *value, V4IR::ExprList *args, V4
 
 void InstructionSelection::loadThisObject(V4IR::Temp *temp)
 {
-    generateFunctionCall(Assembler::Void, __qmljs_get_thisObject, Assembler::ContextRegister, Assembler::PointerToValue(temp));
+    _as->loadPtr(Pointer(Assembler::ContextRegister, offsetof(ExecutionContext, thisObject)), Assembler::ReturnValueRegister);
+    _as->storeArgument(Assembler::ReturnValueRegister, temp);
 }
 
 void InstructionSelection::loadConst(V4IR::Const *sourceConst, V4IR::Temp *targetTemp)
index 3207ab4..d5eebfa 100644 (file)
@@ -179,9 +179,6 @@ void __qmljs_set_element(ExecutionContext *ctx, const Value &object, const Value
 void __qmljs_foreach_iterator_object(ExecutionContext *ctx, Value *result, const Value &in);
 void __qmljs_foreach_next_property_name(Value *result, const Value &foreach_iterator);
 
-// context
-void __qmljs_get_thisObject(ExecutionContext *ctx, Value *result);
-
 // type conversion and testing
 Value __qmljs_to_primitive(const Value &value, int typeHint);
 Bool __qmljs_to_boolean(const Value &value);