_callStack[callIndex(state->context())].state = 0;
}
-void Debugger::aboutToThrow(VM::Value *value)
+void Debugger::aboutToThrow(const VM::Value &value)
{
- qDebug() << "*** We are about to throw...:" << value->toString(currentState()->context())->toQString();
+ qDebug() << "*** We are about to throw...:" << value.toString(currentState()->context())->toQString();
}
FunctionState *Debugger::currentState() const
void justLeft(VM::ExecutionContext *context);
void enterFunction(FunctionState *state);
void leaveFunction(FunctionState *state);
- void aboutToThrow(VM::Value *value);
+ void aboutToThrow(const VM::Value &value);
public: // debugging hooks
FunctionState *currentState() const;
void __qmljs_llvm_throw(ExecutionContext *context, Value *value)
{
- __qmljs_throw(*value, context);
+ __qmljs_throw(context, *value);
}
void __qmljs_llvm_create_exception_handler(ExecutionContext *context, Value *result)
MOTH_END_INSTR(CallActivationProperty)
MOTH_BEGIN_INSTR(CallBuiltinThrow)
- __qmljs_builtin_throw(VALUE(instr.arg), context);
+ __qmljs_builtin_throw(context, VALUE(instr.arg));
MOTH_END_INSTR(CallBuiltinThrow)
MOTH_BEGIN_INSTR(CallBuiltinCreateExceptionHandler)
setProperty(name, result);
}
-void ExecutionContext::throwError(Value value)
+void ExecutionContext::throwError(const Value &value)
{
- __qmljs_builtin_throw(value, this);
+ __qmljs_builtin_throw(this, value);
}
void ExecutionContext::throwError(const QString &message)
void wireUpPrototype();
- void throwError(Value value);
+ void throwError(const Value &value);
void throwError(const QString &message);
void throwSyntaxError(DiagnosticMessage *message);
void throwTypeError();
context->throwTypeError();
}
-void __qmljs_throw(Value value, ExecutionContext *context)
+void __qmljs_throw(ExecutionContext *context, const Value &value)
{
assert(!context->engine->unwindStack.isEmpty());
if (context->engine->debugger)
- context->engine->debugger->aboutToThrow(&value);
+ context->engine->debugger->aboutToThrow(value);
ExecutionEngine::ExceptionHandler &handler = context->engine->unwindStack.last();
o->__put__(context, idx, v);
}
-void __qmljs_builtin_throw(Value val, ExecutionContext *context)
+void __qmljs_builtin_throw(ExecutionContext *context, const Value &val)
{
- __qmljs_throw(val, context);
+ __qmljs_throw(context, val);
}
ExecutionContext *__qmljs_builtin_push_with_scope(Value o, ExecutionContext *ctx)
void __qmljs_builtin_post_decrement_member(ExecutionContext *context, Value *result, const Value &base, String *name);
void __qmljs_builtin_post_decrement_element(ExecutionContext *context, Value *result, const Value &base, const Value &index);
-void __qmljs_builtin_throw(Value val, ExecutionContext *context);
+void __qmljs_builtin_throw(ExecutionContext *context, const Value &val);
void __qmljs_builtin_rethrow(ExecutionContext *context);
ExecutionContext *__qmljs_builtin_push_with_scope(Value o, ExecutionContext *ctx);
ExecutionContext *__qmljs_builtin_push_catch_scope(String *exceptionVarName, ExecutionContext *ctx);
void __qmljs_delete_member(ExecutionContext *ctx, Value *result, const Value &base, String *name);
void __qmljs_delete_name(ExecutionContext *ctx, Value *result, String *name);
-void __qmljs_throw(Value value, ExecutionContext *context);
+void __qmljs_throw(ExecutionContext*, const Value &value);
// actually returns a jmp_buf *
Q_V4_EXPORT void *__qmljs_create_exception_handler(ExecutionContext *context);
void __qmljs_delete_exception_handler(ExecutionContext *context);
void InstructionSelection::callBuiltinThrow(IR::Temp *arg)
{
- generateFunctionCall(Assembler::Void, __qmljs_builtin_throw, arg, Assembler::ContextRegister);
+ generateFunctionCall(Assembler::Void, __qmljs_builtin_throw, Assembler::ContextRegister, Assembler::PointerToValue(arg));
}
void InstructionSelection::callBuiltinCreateExceptionHandler(IR::Temp *result, IR::Temp *contextTemp)