Skip to content

Commit

Permalink
Bug 1161762 - Fix test used for whether an unboxed object layout is t…
Browse files Browse the repository at this point in the history
…oo large, r=jandem.
  • Loading branch information
bhackett1024 committed May 7, 2015
1 parent f0a7d4b commit 67f1b5b
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
24 changes: 24 additions & 0 deletions js/src/jit-test/tests/basic/bug1161762.js
@@ -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
};
}
2 changes: 1 addition & 1 deletion js/src/vm/UnboxedObject.cpp
Expand Up @@ -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;
}

Expand Down

0 comments on commit 67f1b5b

Please sign in to comment.