Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (237079 => 237080)
--- trunk/Source/_javascript_Core/ChangeLog 2018-10-12 21:32:08 UTC (rev 237079)
+++ trunk/Source/_javascript_Core/ChangeLog 2018-10-12 21:42:23 UTC (rev 237080)
@@ -1,3 +1,16 @@
+2018-10-12 Ryan Haddad <ryanhad...@apple.com>
+
+ Unreviewed, rolling out r237063.
+
+ Caused layout test fast/dom/Window/window-postmessage-clone-
+ deep-array.html to fail on macOS and iOS Debug bots.
+
+ Reverted changeset:
+
+ "[JSC] Remove gcc warnings on mips and armv7"
+ https://bugs.webkit.org/show_bug.cgi?id=188598
+ https://trac.webkit.org/changeset/237063
+
2018-10-11 Guillaume Emont <guijem...@igalia.com>
[JSC] Remove gcc warnings on mips and armv7
Modified: trunk/Source/_javascript_Core/assembler/MacroAssemblerPrinter.cpp (237079 => 237080)
--- trunk/Source/_javascript_Core/assembler/MacroAssemblerPrinter.cpp 2018-10-12 21:32:08 UTC (rev 237079)
+++ trunk/Source/_javascript_Core/assembler/MacroAssemblerPrinter.cpp 2018-10-12 21:42:23 UTC (rev 237080)
@@ -131,9 +131,6 @@
}
}
- // assuming memory is not malformed, it originally pointed to a value
- // of the size with which we use it below, so the bitwise_casts should
- // be safe, including regarding alignment.
if (memory.dumpStyle == Memory::SingleWordDump) {
if (memory.numBytes == sizeof(int8_t)) {
auto p = reinterpret_cast<int8_t*>(ptr);
@@ -141,17 +138,17 @@
return;
}
if (memory.numBytes == sizeof(int16_t)) {
- auto p = bitwise_cast<int16_t*>(ptr);
+ auto p = reinterpret_cast<int16_t*>(ptr);
out.printf("%p:<0x%04x %d>", p, *p, *p);
return;
}
if (memory.numBytes == sizeof(int32_t)) {
- auto p = bitwise_cast<int32_t*>(ptr);
+ auto p = reinterpret_cast<int32_t*>(ptr);
out.printf("%p:<0x%08x %d>", p, *p, *p);
return;
}
if (memory.numBytes == sizeof(int64_t)) {
- auto p = bitwise_cast<int64_t*>(ptr);
+ auto p = reinterpret_cast<int64_t*>(ptr);
out.printf("%p:<0x%016" PRIx64 " %" PRId64 ">", p, *p, *p);
return;
}
Modified: trunk/Source/_javascript_Core/assembler/testmasm.cpp (237079 => 237080)
--- trunk/Source/_javascript_Core/assembler/testmasm.cpp 2018-10-12 21:32:08 UTC (rev 237079)
+++ trunk/Source/_javascript_Core/assembler/testmasm.cpp 2018-10-12 21:42:23 UTC (rev 237080)
@@ -246,7 +246,7 @@
}
-static Vector<float> UNUSED_FUNCTION floatOperands()
+static Vector<float> floatOperands()
{
return Vector<float> {
0,
@@ -747,9 +747,7 @@
CPUState originalState;
void* originalSP { nullptr };
void* newSP { nullptr };
-#if !(CPU(MIPS))
uintptr_t modifiedFlags { 0 };
-#endif
size_t numberOfExtraEntriesToWrite { 10 }; // ARM64 requires that this be 2 word aligned.
#if CPU(X86) || CPU(X86_64)
Modified: trunk/Source/_javascript_Core/bytecode/CodeBlock.h (237079 => 237080)
--- trunk/Source/_javascript_Core/bytecode/CodeBlock.h 2018-10-12 21:32:08 UTC (rev 237079)
+++ trunk/Source/_javascript_Core/bytecode/CodeBlock.h 2018-10-12 21:42:23 UTC (rev 237080)
@@ -1048,7 +1048,7 @@
}
template <typename ExecutableType>
-std::optional<Exception*> ScriptExecutable::prepareForExecution(VM& vm, JSFunction* function, JSScope* scope, CodeSpecializationKind kind, CodeBlock*& resultCodeBlock)
+JSObject* ScriptExecutable::prepareForExecution(VM& vm, JSFunction* function, JSScope* scope, CodeSpecializationKind kind, CodeBlock*& resultCodeBlock)
{
if (hasJITCodeFor(kind)) {
if (std::is_same<ExecutableType, EvalExecutable>::value)
@@ -1061,7 +1061,7 @@
resultCodeBlock = jsCast<CodeBlock*>(jsCast<FunctionExecutable*>(this)->codeBlockFor(kind));
else
RELEASE_ASSERT_NOT_REACHED();
- return std::nullopt;
+ return nullptr;
}
return prepareForExecutionImpl(vm, function, scope, kind, resultCodeBlock);
}
Modified: trunk/Source/_javascript_Core/interpreter/Interpreter.cpp (237079 => 237080)
--- trunk/Source/_javascript_Core/interpreter/Interpreter.cpp 2018-10-12 21:32:08 UTC (rev 237079)
+++ trunk/Source/_javascript_Core/interpreter/Interpreter.cpp 2018-10-12 21:42:23 UTC (rev 237080)
@@ -806,11 +806,10 @@
ProgramCodeBlock* codeBlock;
{
CodeBlock* tempCodeBlock;
- std::optional<Exception*> error = program->prepareForExecution<ProgramExecutable>(vm, nullptr, scope, CodeForCall, tempCodeBlock);
- EXCEPTION_ASSERT(throwScope.exception() == error.value_or(nullptr));
-
+ JSObject* error = program->prepareForExecution<ProgramExecutable>(vm, nullptr, scope, CodeForCall, tempCodeBlock);
+ EXCEPTION_ASSERT(throwScope.exception() == reinterpret_cast<Exception*>(error));
if (UNLIKELY(error))
- return checkedReturn(*error);
+ return checkedReturn(error);
codeBlock = jsCast<ProgramCodeBlock*>(tempCodeBlock);
}
@@ -865,10 +864,10 @@
if (isJSCall) {
// Compile the callee:
- std::optional<Exception*> compileError = callData.js.functionExecutable->prepareForExecution<FunctionExecutable>(vm, jsCast<JSFunction*>(function), scope, CodeForCall, newCodeBlock);
- EXCEPTION_ASSERT(throwScope.exception() == compileError.value_or(nullptr));
+ JSObject* compileError = callData.js.functionExecutable->prepareForExecution<FunctionExecutable>(vm, jsCast<JSFunction*>(function), scope, CodeForCall, newCodeBlock);
+ EXCEPTION_ASSERT(throwScope.exception() == reinterpret_cast<Exception*>(compileError));
if (UNLIKELY(!!compileError))
- return checkedReturn(*compileError);
+ return checkedReturn(compileError);
ASSERT(!!newCodeBlock);
newCodeBlock->m_shouldAlwaysBeInlined = false;
@@ -932,10 +931,10 @@
if (isJSConstruct) {
// Compile the callee:
- std::optional<Exception*> compileError = constructData.js.functionExecutable->prepareForExecution<FunctionExecutable>(vm, jsCast<JSFunction*>(constructor), scope, CodeForConstruct, newCodeBlock);
- EXCEPTION_ASSERT(throwScope.exception() == compileError.value_or(nullptr));
+ JSObject* compileError = constructData.js.functionExecutable->prepareForExecution<FunctionExecutable>(vm, jsCast<JSFunction*>(constructor), scope, CodeForConstruct, newCodeBlock);
+ EXCEPTION_ASSERT(throwScope.exception() == reinterpret_cast<Exception*>(compileError));
if (UNLIKELY(!!compileError))
- return checkedReturn(*compileError);
+ return checkedReturn(compileError);
ASSERT(!!newCodeBlock);
newCodeBlock->m_shouldAlwaysBeInlined = false;
@@ -980,8 +979,8 @@
// Compile the callee:
CodeBlock* newCodeBlock;
- std::optional<Exception*> error = functionExecutable->prepareForExecution<FunctionExecutable>(vm, function, scope, CodeForCall, newCodeBlock);
- EXCEPTION_ASSERT(throwScope.exception() == error.value_or(nullptr));
+ JSObject* error = functionExecutable->prepareForExecution<FunctionExecutable>(vm, function, scope, CodeForCall, newCodeBlock);
+ EXCEPTION_ASSERT(throwScope.exception() == reinterpret_cast<Exception*>(error));
if (UNLIKELY(error))
return CallFrameClosure();
newCodeBlock->m_shouldAlwaysBeInlined = false;
@@ -1038,10 +1037,10 @@
EvalCodeBlock* codeBlock;
{
CodeBlock* tempCodeBlock;
- std::optional<Exception*> compileError = eval->prepareForExecution<EvalExecutable>(vm, nullptr, scope, CodeForCall, tempCodeBlock);
- EXCEPTION_ASSERT(throwScope.exception() == compileError.value_or(nullptr));
+ JSObject* compileError = eval->prepareForExecution<EvalExecutable>(vm, nullptr, scope, CodeForCall, tempCodeBlock);
+ EXCEPTION_ASSERT(throwScope.exception() == reinterpret_cast<Exception*>(compileError));
if (UNLIKELY(!!compileError))
- return checkedReturn(*compileError);
+ return checkedReturn(compileError);
codeBlock = jsCast<EvalCodeBlock*>(tempCodeBlock);
}
@@ -1161,10 +1160,10 @@
ModuleProgramCodeBlock* codeBlock;
{
CodeBlock* tempCodeBlock;
- std::optional<Exception*> compileError = executable->prepareForExecution<ModuleProgramExecutable>(vm, nullptr, scope, CodeForCall, tempCodeBlock);
- EXCEPTION_ASSERT(throwScope.exception() == compileError.value_or(nullptr));
+ JSObject* compileError = executable->prepareForExecution<ModuleProgramExecutable>(vm, nullptr, scope, CodeForCall, tempCodeBlock);
+ EXCEPTION_ASSERT(throwScope.exception() == reinterpret_cast<Exception*>(compileError));
if (UNLIKELY(!!compileError))
- return checkedReturn(*compileError);
+ return checkedReturn(compileError);
codeBlock = jsCast<ModuleProgramCodeBlock*>(tempCodeBlock);
}
Modified: trunk/Source/_javascript_Core/jit/JITOperations.cpp (237079 => 237080)
--- trunk/Source/_javascript_Core/jit/JITOperations.cpp 2018-10-12 21:32:08 UTC (rev 237079)
+++ trunk/Source/_javascript_Core/jit/JITOperations.cpp 2018-10-12 21:42:23 UTC (rev 237080)
@@ -1040,8 +1040,8 @@
}
CodeBlock** codeBlockSlot = execCallee->addressOfCodeBlock();
- std::optional<Exception*> error = functionExecutable->prepareForExecution<FunctionExecutable>(*vm, callee, scope, kind, *codeBlockSlot);
- EXCEPTION_ASSERT(throwScope.exception() == error.value_or(nullptr));
+ JSObject* error = functionExecutable->prepareForExecution<FunctionExecutable>(*vm, callee, scope, kind, *codeBlockSlot);
+ EXCEPTION_ASSERT(throwScope.exception() == reinterpret_cast<Exception*>(error));
if (error)
return handleThrowException();
codeBlock = *codeBlockSlot;
@@ -1096,8 +1096,8 @@
RELEASE_ASSERT(isCall(kind) || functionExecutable->constructAbility() != ConstructAbility::CannotConstruct);
- std::optional<Exception*> error = functionExecutable->prepareForExecution<FunctionExecutable>(*vm, callee, scope, kind, codeBlock);
- EXCEPTION_ASSERT_UNUSED(throwScope, throwScope.exception() == error.value_or(nullptr));
+ JSObject* error = functionExecutable->prepareForExecution<FunctionExecutable>(*vm, callee, scope, kind, codeBlock);
+ EXCEPTION_ASSERT_UNUSED(throwScope, throwScope.exception() == reinterpret_cast<Exception*>(error));
if (error)
return;
unsigned argumentStackSlots = callLinkInfo->maxNumArguments();
@@ -1145,8 +1145,8 @@
}
CodeBlock** codeBlockSlot = execCallee->addressOfCodeBlock();
- std::optional<Exception*> error = functionExecutable->prepareForExecution<FunctionExecutable>(*vm, function, scope, kind, *codeBlockSlot);
- EXCEPTION_ASSERT(throwScope.exception() == error.value_or(nullptr));
+ JSObject* error = functionExecutable->prepareForExecution<FunctionExecutable>(*vm, function, scope, kind, *codeBlockSlot);
+ EXCEPTION_ASSERT(throwScope.exception() == reinterpret_cast<Exception*>(error));
if (error) {
return encodeResult(
vm->getCTIStub(throwExceptionFromCallSlowPathGenerator).retaggedCode<JSEntryPtrTag>().executableAddress(),
Modified: trunk/Source/_javascript_Core/llint/LLIntSlowPaths.cpp (237079 => 237080)
--- trunk/Source/_javascript_Core/llint/LLIntSlowPaths.cpp 2018-10-12 21:32:08 UTC (rev 237079)
+++ trunk/Source/_javascript_Core/llint/LLIntSlowPaths.cpp 2018-10-12 21:42:23 UTC (rev 237080)
@@ -1484,10 +1484,10 @@
LLINT_CALL_THROW(exec, createNotAConstructorError(exec, callee));
CodeBlock** codeBlockSlot = execCallee->addressOfCodeBlock();
- std::optional<Exception*> error = functionExecutable->prepareForExecution<FunctionExecutable>(vm, callee, scope, kind, *codeBlockSlot);
- EXCEPTION_ASSERT(throwScope.exception() == error.value_or(nullptr));
+ JSObject* error = functionExecutable->prepareForExecution<FunctionExecutable>(vm, callee, scope, kind, *codeBlockSlot);
+ EXCEPTION_ASSERT(throwScope.exception() == error);
if (UNLIKELY(error))
- LLINT_CALL_THROW(exec, *error);
+ LLINT_CALL_THROW(exec, error);
codeBlock = *codeBlockSlot;
ASSERT(codeBlock);
ArityCheckMode arity;
Modified: trunk/Source/_javascript_Core/runtime/JSBigInt.cpp (237079 => 237080)
--- trunk/Source/_javascript_Core/runtime/JSBigInt.cpp 2018-10-12 21:32:08 UTC (rev 237079)
+++ trunk/Source/_javascript_Core/runtime/JSBigInt.cpp 2018-10-12 21:42:23 UTC (rev 237080)
@@ -1550,10 +1550,7 @@
inline JSBigInt::Digit* JSBigInt::dataStorage()
{
- // offsetOfData() makes sure that its return value is aligned to the size
- // of Digit, so even though we cast to char* for pointer arithmetics, the
- // bitwise_cast to Digit* is correct and properly aligned.
- return bitwise_cast<Digit*>(reinterpret_cast<char*>(this) + offsetOfData());
+ return reinterpret_cast<Digit*>(reinterpret_cast<char*>(this) + offsetOfData());
}
inline JSBigInt::Digit JSBigInt::digit(unsigned n)
Modified: trunk/Source/_javascript_Core/runtime/ScriptExecutable.cpp (237079 => 237080)
--- trunk/Source/_javascript_Core/runtime/ScriptExecutable.cpp 2018-10-12 21:32:08 UTC (rev 237079)
+++ trunk/Source/_javascript_Core/runtime/ScriptExecutable.cpp 2018-10-12 21:42:23 UTC (rev 237080)
@@ -29,7 +29,6 @@
#include "CodeBlock.h"
#include "Debugger.h"
#include "EvalCodeBlock.h"
-#include "Exception.h"
#include "FunctionCodeBlock.h"
#include "IsoCellSetInlines.h"
#include "JIT.h"
@@ -338,7 +337,7 @@
#endif
}
-std::optional<Exception*> ScriptExecutable::prepareForExecutionImpl(
+JSObject* ScriptExecutable::prepareForExecutionImpl(
VM& vm, JSFunction* function, JSScope* scope, CodeSpecializationKind kind, CodeBlock*& resultCodeBlock)
{
auto throwScope = DECLARE_THROW_SCOPE(vm);
@@ -346,7 +345,7 @@
if (vm.getAndClearFailNextNewCodeBlock()) {
auto& state = *scope->globalObject(vm)->globalExec();
- return static_cast<Exception*>(throwException(&state, throwScope, createError(&state, "Forced Failure"_s)));
+ return throwException(&state, throwScope, createError(&state, "Forced Failure"_s));
}
JSObject* exception = nullptr;
@@ -354,7 +353,7 @@
resultCodeBlock = codeBlock;
EXCEPTION_ASSERT(!!throwScope.exception() == !codeBlock);
if (UNLIKELY(!codeBlock))
- return static_cast<Exception*>(exception);
+ return exception;
if (Options::validateBytecode())
codeBlock->validate();
@@ -365,7 +364,7 @@
setupJIT(vm, codeBlock);
installCode(vm, codeBlock, codeBlock->codeType(), codeBlock->specializationKind());
- return std::nullopt;
+ return nullptr;
}
CodeBlockHash ScriptExecutable::hashFor(CodeSpecializationKind kind) const
Modified: trunk/Source/_javascript_Core/runtime/ScriptExecutable.h (237079 => 237080)
--- trunk/Source/_javascript_Core/runtime/ScriptExecutable.h 2018-10-12 21:32:08 UTC (rev 237079)
+++ trunk/Source/_javascript_Core/runtime/ScriptExecutable.h 2018-10-12 21:42:23 UTC (rev 237080)
@@ -105,11 +105,11 @@
// to point to it. This forces callers to have a CodeBlock* in a register or on the stack that will be marked
// by conservative GC if a GC happens after we create the CodeBlock.
template <typename ExecutableType>
- std::optional<Exception*> prepareForExecution(VM&, JSFunction*, JSScope*, CodeSpecializationKind, CodeBlock*& resultCodeBlock);
+ JSObject* prepareForExecution(VM&, JSFunction*, JSScope*, CodeSpecializationKind, CodeBlock*& resultCodeBlock);
private:
friend class ExecutableBase;
- std::optional<Exception*> prepareForExecutionImpl(VM&, JSFunction*, JSScope*, CodeSpecializationKind, CodeBlock*&);
+ JSObject* prepareForExecutionImpl(VM&, JSFunction*, JSScope*, CodeSpecializationKind, CodeBlock*&);
protected:
ScriptExecutable(Structure*, VM&, const SourceCode&, bool isInStrictContext, DerivedContextType, bool isInArrowFunctionContext, EvalContextType, Intrinsic);
Modified: trunk/Source/_javascript_Core/tools/JSDollarVM.cpp (237079 => 237080)
--- trunk/Source/_javascript_Core/tools/JSDollarVM.cpp 2018-10-12 21:32:08 UTC (rev 237079)
+++ trunk/Source/_javascript_Core/tools/JSDollarVM.cpp 2018-10-12 21:42:23 UTC (rev 237080)
@@ -1462,7 +1462,7 @@
else
candidateCodeBlock = func->jsExecutable()->eitherCodeBlock();
} else
- candidateCodeBlock = static_cast<CodeBlock*>(value.asCell());
+ candidateCodeBlock = reinterpret_cast<CodeBlock*>(value.asCell());
}
if (candidateCodeBlock && VMInspector::isValidCodeBlock(exec, candidateCodeBlock))
Modified: trunk/Source/bmalloc/ChangeLog (237079 => 237080)
--- trunk/Source/bmalloc/ChangeLog 2018-10-12 21:32:08 UTC (rev 237079)
+++ trunk/Source/bmalloc/ChangeLog 2018-10-12 21:42:23 UTC (rev 237080)
@@ -1,3 +1,16 @@
+2018-10-12 Ryan Haddad <ryanhad...@apple.com>
+
+ Unreviewed, rolling out r237063.
+
+ Caused layout test fast/dom/Window/window-postmessage-clone-
+ deep-array.html to fail on macOS and iOS Debug bots.
+
+ Reverted changeset:
+
+ "[JSC] Remove gcc warnings on mips and armv7"
+ https://bugs.webkit.org/show_bug.cgi?id=188598
+ https://trac.webkit.org/changeset/237063
+
2018-10-11 Guillaume Emont <guijem...@igalia.com>
[JSC] Remove gcc warnings on mips and armv7
Modified: trunk/Source/bmalloc/bmalloc/Algorithm.h (237079 => 237080)
--- trunk/Source/bmalloc/bmalloc/Algorithm.h 2018-10-12 21:32:08 UTC (rev 237079)
+++ trunk/Source/bmalloc/bmalloc/Algorithm.h 2018-10-12 21:42:23 UTC (rev 237080)
@@ -30,7 +30,6 @@
#include <algorithm>
#include <cstdint>
#include <cstddef>
-#include <cstring>
#include <limits>
#include <string.h>
#include <type_traits>
@@ -182,23 +181,6 @@
return false;
}
-// Copied from WTF/wtf/StdLibExtras.h
-template<typename ToType, typename FromType>
-inline ToType bitwise_cast(FromType from)
-{
- static_assert(sizeof(FromType) == sizeof(ToType), "bitwise_cast size of FromType and ToType must be equal!");
-#if defined(__has_feature)
-#if __has_feature(is_trivially_copyable)
- // Not all recent STL implementations support the std::is_trivially_copyable type trait. Work around this by only checking on toolchains which have the equivalent compiler intrinsic.
- static_assert(__is_trivially_copyable(ToType), "bitwise_cast of non-trivially-copyable type!");
- static_assert(__is_trivially_copyable(FromType), "bitwise_cast of non-trivially-copyable type!");
-#endif
-#endif
- typename std::remove_const<ToType>::type to { };
- std::memcpy(static_cast<void*>(&to), static_cast<void*>(&from), sizeof(to));
- return to;
-}
-
} // namespace bmalloc
#endif // Algorithm_h
Modified: trunk/Source/bmalloc/bmalloc/IsoDirectoryPageInlines.h (237079 => 237080)
--- trunk/Source/bmalloc/bmalloc/IsoDirectoryPageInlines.h 2018-10-12 21:32:08 UTC (rev 237079)
+++ trunk/Source/bmalloc/bmalloc/IsoDirectoryPageInlines.h 2018-10-12 21:42:23 UTC (rev 237080)
@@ -39,10 +39,7 @@
template<typename Config>
IsoDirectoryPage<Config>* IsoDirectoryPage<Config>::pageFor(IsoDirectory<Config, numPages>* payload)
{
- // the char* cast is only used to do a pointer calculation, and said
- // calculation results in a pointer to an existing, correctly aligned
- // IsoDirectoryPage.
- return bitwise_cast<IsoDirectoryPage<Config>*>(
+ return reinterpret_cast<IsoDirectoryPage<Config>*>(
reinterpret_cast<char*>(payload) - BOFFSETOF(IsoDirectoryPage, payload));
}
Modified: trunk/Source/bmalloc/bmalloc/IsoPageInlines.h (237079 => 237080)
--- trunk/Source/bmalloc/bmalloc/IsoPageInlines.h 2018-10-12 21:32:08 UTC (rev 237079)
+++ trunk/Source/bmalloc/bmalloc/IsoPageInlines.h 2018-10-12 21:42:23 UTC (rev 237080)
@@ -188,10 +188,7 @@
char* cellByte = reinterpret_cast<char*>(this) + index * Config::objectSize;
if (verbose)
fprintf(stderr, "%p: putting %p on free list.\n", this, cellByte);
-
- static_assert(!(Config::objectSize % alignof(FreeCell)), "Config::objectSize should respect alignment of FreeCell");
- static_assert(!(alignof(IsoPage<Config>) % alignof(FreeCell)), "Alignment of IsoPage<Config> should match that of FreeCell");
- FreeCell* cell = bitwise_cast<FreeCell*>(cellByte);
+ FreeCell* cell = reinterpret_cast<FreeCell*>(cellByte);
cell->setNext(head, secret);
head = cell;
bytes += Config::objectSize;