Assembler::Pointer Assembler::loadStringAddress(RegisterID reg, const QString &string)
{
loadPtr(Address(Assembler::ContextRegister, offsetof(QV4::ExecutionContext, runtimeStrings)), reg);
- const int id = _isel->stringId(string);
+ const int id = _isel->registerString(string);
return Pointer(reg, id * sizeof(QV4::String*));
}
QV4::CompiledData::CompilationUnit *InstructionSelection::backendCompileStep()
{
- compilationUnit->data = jsUnitGenerator.generateUnit();
- compilationUnit->runtimeFunctions.reserve(jsUnitGenerator.irModule->functions.size());
- compilationUnit->codeRefs.resize(jsUnitGenerator.irModule->functions.size());
+ compilationUnit->data = generateUnit();
+ compilationUnit->codeRefs.resize(irModule->functions.size());
int i = 0;
- foreach (V4IR::Function *irFunction, jsUnitGenerator.irModule->functions)
+ foreach (V4IR::Function *irFunction, irModule->functions)
compilationUnit->codeRefs[i++] = codeRefs[irFunction];
return compilationUnit;
}
void InstructionSelection::loadRegexp(V4IR::RegExp *sourceRegexp, V4IR::Temp *targetTemp)
{
- int id = jsUnitGenerator.registerRegExp(sourceRegexp);
+ int id = registerRegExp(sourceRegexp);
generateFunctionCall(Assembler::Void, __qmljs_lookup_runtime_regexp, Assembler::ContextRegister, Assembler::PointerToValue(targetTemp), Assembler::TrustedImm32(id));
}
void InstructionSelection::initClosure(V4IR::Closure *closure, V4IR::Temp *target)
{
- int id = jsUnitGenerator.irModule->functions.indexOf(closure->value);
+ int id = irModule->functions.indexOf(closure->value);
generateFunctionCall(Assembler::Void, __qmljs_init_closure, Assembler::ContextRegister, Assembler::PointerToValue(target), Assembler::TrustedImm32(id));
}
QV4::CompiledData::CompilationUnit *InstructionSelection::backendCompileStep()
{
- compilationUnit->data = jsUnitGenerator.generateUnit();
- compilationUnit->runtimeFunctions.reserve(jsUnitGenerator.irModule->functions.size());
- compilationUnit->codeRefs.resize(jsUnitGenerator.irModule->functions.size());
+ compilationUnit->data = generateUnit();
+ compilationUnit->codeRefs.resize(irModule->functions.size());
int i = 0;
- foreach (V4IR::Function *irFunction, jsUnitGenerator.irModule->functions)
+ foreach (V4IR::Function *irFunction, irModule->functions)
compilationUnit->codeRefs[i++] = codeRefs[irFunction];
return compilationUnit;
}
// call the property on the loaded base
Instruction::CallProperty call;
call.base = getParam(base);
- call.name = stringId(name);
+ call.name = registerString(name);
prepareCallArgs(args, call.argc, call.args);
call.result = getResultParam(result);
addInstruction(call);
V4IR::Temp *result)
{
Instruction::CreateActivationProperty create;
- create.name = stringId(*func->id);
+ create.name = registerString(*func->id);
prepareCallArgs(args, create.argc, create.args);
create.result = getResultParam(result);
addInstruction(create);
{
Instruction::CreateProperty create;
create.base = getParam(base);
- create.name = stringId(name);
+ create.name = registerString(name);
prepareCallArgs(args, create.argc, create.args);
create.result = getResultParam(result);
addInstruction(create);
void InstructionSelection::loadString(const QString &str, V4IR::Temp *targetTemp)
{
Instruction::LoadString load;
- load.stringId = stringId(str);
+ load.stringId = registerString(str);
load.result = getResultParam(targetTemp);
addInstruction(load);
}
void InstructionSelection::loadRegexp(V4IR::RegExp *sourceRegexp, V4IR::Temp *targetTemp)
{
Instruction::LoadRegExp load;
- load.regExpId = jsUnitGenerator.registerRegExp(sourceRegexp);
+ load.regExpId = registerRegExp(sourceRegexp);
load.result = getResultParam(targetTemp);
addInstruction(load);
}
void InstructionSelection::getActivationProperty(const V4IR::Name *name, V4IR::Temp *temp)
{
Instruction::LoadName load;
- load.name = stringId(*name->id);
+ load.name = registerString(*name->id);
load.result = getResultParam(temp);
addInstruction(load);
}
{
Instruction::StoreName store;
store.source = getParam(source);
- store.name = stringId(targetName);
+ store.name = registerString(targetName);
addInstruction(store);
}
void InstructionSelection::initClosure(V4IR::Closure *closure, V4IR::Temp *target)
{
- int id = jsUnitGenerator.irModule->functions.indexOf(closure->value);
+ int id = irModule->functions.indexOf(closure->value);
Instruction::LoadClosure load;
load.value = id;
load.result = getResultParam(target);
{
Instruction::LoadProperty load;
load.base = getParam(base);
- load.name = stringId(name);
+ load.name = registerString(name);
load.result = getResultParam(target);
addInstruction(load);
}
{
Instruction::StoreProperty store;
store.base = getParam(targetBase);
- store.name = stringId(targetName);
+ store.name = registerString(targetName);
store.source = getParam(source);
addInstruction(store);
}
if (op) {
Instruction::InplaceNameOp ieo;
ieo.alu = op;
- ieo.name = stringId(targetName);
+ ieo.name = registerString(targetName);
ieo.source = getParam(rightSource);
addInstruction(ieo);
}
Instruction::InplaceMemberOp imo;
imo.alu = op;
imo.base = getParam(targetBase);
- imo.member = stringId(targetName);
+ imo.member = registerString(targetName);
imo.source = getParam(source);
addInstruction(imo);
}
Instruction::EnterTry enterTry;
enterTry.tryOffset = 0;
enterTry.catchOffset = 0;
- enterTry.exceptionVarName = stringId(*t->exceptionVarName);
+ enterTry.exceptionVarName = registerString(*t->exceptionVarName);
enterTry.exceptionVar = getParam(t->exceptionVar);
ptrdiff_t enterTryLoc = addInstruction(enterTry);
void InstructionSelection::callBuiltinInvalid(V4IR::Name *func, V4IR::ExprList *args, V4IR::Temp *result)
{
Instruction::CallActivationProperty call;
- call.name = stringId(*func->id);
+ call.name = registerString(*func->id);
prepareCallArgs(args, call.argc, call.args);
call.result = getResultParam(result);
addInstruction(call);
{
Instruction::CallBuiltinTypeofMember call;
call.base = getParam(base);
- call.member = stringId(name);
+ call.member = registerString(name);
call.result = getResultParam(result);
addInstruction(call);
}
void InstructionSelection::callBuiltinTypeofName(const QString &name, V4IR::Temp *result)
{
Instruction::CallBuiltinTypeofName call;
- call.name = stringId(name);
+ call.name = registerString(name);
call.result = getResultParam(result);
addInstruction(call);
}
{
Instruction::CallBuiltinDeleteMember call;
call.base = getParam(base);
- call.member = stringId(name);
+ call.member = registerString(name);
call.result = getResultParam(result);
addInstruction(call);
}
void InstructionSelection::callBuiltinDeleteName(const QString &name, V4IR::Temp *result)
{
Instruction::CallBuiltinDeleteName call;
- call.name = stringId(name);
+ call.name = registerString(name);
call.result = getResultParam(result);
addInstruction(call);
}
{
Instruction::CallBuiltinPostDecMember call;
call.base = getParam(base);
- call.member = stringId(name);
+ call.member = registerString(name);
call.result = getResultParam(result);
addInstruction(call);
}
void InstructionSelection::callBuiltinPostDecrementName(const QString &name, V4IR::Temp *result)
{
Instruction::CallBuiltinPostDecName call;
- call.name = stringId(name);
+ call.name = registerString(name);
call.result = getResultParam(result);
addInstruction(call);
}
{
Instruction::CallBuiltinPostIncMember call;
call.base = getParam(base);
- call.member = stringId(name);
+ call.member = registerString(name);
call.result = getResultParam(result);
addInstruction(call);
}
void InstructionSelection::callBuiltinPostIncrementName(const QString &name, V4IR::Temp *result)
{
Instruction::CallBuiltinPostIncName call;
- call.name = stringId(name);
+ call.name = registerString(name);
call.result = getResultParam(result);
addInstruction(call);
}
{
Instruction::CallBuiltinDeclareVar call;
call.isDeletable = deletable;
- call.varName = stringId(name);
+ call.varName = registerString(name);
addInstruction(call);
}
{
Instruction::CallBuiltinDefineGetterSetter call;
call.object = getParam(object);
- call.name = stringId(name);
+ call.name = registerString(name);
call.getter = getParam(getter);
call.setter = getParam(setter);
addInstruction(call);
{
Instruction::CallBuiltinDefineProperty call;
call.object = getParam(object);
- call.name = stringId(name);
+ call.name = registerString(name);
call.value = getParam(value);
addInstruction(call);
}