Skip to content

Commit 887ffcc

Browse files
Unreviewed, rolling out r224863.
Introduced LayoutTest crashes on iOS Simulator. Reverted changeset: "Move JSONValues to WTF and convert uses of InspectorValues.h to JSONValues.h" https://bugs.webkit.org/show_bug.cgi?id=173793 https://trac.webkit.org/changeset/224863 git-svn-id: http://svn.webkit.org/repository/webkit/trunk@224879 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent 4cd8113 commit 887ffcc

File tree

117 files changed

+1490
-1354
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

117 files changed

+1490
-1354
lines changed

Source/JavaScriptCore/ChangeLog

+13
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
2017-11-15 Ryan Haddad <[email protected]>
2+
3+
Unreviewed, rolling out r224863.
4+
5+
Introduced LayoutTest crashes on iOS Simulator.
6+
7+
Reverted changeset:
8+
9+
"Move JSONValues to WTF and convert uses of InspectorValues.h
10+
to JSONValues.h"
11+
https://bugs.webkit.org/show_bug.cgi?id=173793
12+
https://trac.webkit.org/changeset/224863
13+
114
2017-11-14 Mark Lam <[email protected]>
215

316
Gardening: CLoop build fix after r224862.

Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj

+6
Original file line numberDiff line numberDiff line change
@@ -1304,6 +1304,7 @@
13041304
A58C024218E4A41A00032BC5 /* JSContextPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = A58C024118E4A41A00032BC5 /* JSContextPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
13051305
A593CF7D1840360300BFCE27 /* InspectorBackendDispatcher.h in Headers */ = {isa = PBXBuildFile; fileRef = A593CF7B1840360300BFCE27 /* InspectorBackendDispatcher.h */; settings = {ATTRIBUTES = (Private, ); }; };
13061306
A593CF7F1840362C00BFCE27 /* InspectorAgentBase.h in Headers */ = {isa = PBXBuildFile; fileRef = A593CF7E1840362C00BFCE27 /* InspectorAgentBase.h */; settings = {ATTRIBUTES = (Private, ); }; };
1307+
A593CF831840377100BFCE27 /* InspectorValues.h in Headers */ = {isa = PBXBuildFile; fileRef = A593CF811840377100BFCE27 /* InspectorValues.h */; settings = {ATTRIBUTES = (Private, ); }; };
13071308
A593CF87184038CA00BFCE27 /* InspectorAgentRegistry.h in Headers */ = {isa = PBXBuildFile; fileRef = A593CF85184038CA00BFCE27 /* InspectorAgentRegistry.h */; settings = {ATTRIBUTES = (Private, ); }; };
13081309
A59455931824744700CC3843 /* JSGlobalObjectDebuggable.h in Headers */ = {isa = PBXBuildFile; fileRef = A59455911824744700CC3843 /* JSGlobalObjectDebuggable.h */; };
13091310
A5945595182479EB00CC3843 /* InspectorFrontendChannel.h in Headers */ = {isa = PBXBuildFile; fileRef = A5945594182479EB00CC3843 /* InspectorFrontendChannel.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -3927,6 +3928,8 @@
39273928
A593CF7A1840360300BFCE27 /* InspectorBackendDispatcher.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorBackendDispatcher.cpp; sourceTree = "<group>"; };
39283929
A593CF7B1840360300BFCE27 /* InspectorBackendDispatcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorBackendDispatcher.h; sourceTree = "<group>"; };
39293930
A593CF7E1840362C00BFCE27 /* InspectorAgentBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorAgentBase.h; sourceTree = "<group>"; };
3931+
A593CF801840377100BFCE27 /* InspectorValues.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorValues.cpp; sourceTree = "<group>"; };
3932+
A593CF811840377100BFCE27 /* InspectorValues.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorValues.h; sourceTree = "<group>"; };
39303933
A593CF84184038CA00BFCE27 /* InspectorAgentRegistry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorAgentRegistry.cpp; sourceTree = "<group>"; };
39313934
A593CF85184038CA00BFCE27 /* InspectorAgentRegistry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorAgentRegistry.h; sourceTree = "<group>"; };
39323935
A594558E18245EDE00CC3843 /* RemoteInspectionTarget.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RemoteInspectionTarget.cpp; sourceTree = "<group>"; };
@@ -7664,6 +7667,8 @@
76647667
99F1A6FC1B8E6D9400463B26 /* InspectorFrontendRouter.cpp */,
76657668
99F1A7001B98FBEC00463B26 /* InspectorFrontendRouter.h */,
76667669
A55D93AB18514F7900400DED /* InspectorProtocolTypes.h */,
7670+
A593CF801840377100BFCE27 /* InspectorValues.cpp */,
7671+
A593CF811840377100BFCE27 /* InspectorValues.h */,
76677672
A503FA13188E0FAF00110F14 /* JavaScriptCallFrame.cpp */,
76687673
A503FA14188E0FAF00110F14 /* JavaScriptCallFrame.h */,
76697674
A5C3A1A318C0490200C9593A /* JSGlobalObjectConsoleClient.cpp */,
@@ -8665,6 +8670,7 @@
86658670
A55D93AC18514F7900400DED /* InspectorProtocolTypes.h in Headers */,
86668671
A50E4B6218809DD50068A46D /* InspectorRuntimeAgent.h in Headers */,
86678672
A55165D31BDF0B9E003B75C1 /* InspectorScriptProfilerAgent.h in Headers */,
8673+
A593CF831840377100BFCE27 /* InspectorValues.h in Headers */,
86688674
969A07990ED1D3AE00F1F681 /* Instruction.h in Headers */,
86698675
A7A8AF3B17ADB5F3005AB174 /* Int16Array.h in Headers */,
86708676
A7A8AF3C17ADB5F3005AB174 /* Int32Array.h in Headers */,

Source/JavaScriptCore/Sources.txt

+1
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,7 @@ inspector/InjectedScriptModule.cpp
530530
inspector/InspectorAgentRegistry.cpp
531531
inspector/InspectorFrontendRouter.cpp
532532
inspector/InspectorBackendDispatcher.cpp
533+
inspector/InspectorValues.cpp
533534
inspector/JSGlobalObjectConsoleClient.cpp
534535
inspector/JSGlobalObjectInspectorController.cpp
535536
inspector/JSGlobalObjectScriptDebugServer.cpp

Source/JavaScriptCore/bindings/ScriptValue.cpp

+13-13
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,16 @@
3232

3333
#include "APICast.h"
3434
#include "CatchScope.h"
35+
#include "InspectorValues.h"
3536
#include "JSCInlines.h"
3637
#include "JSLock.h"
37-
#include <wtf/JSONValues.h>
3838

3939
using namespace JSC;
4040
using namespace Inspector;
4141

4242
namespace Inspector {
4343

44-
static RefPtr<JSON::Value> jsToInspectorValue(ExecState& scriptState, JSValue value, int maxDepth)
44+
static RefPtr<InspectorValue> jsToInspectorValue(ExecState& scriptState, JSValue value, int maxDepth)
4545
{
4646
if (!value) {
4747
ASSERT_NOT_REACHED();
@@ -54,19 +54,19 @@ static RefPtr<JSON::Value> jsToInspectorValue(ExecState& scriptState, JSValue va
5454
maxDepth--;
5555

5656
if (value.isUndefinedOrNull())
57-
return JSON::Value::null();
57+
return InspectorValue::null();
5858
if (value.isBoolean())
59-
return JSON::Value::create(value.asBoolean());
59+
return InspectorValue::create(value.asBoolean());
6060
if (value.isNumber() && value.isDouble())
61-
return JSON::Value::create(value.asNumber());
61+
return InspectorValue::create(value.asNumber());
6262
if (value.isNumber() && value.isAnyInt())
63-
return JSON::Value::create(static_cast<int>(value.asAnyInt()));
63+
return InspectorValue::create(static_cast<int>(value.asAnyInt()));
6464
if (value.isString())
65-
return JSON::Value::create(asString(value)->value(&scriptState));
65+
return InspectorValue::create(asString(value)->value(&scriptState));
6666

6767
if (value.isObject()) {
6868
if (isJSArray(value)) {
69-
auto inspectorArray = JSON::Array::create();
69+
auto inspectorArray = InspectorArray::create();
7070
auto& array = *asArray(value);
7171
unsigned length = array.length();
7272
for (unsigned i = 0; i < length; i++) {
@@ -77,7 +77,7 @@ static RefPtr<JSON::Value> jsToInspectorValue(ExecState& scriptState, JSValue va
7777
}
7878
return WTFMove(inspectorArray);
7979
}
80-
auto inspectorObject = JSON::Object::create();
80+
auto inspectorObject = InspectorObject::create();
8181
auto& object = *value.getObject();
8282
PropertyNameArray propertyNames(&scriptState.vm(), PropertyNameMode::Strings, PrivateSymbolMode::Exclude);
8383
object.methodTable()->getOwnPropertyNames(&object, &scriptState, propertyNames, EnumerationMode());
@@ -94,12 +94,12 @@ static RefPtr<JSON::Value> jsToInspectorValue(ExecState& scriptState, JSValue va
9494
return nullptr;
9595
}
9696

97-
RefPtr<JSON::Value> toInspectorValue(ExecState& state, JSValue value)
97+
RefPtr<InspectorValue> toInspectorValue(ExecState& state, JSValue value)
9898
{
9999
// FIXME: Maybe we should move the JSLockHolder stuff to the callers since this function takes a JSValue directly.
100100
// Doing the locking here made sense when we were trying to abstract the difference between multiple JavaScript engines.
101101
JSLockHolder holder(&state);
102-
return jsToInspectorValue(state, value, JSON::Value::maxDepth);
102+
return jsToInspectorValue(state, value, InspectorValue::maxDepth);
103103
}
104104

105105
} // namespace Inspector
@@ -166,10 +166,10 @@ bool ScriptValue::isFunction() const
166166
return getCallData(m_value.get(), callData) != CallType::None;
167167
}
168168

169-
RefPtr<JSON::Value> ScriptValue::toInspectorValue(ExecState* scriptState) const
169+
RefPtr<InspectorValue> ScriptValue::toInspectorValue(ExecState* scriptState) const
170170
{
171171
JSLockHolder holder(scriptState);
172-
return jsToInspectorValue(*scriptState, m_value.get(), JSON::Value::maxDepth);
172+
return jsToInspectorValue(*scriptState, m_value.get(), InspectorValue::maxDepth);
173173
}
174174

175175
} // namespace Deprecated

Source/JavaScriptCore/bindings/ScriptValue.h

+6-6
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@
3737
#include "StrongInlines.h"
3838
#include <wtf/text/WTFString.h>
3939

40-
namespace JSON {
41-
class Value;
42-
}
43-
4440
namespace Inspector {
45-
JS_EXPORT_PRIVATE RefPtr<JSON::Value> toInspectorValue(JSC::ExecState&, JSC::JSValue);
41+
42+
class InspectorValue;
43+
44+
JS_EXPORT_PRIVATE RefPtr<InspectorValue> toInspectorValue(JSC::ExecState&, JSC::JSValue);
45+
4646
}
4747

4848
namespace Deprecated {
@@ -68,7 +68,7 @@ class JS_EXPORT_PRIVATE ScriptValue {
6868

6969
bool operator==(const ScriptValue& other) const { return m_value == other.m_value; }
7070

71-
RefPtr<JSON::Value> toInspectorValue(JSC::ExecState*) const;
71+
RefPtr<Inspector::InspectorValue> toInspectorValue(JSC::ExecState*) const;
7272

7373
private:
7474
JSC::Strong<JSC::Unknown> m_value;

Source/JavaScriptCore/inspector/AsyncStackTrace.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include "config.h"
2727
#include "AsyncStackTrace.h"
2828

29+
#include "InspectorValues.h"
2930
#include "ScriptCallStack.h"
3031

3132
namespace Inspector {

Source/JavaScriptCore/inspector/ConsoleMessage.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
#include "InjectedScript.h"
3636
#include "InjectedScriptManager.h"
3737
#include "InspectorFrontendDispatchers.h"
38+
#include "InspectorValues.h"
3839
#include "ScriptArguments.h"
3940
#include "ScriptCallFrame.h"
4041
#include "ScriptCallStack.h"

Source/JavaScriptCore/inspector/ContentSearchUtilities.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include "config.h"
3030
#include "ContentSearchUtilities.h"
3131

32+
#include "InspectorValues.h"
3233
#include "RegularExpression.h"
3334
#include "Yarr.h"
3435
#include "YarrInterpreter.h"

Source/JavaScriptCore/inspector/InjectedScript.cpp

+26-26
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@
3232
#include "config.h"
3333
#include "InjectedScript.h"
3434

35+
#include "InspectorValues.h"
3536
#include "JSCInlines.h"
3637
#include "ScriptFunctionCall.h"
3738
#include "ScriptObject.h"
38-
#include <wtf/JSONValues.h>
3939
#include <wtf/text/WTFString.h>
4040

4141
using Inspector::Protocol::Array;
@@ -98,9 +98,9 @@ void InjectedScript::getFunctionDetails(ErrorString& errorString, const String&
9898
Deprecated::ScriptFunctionCall function(injectedScriptObject(), ASCIILiteral("getFunctionDetails"), inspectorEnvironment()->functionCallHandler());
9999
function.appendArgument(functionId);
100100

101-
RefPtr<JSON::Value> resultValue;
101+
RefPtr<InspectorValue> resultValue;
102102
makeCall(function, &resultValue);
103-
if (!resultValue || resultValue->type() != JSON::Value::Type::Object) {
103+
if (!resultValue || resultValue->type() != InspectorValue::Type::Object) {
104104
if (!resultValue->asString(errorString))
105105
errorString = ASCIILiteral("Internal error");
106106
return;
@@ -114,9 +114,9 @@ void InjectedScript::functionDetails(ErrorString& errorString, JSC::JSValue valu
114114
Deprecated::ScriptFunctionCall function(injectedScriptObject(), ASCIILiteral("functionDetails"), inspectorEnvironment()->functionCallHandler());
115115
function.appendArgument(value);
116116

117-
RefPtr<JSON::Value> resultValue;
117+
RefPtr<InspectorValue> resultValue;
118118
makeCall(function, &resultValue);
119-
if (!resultValue || resultValue->type() != JSON::Value::Type::Object) {
119+
if (!resultValue || resultValue->type() != InspectorValue::Type::Object) {
120120
if (!resultValue->asString(errorString))
121121
errorString = ASCIILiteral("Internal error");
122122
return;
@@ -130,9 +130,9 @@ void InjectedScript::getPreview(ErrorString& errorString, const String& objectId
130130
Deprecated::ScriptFunctionCall function(injectedScriptObject(), ASCIILiteral("getPreview"), inspectorEnvironment()->functionCallHandler());
131131
function.appendArgument(objectId);
132132

133-
RefPtr<JSON::Value> resultValue;
133+
RefPtr<InspectorValue> resultValue;
134134
makeCall(function, &resultValue);
135-
if (!resultValue || resultValue->type() != JSON::Value::Type::Object) {
135+
if (!resultValue || resultValue->type() != InspectorValue::Type::Object) {
136136
if (!resultValue->asString(errorString))
137137
errorString = ASCIILiteral("Internal error");
138138
return;
@@ -148,9 +148,9 @@ void InjectedScript::getProperties(ErrorString& errorString, const String& objec
148148
function.appendArgument(ownProperties);
149149
function.appendArgument(generatePreview);
150150

151-
RefPtr<JSON::Value> result;
151+
RefPtr<InspectorValue> result;
152152
makeCall(function, &result);
153-
if (!result || result->type() != JSON::Value::Type::Array) {
153+
if (!result || result->type() != InspectorValue::Type::Array) {
154154
errorString = ASCIILiteral("Internal error");
155155
return;
156156
}
@@ -164,9 +164,9 @@ void InjectedScript::getDisplayableProperties(ErrorString& errorString, const St
164164
function.appendArgument(objectId);
165165
function.appendArgument(generatePreview);
166166

167-
RefPtr<JSON::Value> result;
167+
RefPtr<InspectorValue> result;
168168
makeCall(function, &result);
169-
if (!result || result->type() != JSON::Value::Type::Array) {
169+
if (!result || result->type() != InspectorValue::Type::Array) {
170170
errorString = ASCIILiteral("Internal error");
171171
return;
172172
}
@@ -180,9 +180,9 @@ void InjectedScript::getInternalProperties(ErrorString& errorString, const Strin
180180
function.appendArgument(objectId);
181181
function.appendArgument(generatePreview);
182182

183-
RefPtr<JSON::Value> result;
183+
RefPtr<InspectorValue> result;
184184
makeCall(function, &result);
185-
if (!result || result->type() != JSON::Value::Type::Array) {
185+
if (!result || result->type() != InspectorValue::Type::Array) {
186186
errorString = ASCIILiteral("Internal error");
187187
return;
188188
}
@@ -199,9 +199,9 @@ void InjectedScript::getCollectionEntries(ErrorString& errorString, const String
199199
function.appendArgument(startIndex);
200200
function.appendArgument(numberToFetch);
201201

202-
RefPtr<JSON::Value> result;
202+
RefPtr<InspectorValue> result;
203203
makeCall(function, &result);
204-
if (!result || result->type() != JSON::Value::Type::Array) {
204+
if (!result || result->type() != InspectorValue::Type::Array) {
205205
errorString = ASCIILiteral("Internal error");
206206
return;
207207
}
@@ -214,9 +214,9 @@ void InjectedScript::saveResult(ErrorString& errorString, const String& callArgu
214214
Deprecated::ScriptFunctionCall function(injectedScriptObject(), ASCIILiteral("saveResult"), inspectorEnvironment()->functionCallHandler());
215215
function.appendArgument(callArgumentJSON);
216216

217-
RefPtr<JSON::Value> result;
217+
RefPtr<InspectorValue> result;
218218
makeCall(function, &result);
219-
if (!result || result->type() != JSON::Value::Type::Integer) {
219+
if (!result || result->type() != InspectorValue::Type::Integer) {
220220
errorString = ASCIILiteral("Internal error");
221221
return;
222222
}
@@ -237,8 +237,8 @@ Ref<Array<Inspector::Protocol::Debugger::CallFrame>> InjectedScript::wrapCallFra
237237
if (!callFramesValue)
238238
return Array<Inspector::Protocol::Debugger::CallFrame>::create();
239239
ASSERT(!hadException);
240-
RefPtr<JSON::Value> result = toInspectorValue(*scriptState(), callFramesValue);
241-
if (result->type() == JSON::Value::Type::Array)
240+
RefPtr<InspectorValue> result = toInspectorValue(*scriptState(), callFramesValue);
241+
if (result->type() == InspectorValue::Type::Array)
242242
return BindingTraits<Array<Inspector::Protocol::Debugger::CallFrame>>::runtimeCast(WTFMove(result)).releaseNonNull();
243243

244244
return Array<Inspector::Protocol::Debugger::CallFrame>::create();
@@ -258,7 +258,7 @@ RefPtr<Inspector::Protocol::Runtime::RemoteObject> InjectedScript::wrapObject(JS
258258
if (hadException)
259259
return nullptr;
260260

261-
RefPtr<JSON::Object> resultObject;
261+
RefPtr<InspectorObject> resultObject;
262262
bool castSucceeded = toInspectorValue(*scriptState(), r)->asObject(resultObject);
263263
ASSERT_UNUSED(castSucceeded, castSucceeded);
264264

@@ -281,7 +281,7 @@ RefPtr<Inspector::Protocol::Runtime::RemoteObject> InjectedScript::wrapTable(JSC
281281
if (hadException)
282282
return nullptr;
283283

284-
RefPtr<JSON::Object> resultObject;
284+
RefPtr<InspectorObject> resultObject;
285285
bool castSucceeded = toInspectorValue(*scriptState(), r)->asObject(resultObject);
286286
ASSERT_UNUSED(castSucceeded, castSucceeded);
287287

@@ -299,7 +299,7 @@ RefPtr<Inspector::Protocol::Runtime::ObjectPreview> InjectedScript::previewValue
299299
if (hadException)
300300
return nullptr;
301301

302-
RefPtr<JSON::Object> resultObject;
302+
RefPtr<InspectorObject> resultObject;
303303
bool castSucceeded = toInspectorValue(*scriptState(), r)->asObject(resultObject);
304304
ASSERT_UNUSED(castSucceeded, castSucceeded);
305305

@@ -311,15 +311,15 @@ void InjectedScript::setExceptionValue(JSC::JSValue value)
311311
ASSERT(!hasNoValue());
312312
Deprecated::ScriptFunctionCall function(injectedScriptObject(), ASCIILiteral("setExceptionValue"), inspectorEnvironment()->functionCallHandler());
313313
function.appendArgument(value);
314-
RefPtr<JSON::Value> result;
314+
RefPtr<InspectorValue> result;
315315
makeCall(function, &result);
316316
}
317317

318318
void InjectedScript::clearExceptionValue()
319319
{
320320
ASSERT(!hasNoValue());
321321
Deprecated::ScriptFunctionCall function(injectedScriptObject(), ASCIILiteral("clearExceptionValue"), inspectorEnvironment()->functionCallHandler());
322-
RefPtr<JSON::Value> result;
322+
RefPtr<InspectorValue> result;
323323
makeCall(function, &result);
324324
}
325325

@@ -341,15 +341,15 @@ void InjectedScript::inspectObject(JSC::JSValue value)
341341
ASSERT(!hasNoValue());
342342
Deprecated::ScriptFunctionCall function(injectedScriptObject(), ASCIILiteral("inspectObject"), inspectorEnvironment()->functionCallHandler());
343343
function.appendArgument(value);
344-
RefPtr<JSON::Value> result;
344+
RefPtr<InspectorValue> result;
345345
makeCall(function, &result);
346346
}
347347

348348
void InjectedScript::releaseObject(const String& objectId)
349349
{
350350
Deprecated::ScriptFunctionCall function(injectedScriptObject(), ASCIILiteral("releaseObject"), inspectorEnvironment()->functionCallHandler());
351351
function.appendArgument(objectId);
352-
RefPtr<JSON::Value> result;
352+
RefPtr<InspectorValue> result;
353353
makeCall(function, &result);
354354
}
355355

0 commit comments

Comments
 (0)