Bug 1161762 - Fix test used for whether an unboxed object layout is too large, r=jandem.

This commit is contained in:
Brian Hackett 2015-05-07 07:43:27 -06:00
Родитель f0a7d4b40a
Коммит 67f1b5bb27
2 изменённых файлов: 25 добавлений и 1 удалений

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

@ -0,0 +1,24 @@
for (var actual = .5; actual < 100; actual++) {
var test2 = {
test4: actual + 6,
test2: actual + 9,
printStatus: actual + 10,
isPrototypeOf: actual + 12,
expect: actual + 14,
printErr: actual + 17,
ret2: actual + 19,
printBugNumber: actual + 32,
test3: actual + 33,
String: actual + 34,
summary: actual + 40,
test1: actual + 42,
Array: actual + 43,
BUGNUMBER: actual + 44,
assertEq: actual + 45,
__call__: actual + 47,
x: actual + 48,
test0: actual + 49,
res: actual + 50
};
}

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

@ -1961,7 +1961,7 @@ js::TryConvertToUnboxedLayout(ExclusiveContext* cx, Shape* templateShape,
layoutSize = ComputePlainObjectLayout(cx, templateShape, properties);
// The entire object must be allocatable inline.
if (sizeof(JSObject) + layoutSize > JSObject::MAX_BYTE_SIZE)
if (UnboxedPlainObject::offsetOfData() + layoutSize > JSObject::MAX_BYTE_SIZE)
return true;
}