Skip to content

Commit 55185ca

Browse files
committed
Demarcate code added due to lack of NSDMI for aggregates
https://bugs.webkit.org/show_bug.cgi?id=175990 Reviewed by Andy Estes. Source/bmalloc: * bmalloc/BPlatform.h: * bmalloc/List.h: Be explicit when initializing m_node to improve readability. (bmalloc::ListNode::ListNode): Source/JavaScriptCore: * domjit/DOMJITEffect.h: (JSC::DOMJIT::Effect::Effect): (JSC::DOMJIT::Effect::forWrite): (JSC::DOMJIT::Effect::forRead): (JSC::DOMJIT::Effect::forReadWrite): (JSC::DOMJIT::Effect::forPure): (JSC::DOMJIT::Effect::forDef): * runtime/HasOwnPropertyCache.h: (JSC::HasOwnPropertyCache::Entry::Entry): (JSC::HasOwnPropertyCache::Entry::operator=): Deleted. * wasm/WasmFormat.h: Modernize some of the code while I am here. Also make some comments read well. (JSC::Wasm::CallableFunction::CallableFunction): * wasm/js/WebAssemblyFunction.cpp: (JSC::WebAssemblyFunction::WebAssemblyFunction): * wasm/js/WebAssemblyWrapperFunction.cpp: (JSC::WebAssemblyWrapperFunction::create): Source/WebCore: * html/canvas/CanvasStyle.h: * platform/mediastream/IceCandidate.h: (WebCore::IceCandidate::IceCandidate): * platform/text/StringWithDirection.h: Replace const String& and String&& constructor overloads with a single user-defined constructor that takes a String by value to handle both cases. (WebCore::StringWithDirection::StringWithDirection): (WebCore::truncateFromEnd): * style/StyleUpdate.h: (WebCore::Style::ElementUpdate::ElementUpdate): (WebCore::Style::TextUpdate::TextUpdate): Source/WTF: * wtf/Compiler.h: Canonical link: https://commits.webkit.org/192660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@221213 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent 264d6b0 commit 55185ca

16 files changed

Lines changed: 169 additions & 72 deletions

File tree

‎Source/JavaScriptCore/ChangeLog‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,28 @@
1+
2017-08-25 Daniel Bates <dabates@apple.com>
2+
3+
Demarcate code added due to lack of NSDMI for aggregates
4+
https://bugs.webkit.org/show_bug.cgi?id=175990
5+
6+
Reviewed by Andy Estes.
7+
8+
* domjit/DOMJITEffect.h:
9+
(JSC::DOMJIT::Effect::Effect):
10+
(JSC::DOMJIT::Effect::forWrite):
11+
(JSC::DOMJIT::Effect::forRead):
12+
(JSC::DOMJIT::Effect::forReadWrite):
13+
(JSC::DOMJIT::Effect::forPure):
14+
(JSC::DOMJIT::Effect::forDef):
15+
* runtime/HasOwnPropertyCache.h:
16+
(JSC::HasOwnPropertyCache::Entry::Entry):
17+
(JSC::HasOwnPropertyCache::Entry::operator=): Deleted.
18+
* wasm/WasmFormat.h: Modernize some of the code while I am here. Also
19+
make some comments read well.
20+
(JSC::Wasm::CallableFunction::CallableFunction):
21+
* wasm/js/WebAssemblyFunction.cpp:
22+
(JSC::WebAssemblyFunction::WebAssemblyFunction):
23+
* wasm/js/WebAssemblyWrapperFunction.cpp:
24+
(JSC::WebAssemblyWrapperFunction::create):
25+
126
2017-08-25 Saam Barati <sbarati@apple.com>
227

328
Unreviewed. Fix 32-bit after r221196

‎Source/JavaScriptCore/domjit/DOMJITEffect.h‎

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -29,60 +29,60 @@
2929

