mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-11 12:25:53 +00:00
Bug 1218643 - remove support for deprecated asm.js heap length. r=luke
--HG-- extra : rebase_source : 898189dfc6fde7d0c818e22c6ef277935d1acd0d
This commit is contained in:
parent
ff0b8109b3
commit
4216bb859a
@ -469,17 +469,6 @@ LinkModuleToHeap(JSContext* cx, AsmJSModule& module, Handle<ArrayBufferObjectMay
|
||||
{
|
||||
uint32_t heapLength = heap->byteLength();
|
||||
|
||||
if (IsDeprecatedAsmJSHeapLength(heapLength)) {
|
||||
LinkFail(cx, "ArrayBuffer byteLengths smaller than 64KB are deprecated and "
|
||||
"will cause a link-time failure in the future");
|
||||
|
||||
// The goal of deprecation is to give apps some time before linking
|
||||
// fails. However, if warnings-as-errors is turned on (which happens as
|
||||
// part of asm.js testing) an exception may be raised.
|
||||
if (cx->isExceptionPending())
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!IsValidAsmJSHeapLength(heapLength)) {
|
||||
ScopedJSFreePtr<char> msg(
|
||||
JS_smprintf("ArrayBuffer byteLength 0x%x is not a valid heap length. The next "
|
||||
@ -631,7 +620,6 @@ ChangeHeap(JSContext* cx, AsmJSModule& module, const CallArgs& args)
|
||||
}
|
||||
|
||||
MOZ_ASSERT(IsValidAsmJSHeapLength(heapLength));
|
||||
MOZ_ASSERT(!IsDeprecatedAsmJSHeapLength(heapLength));
|
||||
|
||||
if (!ArrayBufferObject::prepareForAsmJS(cx, newBuffer, module.usesSignalHandlersForOOB()))
|
||||
return false;
|
||||
|
@ -51,9 +51,14 @@ extern bool
|
||||
ValidateAsmJS(ExclusiveContext* cx, AsmJSParser& parser, frontend::ParseNode* stmtList,
|
||||
bool* validated);
|
||||
|
||||
// The minimum heap length for asm.js.
|
||||
const size_t AsmJSMinHeapLength = 64 * 1024;
|
||||
|
||||
// The assumed page size; dynamically checked in ValidateAsmJS.
|
||||
const size_t AsmJSPageSize = 4096;
|
||||
|
||||
static_assert(AsmJSMinHeapLength % AsmJSPageSize == 0, "Invalid page size");
|
||||
|
||||
#if defined(ASMJS_MAY_USE_SIGNAL_HANDLERS_FOR_OOB)
|
||||
|
||||
// Targets define AsmJSImmediateRange to be the size of an address immediate,
|
||||
@ -86,8 +91,8 @@ static const size_t AsmJSMappedSize = 4 * 1024ULL * 1024ULL * 1024ULL +
|
||||
inline uint32_t
|
||||
RoundUpToNextValidAsmJSHeapLength(uint32_t length)
|
||||
{
|
||||
if (length <= 4 * 1024)
|
||||
return 4 * 1024;
|
||||
if (length <= AsmJSMinHeapLength)
|
||||
return AsmJSMinHeapLength;
|
||||
|
||||
if (length <= 16 * 1024 * 1024)
|
||||
return mozilla::RoundUpPow2(length);
|
||||
@ -99,7 +104,7 @@ RoundUpToNextValidAsmJSHeapLength(uint32_t length)
|
||||
inline bool
|
||||
IsValidAsmJSHeapLength(uint32_t length)
|
||||
{
|
||||
bool valid = length >= 4 * 1024 &&
|
||||
bool valid = length >= AsmJSMinHeapLength &&
|
||||
(IsPowerOfTwo(length) ||
|
||||
(length & 0x00ffffff) == 0);
|
||||
|
||||
@ -109,14 +114,6 @@ IsValidAsmJSHeapLength(uint32_t length)
|
||||
return valid;
|
||||
}
|
||||
|
||||
// For now, power-of-2 lengths in this range are accepted, but in the future
|
||||
// we'll change this to cause link-time failure.
|
||||
inline bool
|
||||
IsDeprecatedAsmJSHeapLength(uint32_t length)
|
||||
{
|
||||
return length >= 4 * 1024 && length < 64 * 1024 && IsPowerOfTwo(length);
|
||||
}
|
||||
|
||||
// Return whether asm.js optimization is inhibited by the platform or
|
||||
// dynamically disabled:
|
||||
extern bool
|
||||
|
@ -15,7 +15,7 @@ function f(stdlib, foreign, buffer)
|
||||
if (isAsmJSCompilationAvailable())
|
||||
assertEq(isAsmJSModule(f), true);
|
||||
|
||||
var i32 = new Int32Array(4096);
|
||||
var i32 = new Int32Array(65536);
|
||||
var buffer = i32.buffer;
|
||||
var set = f(this, null, buffer);
|
||||
if (isAsmJSCompilationAvailable())
|
||||
|
Loading…
Reference in New Issue
Block a user