mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-13 21:35:39 +00:00
Backed out changeset 5e6d8b6023e3 (bug 1092833) under suspicion of ggc bustage on a CLOSED TREE
This commit is contained in:
parent
4cc292fee5
commit
95d97e3784
@ -1,49 +0,0 @@
|
||||
// Test that lexicals work with functions with many bindings.
|
||||
|
||||
(function() {
|
||||
var a01
|
||||
var b02
|
||||
var c03
|
||||
var d04
|
||||
var e05
|
||||
var f06
|
||||
var g07
|
||||
var h08
|
||||
let i09
|
||||
var j10
|
||||
var k11
|
||||
var l12
|
||||
var m13
|
||||
var n14
|
||||
var o15
|
||||
(function n14() {
|
||||
assertEq(i09, undefined);
|
||||
})()
|
||||
})();
|
||||
|
||||
try {
|
||||
(function() {
|
||||
var a01
|
||||
var b02
|
||||
var c03
|
||||
var d04
|
||||
var e05
|
||||
var f06
|
||||
var g07
|
||||
var h08
|
||||
let i09
|
||||
var j10
|
||||
var k11
|
||||
var l12
|
||||
var m13
|
||||
var n14
|
||||
var o15
|
||||
(function n14() {
|
||||
i12++
|
||||
})()
|
||||
let i12
|
||||
})()
|
||||
} catch (e) {
|
||||
assertEq(e instanceof ReferenceError, true);
|
||||
assertEq(e.message.indexOf("i12") > 0, true);
|
||||
}
|
@ -27,7 +27,6 @@
|
||||
#endif
|
||||
#include "jsinferinlines.h"
|
||||
#include "jsobjinlines.h"
|
||||
#include "vm/Interpreter-inl.h"
|
||||
|
||||
using namespace js;
|
||||
using namespace js::jit;
|
||||
@ -957,18 +956,12 @@ MacroAssembler::copySlotsFromTemplate(Register obj, const NativeObject *template
|
||||
}
|
||||
|
||||
void
|
||||
MacroAssembler::fillSlotsWithConstantValue(Address base, Register temp,
|
||||
uint32_t start, uint32_t end, const Value &v)
|
||||
MacroAssembler::fillSlotsWithUndefined(Address base, Register temp, uint32_t start, uint32_t end)
|
||||
{
|
||||
MOZ_ASSERT(v.isUndefined() || IsUninitializedLexical(v));
|
||||
|
||||
if (start >= end)
|
||||
return;
|
||||
|
||||
#ifdef JS_NUNBOX32
|
||||
// We only have a single spare register, so do the initialization as two
|
||||
// strided writes of the tag and body.
|
||||
jsval_layout jv = JSVAL_TO_IMPL(v);
|
||||
jsval_layout jv = JSVAL_TO_IMPL(UndefinedValue());
|
||||
|
||||
Address addr = base;
|
||||
move32(Imm32(jv.s.payload.i32), temp);
|
||||
@ -980,43 +973,22 @@ MacroAssembler::fillSlotsWithConstantValue(Address base, Register temp,
|
||||
for (unsigned i = start; i < end; ++i, addr.offset += sizeof(HeapValue))
|
||||
store32(temp, ToType(addr));
|
||||
#else
|
||||
moveValue(v, temp);
|
||||
moveValue(UndefinedValue(), temp);
|
||||
for (uint32_t i = start; i < end; ++i, base.offset += sizeof(HeapValue))
|
||||
storePtr(temp, base);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
MacroAssembler::fillSlotsWithUndefined(Address base, Register temp, uint32_t start, uint32_t end)
|
||||
{
|
||||
fillSlotsWithConstantValue(base, temp, start, end, UndefinedValue());
|
||||
}
|
||||
|
||||
void
|
||||
MacroAssembler::fillSlotsWithUninitialized(Address base, Register temp, uint32_t start, uint32_t end)
|
||||
{
|
||||
fillSlotsWithConstantValue(base, temp, start, end, MagicValue(JS_UNINITIALIZED_LEXICAL));
|
||||
}
|
||||
|
||||
static void
|
||||
FindStartOfUndefinedAndUninitializedSlots(NativeObject *templateObj, uint32_t nslots,
|
||||
uint32_t *startOfUndefined, uint32_t *startOfUninitialized)
|
||||
static uint32_t
|
||||
FindStartOfUndefinedSlots(NativeObject *templateObj, uint32_t nslots)
|
||||
{
|
||||
MOZ_ASSERT(nslots == templateObj->lastProperty()->slotSpan(templateObj->getClass()));
|
||||
MOZ_ASSERT(nslots > 0);
|
||||
uint32_t first = nslots;
|
||||
for (; first != 0; --first) {
|
||||
if (!IsUninitializedLexical(templateObj->getSlot(first - 1)))
|
||||
break;
|
||||
for (uint32_t first = nslots; first != 0; --first) {
|
||||
if (templateObj->getSlot(first - 1) != UndefinedValue())
|
||||
return first;
|
||||
}
|
||||
*startOfUninitialized = first;
|
||||
for (; first != 0; --first) {
|
||||
if (templateObj->getSlot(first - 1) != UndefinedValue()) {
|
||||
*startOfUndefined = first;
|
||||
return;
|
||||
}
|
||||
}
|
||||
*startOfUndefined = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
@ -1039,28 +1011,16 @@ MacroAssembler::initGCSlots(Register obj, Register slots, NativeObject *template
|
||||
// logically into independent non-UndefinedValue writes to the head and
|
||||
// duplicated writes of UndefinedValue to the tail. For the majority of
|
||||
// objects, the "tail" will be the entire slot range.
|
||||
//
|
||||
// The template object may be a CallObject, in which case we need to
|
||||
// account for uninitialized lexical slots as well as undefined
|
||||
// slots. Unitialized lexical slots always appear at the very end of
|
||||
// slots, after undefined.
|
||||
uint32_t startOfUndefined = nslots;
|
||||
uint32_t startOfUninitialized = nslots;
|
||||
FindStartOfUndefinedAndUninitializedSlots(templateObj, nslots,
|
||||
&startOfUndefined, &startOfUninitialized);
|
||||
uint32_t startOfUndefined = FindStartOfUndefinedSlots(templateObj, nslots);
|
||||
MOZ_ASSERT(startOfUndefined <= nfixed); // Reserved slots must be fixed.
|
||||
MOZ_ASSERT_IF(startOfUndefined != nfixed, startOfUndefined <= startOfUninitialized);
|
||||
MOZ_ASSERT_IF(!templateObj->is<CallObject>(), startOfUninitialized == nslots);
|
||||
|
||||
// Copy over any preserved reserved slots.
|
||||
copySlotsFromTemplate(obj, templateObj, 0, startOfUndefined);
|
||||
|
||||
// Fill the rest of the fixed slots with undefined and uninitialized.
|
||||
// Fill the rest of the fixed slots with undefined.
|
||||
if (initFixedSlots) {
|
||||
fillSlotsWithUndefined(Address(obj, NativeObject::getFixedSlotOffset(startOfUndefined)), slots,
|
||||
startOfUndefined, Min(startOfUninitialized, nfixed));
|
||||
size_t offset = NativeObject::getFixedSlotOffset(startOfUninitialized);
|
||||
fillSlotsWithUninitialized(Address(obj, offset), slots, startOfUninitialized, nfixed);
|
||||
startOfUndefined, nfixed);
|
||||
}
|
||||
|
||||
if (ndynamic) {
|
||||
@ -1068,14 +1028,7 @@ MacroAssembler::initGCSlots(Register obj, Register slots, NativeObject *template
|
||||
// register briefly for our slots base address.
|
||||
push(obj);
|
||||
loadPtr(Address(obj, NativeObject::offsetOfSlots()), obj);
|
||||
|
||||
// Initially fill all dynamic slots with undefined.
|
||||
fillSlotsWithUndefined(Address(obj, 0), slots, 0, ndynamic);
|
||||
|
||||
// Fill uninitialized slots if necessary.
|
||||
fillSlotsWithUninitialized(Address(obj, 0), slots, startOfUninitialized - nfixed,
|
||||
nslots - startOfUninitialized);
|
||||
|
||||
pop(obj);
|
||||
}
|
||||
}
|
||||
|
@ -810,10 +810,7 @@ class MacroAssembler : public MacroAssemblerSpecific
|
||||
void allocateNonObject(Register result, Register temp, gc::AllocKind allocKind, Label *fail);
|
||||
void copySlotsFromTemplate(Register obj, const NativeObject *templateObj,
|
||||
uint32_t start, uint32_t end);
|
||||
void fillSlotsWithConstantValue(Address addr, Register temp, uint32_t start, uint32_t end,
|
||||
const Value &v);
|
||||
void fillSlotsWithUndefined(Address addr, Register temp, uint32_t start, uint32_t end);
|
||||
void fillSlotsWithUninitialized(Address addr, Register temp, uint32_t start, uint32_t end);
|
||||
void initGCSlots(Register obj, Register temp, NativeObject *templateObj, bool initFixedSlots);
|
||||
|
||||
public:
|
||||
|
Loading…
Reference in New Issue
Block a user