3030
namespace JSC { namespace DOMJIT {
3131

32-
class Effect {
33-
public:
34-
HeapRange reads { HeapRange::top() };
35-
HeapRange writes { HeapRange::top() };
36-
HeapRange def { HeapRange::top() };
37-
32+
struct Effect {
33+
#if !COMPILER_SUPPORTS(NSDMI_FOR_AGGREGATES)
3834
constexpr Effect() = default;
3935
constexpr Effect(HeapRange reads, HeapRange writes)
40-
: reads(reads)
41-
, writes(writes)
36+
: reads { reads }
37+
, writes { writes }
4238
{
4339
}
44-
4540
constexpr Effect(HeapRange reads, HeapRange writes, HeapRange def)
46-
: reads(reads)
47-
, writes(writes)
48-
, def(def)
41+
: reads { reads }
42+
, writes { writes }
43+
, def { def }
4944
{
5045
}
46+
#endif
5147

5248
constexpr static Effect forWrite(HeapRange writeRange)
5349
{
54-
return Effect(HeapRange::none(), writeRange);
50+
return { HeapRange::none(), writeRange };
5551
}
5652

5753
constexpr static Effect forRead(HeapRange readRange)
5854
{
59-
return Effect(readRange, HeapRange::none());
55+
return { readRange, HeapRange::none() };
6056
}
6157

6258
constexpr static Effect forReadWrite(HeapRange readRange, HeapRange writeRange)
6359
{
64-
return Effect(readRange, writeRange);
60+
return { readRange, writeRange };
6561
}
6662

6763
constexpr static Effect forPure()
6864
{
69-
return Effect(HeapRange::none(), HeapRange::none(), HeapRange::none());
65+
return { HeapRange::none(), HeapRange::none(), HeapRange::none() };
7066
}
7167

7268
constexpr static Effect forDef(HeapRange def)
7369
{
74-
return Effect(def, HeapRange::none(), def);
70+
return { def, HeapRange::none(), def };
7571
}
7672

7773
constexpr static Effect forDef(HeapRange def, HeapRange readRange, HeapRange writeRange)
7874
{
79-
return Effect(readRange, writeRange, def);
75+
return { readRange, writeRange, def };
8076
}
8177

8278
constexpr bool mustGenerate() const
8379
{
8480
return !!writes;
8581
}
82+
83+
HeapRange reads { HeapRange::top() };
84+
HeapRange writes { HeapRange::top() };
85+
HeapRange def { HeapRange::top() };
8686
};
8787

8888
} }

‎Source/JavaScriptCore/runtime/HasOwnPropertyCache.h‎

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -42,23 +42,19 @@ class HasOwnPropertyCache {
4242
static ptrdiff_t offsetOfImpl() { return OBJECT_OFFSETOF(Entry, impl); }
4343
static ptrdiff_t offsetOfResult() { return OBJECT_OFFSETOF(Entry, result); }
4444

45+
#if !COMPILER_SUPPORTS(NSDMI_FOR_AGGREGATES)
4546
Entry() = default;
46-
4747
Entry(RefPtr<UniquedStringImpl>&& impl, StructureID structureID, bool result)
48-
: impl(WTFMove(impl))
49-
, structureID(structureID)
50-
, result(result)
51-
{ }
52-
53-
Entry& operator=(Entry&& other)
48+
: impl { WTFMove(impl) }
49+
, structureID { structureID }
50+
, result { result }
5451
{
55-
impl = WTFMove(other.impl);
56-
structureID = other.structureID;
57-
result = other.result;
58-
return *this;
5952
}
6053

61-
RefPtr<UniquedStringImpl> impl { };
54+
Entry& operator=(Entry&& other) = default;
55+
#endif
56+
57+
RefPtr<UniquedStringImpl> impl;
6258
StructureID structureID { 0 };
6359
bool result { false };
6460
};

‎Source/JavaScriptCore/wasm/WasmFormat.h‎

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -282,26 +282,28 @@ struct WasmExitStubs {
282282
MacroAssemblerCodeRef wasmToWasm;
283283
};
284284

285-
typedef void** WasmEntrypointLoadLocation;
285+
using WasmEntrypointLoadLocation = void**;
286286

287-
// WebAssembly direct calls and call_indirect use indices into "function index space". This space starts with all imports, and then all internal functions.
288-
// CallableFunction and FunctionIndexSpace are only meant as fast lookup tables for these opcodes, and do not own code.
287+
// WebAssembly direct calls and call_indirect use indices into "function index space". This space starts
288+
// with all imports, and then all internal functions. CallableFunction and FunctionIndexSpace are only
289+
// meant as fast lookup tables for these opcodes and do not own code.
289290
struct CallableFunction {
291+
#if !COMPILER_SUPPORTS(NSDMI_FOR_AGGREGATES)
290292
CallableFunction() = default;
291-
292293
CallableFunction(SignatureIndex signatureIndex, WasmEntrypointLoadLocation code = nullptr)
293-
: signatureIndex(signatureIndex)
294-
, code(code)
294+
: signatureIndex { signatureIndex }
295+
, code { code }
295296
{
296297
}
298+
#endif
297299

298300
static ptrdiff_t offsetOfWasmEntrypointLoadLocation() { return OBJECT_OFFSETOF(CallableFunction, code); }
299301

300-
// FIXME pack the SignatureIndex and the code pointer into one 64-bit value. https://bugs.webkit.org/show_bug.cgi?id=165511
302+
// FIXME: Pack signature index and code pointer into one 64-bit value. See <https://bugs.webkit.org/show_bug.cgi?id=165511>.
301303
SignatureIndex signatureIndex { Signature::invalidIndex };
302304
WasmEntrypointLoadLocation code { nullptr };
303305
};
304-
typedef Vector<CallableFunction> FunctionIndexSpace;
306+
using FunctionIndexSpace = Vector<CallableFunction>;
305307

306308
} } // namespace JSC::Wasm
307309

‎Source/JavaScriptCore/wasm/js/WebAssemblyFunction.cpp‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,9 @@ Structure* WebAssemblyFunction::createStructure(VM& vm, JSGlobalObject* globalOb
190190
}
191191

