Skip to content

Commit ce7904e

Browse files
Unreviewed, rolling out r173245.
https://bugs.webkit.org/show_bug.cgi?id=136533 Broke JSC tests. (Requested by ddkilzer on #webkit). Reverted changeset: "JavaScriptCore should build with newer clang" https://bugs.webkit.org/show_bug.cgi?id=136002 http://trac.webkit.org/changeset/173245 Canonical link: https://commits.webkit.org/154327@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@173263 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent 8aa82ad commit ce7904e

11 files changed

Lines changed: 46 additions & 15 deletions

File tree

Source/JavaScriptCore/API/JSBase.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ JSValueRef JSEvaluateScript(JSContextRef ctx, JSStringRef script, JSObjectRef th
6060

6161
// evaluate sets "this" to the global object if it is NULL
6262
JSGlobalObject* globalObject = exec->vmEntryGlobalObject();
63-
SourceCode source = makeSource(script ? script->string() : String(), sourceURL ? sourceURL->string() : String(), TextPosition(OrdinalNumber::fromOneBasedInt(startingLineNumber), OrdinalNumber::first()));
63+
SourceCode source = makeSource(script->string(), sourceURL->string(), TextPosition(OrdinalNumber::fromOneBasedInt(startingLineNumber), OrdinalNumber::first()));
6464

6565
JSValue evaluationException;
6666
JSValue returnValue = evaluate(globalObject->globalExec(), source, jsThisObject, &evaluationException);

Source/JavaScriptCore/API/JSScriptRef.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ JSScriptRef JSScriptCreateReferencingImmortalASCIIText(JSContextGroupRef context
8484

8585
startingLineNumber = std::max(1, startingLineNumber);
8686

87-
RefPtr<OpaqueJSScript> result = OpaqueJSScript::create(vm, url ? url->string() : String(), startingLineNumber, String(StringImpl::createFromLiteral(source, length)));
87+
RefPtr<OpaqueJSScript> result = OpaqueJSScript::create(vm, url->string(), startingLineNumber, String(StringImpl::createFromLiteral(source, length)));
8888

8989
ParserError error;
9090
if (!parseScript(vm, SourceCode(result), error)) {

Source/JavaScriptCore/API/JSStringRef.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,11 @@ void JSStringRelease(JSStringRef string)
7878

7979
size_t JSStringGetLength(JSStringRef string)
8080
{
81-
if (!string)
82-
return 0;
8381
return string->length();
8482
}
8583

8684
const JSChar* JSStringGetCharactersPtr(JSStringRef string)
8785
{
88-
if (!string)
89-
return nullptr;
9086
return string->characters();
9187
}
9288

@@ -98,7 +94,7 @@ size_t JSStringGetMaximumUTF8CStringSize(JSStringRef string)
9894

9995
size_t JSStringGetUTF8CString(JSStringRef string, char* buffer, size_t bufferSize)
10096
{
101-
if (!string || !buffer || !bufferSize)
97+
if (!bufferSize)
10298
return 0;
10399

104100
char* destination = buffer;

Source/JavaScriptCore/API/JSStringRefCF.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ JSStringRef JSStringCreateWithCFString(CFStringRef string)
5757

5858
CFStringRef JSStringCopyCFString(CFAllocatorRef allocator, JSStringRef string)
5959
{
60-
if (!string || !string->length())
60+
if (!string->length())
6161
return CFSTR("");
6262

6363
if (string->is8Bit())

Source/JavaScriptCore/API/JSValueRef.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ JSValueRef JSValueMakeString(JSContextRef ctx, JSStringRef string)
318318
ExecState* exec = toJS(ctx);
319319
JSLockHolder locker(exec);
320320

321-
return toRef(exec, jsString(exec, string ? string->string() : String()));
321+
return toRef(exec, jsString(exec, string->string()));
322322
}
323323

324324
JSValueRef JSValueMakeFromJSONString(JSContextRef ctx, JSStringRef string)

Source/JavaScriptCore/API/OpaqueJSString.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,16 @@ OpaqueJSString::~OpaqueJSString()
5656

5757
String OpaqueJSString::string() const
5858
{
59+
if (!this)
60+
return String();
61+
5962
// Return a copy of the wrapped string, because the caller may make it an Identifier.
6063
return m_string.isolatedCopy();
6164
}
6265

6366
Identifier OpaqueJSString::identifier(VM* vm) const
6467
{
65-
if (m_string.isNull())
68+
if (!this || m_string.isNull())
6669
return Identifier();
6770

6871
if (m_string.isEmpty())
@@ -76,6 +79,9 @@ Identifier OpaqueJSString::identifier(VM* vm) const
7679

7780
const UChar* OpaqueJSString::characters()
7881
{
82+
if (!this)
83+
return nullptr;
84+
7985
// m_characters is put in a local here to avoid an extra atomic load.
8086
UChar* characters = m_characters;
8187
if (characters)

Source/JavaScriptCore/API/OpaqueJSString.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ struct OpaqueJSString : public ThreadSafeRefCounted<OpaqueJSString> {
5555

5656
JS_EXPORT_PRIVATE ~OpaqueJSString();
5757

58-
bool is8Bit() { return m_string.is8Bit(); }
59-
const LChar* characters8() { return m_string.characters8(); }
60-
const UChar* characters16() { return m_string.characters16(); }
61-
unsigned length() { return m_string.length(); }
58+
bool is8Bit() { return this ? m_string.is8Bit() : false; }
59+
const LChar* characters8() { return this ? m_string.characters8() : nullptr; }
60+
const UChar* characters16() { return this ? m_string.characters16() : nullptr; }
61+
unsigned length() { return this ? m_string.length() : 0; }
6262

6363
const UChar* characters();
6464

Source/JavaScriptCore/ChangeLog

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
2014-09-04 Commit Queue <[email protected]>
2+
3+
Unreviewed, rolling out r173245.
4+
https://bugs.webkit.org/show_bug.cgi?id=136533
5+
6+
Broke JSC tests. (Requested by ddkilzer on #webkit).
7+
8+
Reverted changeset:
9+
10+
"JavaScriptCore should build with newer clang"
11+
https://bugs.webkit.org/show_bug.cgi?id=136002
12+
http://trac.webkit.org/changeset/173245
13+
114
2014-09-04 Brian J. Burg <[email protected]>
215

316
LegacyProfiler: ProfileNodes should be used more like structs

Source/JavaScriptCore/parser/SourceProvider.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ namespace JSC {
5454
TextPosition startPosition() const { return m_startPosition; }
5555
intptr_t asID()
5656
{
57+
ASSERT(this);
58+
if (!this) // Be defensive in release mode.
59+
return nullID;
5760
if (!m_id)
5861
getID();
5962
return m_id;

Source/WebKit2/ChangeLog

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
2014-09-04 Commit Queue <[email protected]>
2+
3+
Unreviewed, rolling out r173245.
4+
https://bugs.webkit.org/show_bug.cgi?id=136533
5+
6+
Broke JSC tests. (Requested by ddkilzer on #webkit).
7+
8+
Reverted changeset:
9+
10+
"JavaScriptCore should build with newer clang"
11+
https://bugs.webkit.org/show_bug.cgi?id=136002
12+
http://trac.webkit.org/changeset/173245
13+
114
2014-09-04 Carlos Garcia Campos <[email protected]>
215

316
Initialize m_usesNetworkProcess earlier in WebProcess::initializeWebProcess()

0 commit comments

Comments
 (0)