Bug 1086530 - Huge regression with using split after landing of bug 1054330. r=kvijayan

This commit is contained in:
Victor Carlquist 2014-10-31 10:15:51 -02:00
Родитель 43e6e5bbf7
Коммит 2b67d3ef5a
3 изменённых файлов: 10 добавлений и 7 удалений

Просмотреть файл

@ -8826,10 +8826,11 @@ CopyArray(JSContext *cx, HandleArrayObject obj, MutableHandleValue result)
if (!type)
return false;
RootedArrayObject newObj(cx, NewDenseArray(cx, length, type, NewArray_FullyAllocating));
RootedArrayObject newObj(cx, NewDenseFullyAllocatedArray(cx, length, nullptr, TenuredObject));
if (!newObj)
return false;
newObj->setType(type);
newObj->setDenseInitializedLength(length);
newObj->initDenseElements(0, obj->getDenseElements(), length);
result.setObject(*newObj);

Просмотреть файл

@ -6151,10 +6151,10 @@ class ICCall_StringSplit : public ICMonitoredStub
uint32_t pcOffset_;
HeapPtrString expectedThis_;
HeapPtrString expectedArg_;
HeapPtrObject templateObject_;
HeapPtrNativeObject templateObject_;
ICCall_StringSplit(JitCode *stubCode, ICStub *firstMonitorStub, uint32_t pcOffset, HandleString thisString,
HandleString argString, HandleObject templateObject)
HandleString argString, HandleNativeObject templateObject)
: ICMonitoredStub(ICStub::Call_StringSplit, stubCode, firstMonitorStub),
pcOffset_(pcOffset), expectedThis_(thisString), expectedArg_(argString),
templateObject_(templateObject)
@ -6163,7 +6163,7 @@ class ICCall_StringSplit : public ICMonitoredStub
public:
static inline ICCall_StringSplit *New(ICStubSpace *space, JitCode *code,
ICStub *firstMonitorStub, uint32_t pcOffset, HandleString thisString,
HandleString argString, HandleObject templateObject)
HandleString argString, HandleNativeObject templateObject)
{
if (!code)
return nullptr;
@ -6191,7 +6191,7 @@ class ICCall_StringSplit : public ICMonitoredStub
return expectedArg_;
}
HeapPtrObject &templateObject() {
HeapPtrNativeObject &templateObject() {
return templateObject_;
}
@ -6201,7 +6201,7 @@ class ICCall_StringSplit : public ICMonitoredStub
uint32_t pcOffset_;
RootedString expectedThis_;
RootedString expectedArg_;
RootedObject templateObject_;
RootedNativeObject templateObject_;
bool generateStubCode(MacroAssembler &masm);
@ -6217,7 +6217,7 @@ class ICCall_StringSplit : public ICMonitoredStub
pcOffset_(pcOffset),
expectedThis_(cx, thisString),
expectedArg_(cx, argString),
templateObject_(cx, &templateObject.toObject())
templateObject_(cx, &templateObject.toObject().as<NativeObject>())
{ }
ICStub *getStub(ICStubSpace *space) {

Просмотреть файл

@ -450,6 +450,8 @@ BaselineInspector::getTemplateObjectForNative(jsbytecode *pc, Native native)
for (ICStub *stub = entry.firstStub(); stub; stub = stub->next()) {
if (stub->isCall_Native() && stub->toCall_Native()->callee()->native() == native)
return stub->toCall_Native()->templateObject();
if (stub->isCall_StringSplit() && native == js::str_split)
return stub->toCall_StringSplit()->templateObject();
}
return nullptr;