192192
WebAssemblyFunction::WebAssemblyFunction(VM& vm, JSGlobalObject* globalObject, Structure* structure, Wasm::Callee& jsEntrypoint, Wasm::WasmEntrypointLoadLocation wasmEntrypoint, Wasm::SignatureIndex signatureIndex)
193-
: Base(vm, globalObject, structure)
194-
, m_jsEntrypoint(jsEntrypoint.entrypoint())
195-
, m_wasmFunction(Wasm::CallableFunction(signatureIndex, wasmEntrypoint))
193+
: Base { vm, globalObject, structure }
194+
, m_jsEntrypoint { jsEntrypoint.entrypoint() }
195+
, m_wasmFunction { signatureIndex, wasmEntrypoint }
196196
{ }
197197

198198
} // namespace JSC

‎Source/JavaScriptCore/wasm/js/WebAssemblyWrapperFunction.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ WebAssemblyWrapperFunction* WebAssemblyWrapperFunction::create(VM& vm, JSGlobalO
6363
ASSERT_WITH_MESSAGE(!function->inherits(vm, WebAssemblyWrapperFunction::info()), "We should never double wrap a wrapper function.");
6464
String name = "";
6565
NativeExecutable* executable = vm.getHostFunction(callWebAssemblyWrapperFunction, NoIntrinsic, callHostFunctionAsConstructor, nullptr, name);
66-
WebAssemblyWrapperFunction* result = new (NotNull, allocateCell<WebAssemblyWrapperFunction>(vm.heap)) WebAssemblyWrapperFunction(vm, globalObject, globalObject->webAssemblyWrapperFunctionStructure(), Wasm::CallableFunction(signatureIndex, instance->codeBlock()->wasmToJsCallStubForImport(importIndex)));
66+
WebAssemblyWrapperFunction* result = new (NotNull, allocateCell<WebAssemblyWrapperFunction>(vm.heap)) WebAssemblyWrapperFunction(vm, globalObject, globalObject->webAssemblyWrapperFunctionStructure(), { signatureIndex, instance->codeBlock()->wasmToJsCallStubForImport(importIndex) });
6767
const Wasm::Signature& signature = Wasm::SignatureInformation::get(signatureIndex);
6868
result->finishCreation(vm, executable, signature.argumentCount(), name, function, instance);
6969
return result;

‎Source/WTF/ChangeLog‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
2017-08-25 Daniel Bates <dabates@apple.com>
2+
3+
Demarcate code added due to lack of NSDMI for aggregates
4+
https://bugs.webkit.org/show_bug.cgi?id=175990
5+
6+
Reviewed by Andy Estes.
7+
8+
* wtf/Compiler.h:
9+
110
2017-08-25 Don Olmstead <don.olmstead@sony.com>
211

312
Define *_GIGACAGE_MASK when Gigacage is not supported

‎Source/WTF/wtf/Compiler.h‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,12 @@
150150
#define WTF_COMPILER_SUPPORTS_EABI 1
151151
#endif
152152

153+
/* Non-static data member initializer (NSDMI) for aggregates */
154+
155+
#if defined(__cpp_aggregate_nsdmi) && __cpp_aggregate_nsdmi >= 201304
156+
#define WTF_COMPILER_SUPPORTS_NSDMI_FOR_AGGREGATES 1
157+
#endif
158+
153159
/* RELAXED_CONSTEXPR */
154160

155161
#if defined(__cpp_constexpr) && __cpp_constexpr >= 201304

‎Source/WebCore/ChangeLog‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
2017-08-25 Daniel Bates <dabates@apple.com>
2+
3+
Demarcate code added due to lack of NSDMI for aggregates
4+
https://bugs.webkit.org/show_bug.cgi?id=175990
5+
6+
Reviewed by Andy Estes.
7+
8+
* html/canvas/CanvasStyle.h:
9+
* platform/mediastream/IceCandidate.h:
10+
(WebCore::IceCandidate::IceCandidate):
11+
* platform/text/StringWithDirection.h: Replace const String& and String&& constructor
12+
overloads with a single user-defined constructor that takes a String by value to handle
13+
both cases.
14+
(WebCore::StringWithDirection::StringWithDirection):
15+
(WebCore::truncateFromEnd):
16+
* style/StyleUpdate.h:
17+
(WebCore::Style::ElementUpdate::ElementUpdate):
18+
(WebCore::Style::TextUpdate::TextUpdate):
19+
120
2017-08-25 Daniel Bates <dabates@apple.com>
221

322
InlineTextBox::paintDocumentMarker() does not need to special case painting of grammar and

‎Source/WebCore/html/canvas/CanvasStyle.h‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,13 @@ class CanvasStyle {
7070
struct Invalid { };
7171

7272
struct CMYKAColor {
73+
#if !COMPILER_SUPPORTS(NSDMI_FOR_AGGREGATES)
7374
CMYKAColor() = default;
74-
7575
CMYKAColor(Color color, float cyan, float magenta, float yellow, float black, float alpha)
7676
: color(color), c(cyan), m(magenta), y(yellow), k(black), a(alpha)
7777
{
7878
}
79+
#endif
7980

8081
Color color;
8182
float c { 0 };

0 commit comments

Comments
 (0)