Commit 40ad4cc7 authored by palfia@homejinni.com's avatar palfia@homejinni.com

MIPS: Turn the NumberToStringStub into a hydrogen stub.

Port r16910 (5a0dd952)

Original commit message:
This adds a BuildLookupNumberStringCache() in Hydrogen, which will
be used by the hydrogen version of StringAddStub, in addition to the
hydrogen version of NumberToStringStub.

BUG=
R=plind44@gmail.com

Review URL: https://codereview.chromium.org/24436004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16926 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent f1d1dd60
......@@ -60,6 +60,16 @@ void ToNumberStub::InitializeInterfaceDescriptor(
}
void NumberToStringStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
static Register registers[] = { a0 };
descriptor->register_param_count_ = 1;
descriptor->register_params_ = registers;
descriptor->deoptimization_handler_ = NULL;
}
void FastCloneShallowArrayStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
......@@ -994,21 +1004,6 @@ static void EmitCheckForInternalizedStringsOrObjects(MacroAssembler* masm,
}
void NumberToStringStub::Generate(MacroAssembler* masm) {
Label runtime;
__ lw(a1, MemOperand(sp, 0));
// Generate code to lookup number in the number string cache.
__ LookupNumberStringCache(a1, v0, a2, a3, t0, &runtime);
__ DropAndRet(1);
__ bind(&runtime);
// Handle number to string in the runtime system if not found in the cache.
__ TailCallRuntime(Runtime::kNumberToString, 1, 1);
}
static void ICCompareStub_CheckInputType(MacroAssembler* masm,
Register input,
Register scratch,
......
......@@ -268,18 +268,6 @@ class WriteInt32ToHeapNumberStub : public PlatformCodeStub {
};
class NumberToStringStub: public PlatformCodeStub {
public:
NumberToStringStub() { }
private:
Major MajorKey() { return NumberToString; }
int MinorKey() { return 0; }
void Generate(MacroAssembler* masm);
};
class RecordWriteStub: public PlatformCodeStub {
public:
RecordWriteStub(Register object,
......
......@@ -3611,8 +3611,9 @@ void FullCodeGenerator::EmitNumberToString(CallRuntime* expr) {
ZoneList<Expression*>* args = expr->arguments();
ASSERT_EQ(args->length(), 1);
// Load the argument on the stack and call the stub.
VisitForStackValue(args->at(0));
// Load the argument into a0 and call the stub.
VisitForAccumulatorValue(args->at(0));
__ mov(a0, result_register());
NumberToStringStub stub;
__ CallStub(&stub);
......
......@@ -1063,11 +1063,6 @@ void LCodeGen::DoCallStub(LCallStub* instr) {
CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
break;
}
case CodeStub::NumberToString: {
NumberToStringStub stub;
CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
break;
}
case CodeStub::StringCompare: {
StringCompareStub stub;
CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment