Diff
Modified: trunk/Source/_javascript_Core/CMakeLists.txt (209219 => 209220)
--- trunk/Source/_javascript_Core/CMakeLists.txt 2016-12-02 00:04:13 UTC (rev 209219)
+++ trunk/Source/_javascript_Core/CMakeLists.txt 2016-12-02 00:24:17 UTC (rev 209220)
@@ -623,9 +623,9 @@
parser/NodesAnalyzeModule.cpp
parser/Parser.cpp
parser/ParserArena.cpp
- parser/SourceCode.cpp
parser/SourceProvider.cpp
parser/SourceProviderCache.cpp
+ parser/UnlinkedSourceCode.cpp
parser/VariableEnvironment.cpp
profiler/ProfilerBytecode.cpp
Modified: trunk/Source/_javascript_Core/ChangeLog (209219 => 209220)
--- trunk/Source/_javascript_Core/ChangeLog 2016-12-02 00:04:13 UTC (rev 209219)
+++ trunk/Source/_javascript_Core/ChangeLog 2016-12-02 00:24:17 UTC (rev 209220)
@@ -1,3 +1,61 @@
+2016-12-01 Geoffrey Garen <gga...@apple.com>
+
+ SourceCodeKey should use unlinked source code
+ https://bugs.webkit.org/show_bug.cgi?id=165286
+
+ Reviewed by Saam Barati.
+
+ This patch splits out UnlinkedSourceCode from SourceCode, and deploys
+ UnlinkedSourceCode in SourceCodeKey.
+
+ It's misleading to store SourceCode in SourceCodeKey because SourceCode
+ has an absolute location whereas unlinked cached code has no location.
+
+ I plan to deploy UnlinkedSourceCode in more places, to indicate code
+ that has no absolute location.
+
+ * _javascript_Core.xcodeproj/project.pbxproj:
+ * parser/SourceCode.cpp:
+ (JSC::UnlinkedSourceCode::toUTF8):
+ (JSC::SourceCode::toUTF8): Deleted.
+ * parser/SourceCode.h:
+ (JSC::SourceCode::SourceCode):
+ (JSC::SourceCode::startColumn):
+ (JSC::SourceCode::isHashTableDeletedValue): Deleted.
+ (JSC::SourceCode::hash): Deleted.
+ (JSC::SourceCode::view): Deleted.
+ (JSC::SourceCode::providerID): Deleted.
+ (JSC::SourceCode::isNull): Deleted.
+ (JSC::SourceCode::provider): Deleted.
+ (JSC::SourceCode::startOffset): Deleted.
+ (JSC::SourceCode::endOffset): Deleted.
+ (JSC::SourceCode::length): Deleted. Move a bunch of stuff in to a new
+ base class, UnlinkedSourceCode.
+
+ * parser/SourceCodeKey.h:
+ (JSC::SourceCodeKey::SourceCodeKey): Use UnlinkedSourceCode since code
+ in the cache has no location.
+
+ * parser/UnlinkedSourceCode.h: Copied from Source/_javascript_Core/parser/SourceCode.h.
+ (JSC::UnlinkedSourceCode::UnlinkedSourceCode):
+ (JSC::UnlinkedSourceCode::provider):
+ (JSC::SourceCode::SourceCode): Deleted.
+ (JSC::SourceCode::isHashTableDeletedValue): Deleted.
+ (JSC::SourceCode::hash): Deleted.
+ (JSC::SourceCode::view): Deleted.
+ (JSC::SourceCode::providerID): Deleted.
+ (JSC::SourceCode::isNull): Deleted.
+ (JSC::SourceCode::provider): Deleted.
+ (JSC::SourceCode::firstLine): Deleted.
+ (JSC::SourceCode::startColumn): Deleted.
+ (JSC::SourceCode::startOffset): Deleted.
+ (JSC::SourceCode::endOffset): Deleted.
+ (JSC::SourceCode::length): Deleted.
+ (JSC::makeSource): Deleted.
+ (JSC::SourceCode::subExpression): Deleted.
+
+ * runtime/CodeCache.h: Use UnlinkedSourceCode in the cache.
+
2016-12-01 Keith Miller <keith_mil...@apple.com>
Add wasm int to floating point opcodes
Modified: trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj (209219 => 209220)
--- trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj 2016-12-02 00:04:13 UTC (rev 209219)
+++ trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj 2016-12-02 00:24:17 UTC (rev 209220)
@@ -537,7 +537,7 @@
0F8F2B96172E04A3007DBDA5 /* FTLLink.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F8F2B94172E049E007DBDA5 /* FTLLink.h */; settings = {ATTRIBUTES = (Private, ); }; };
0F8F2B99172F04FF007DBDA5 /* DFGDesiredIdentifiers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F8F2B97172F04FD007DBDA5 /* DFGDesiredIdentifiers.cpp */; };
0F8F2B9A172F0501007DBDA5 /* DFGDesiredIdentifiers.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F8F2B98172F04FD007DBDA5 /* DFGDesiredIdentifiers.h */; };
- 0F8F2B9E17306C8D007DBDA5 /* SourceCode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F8F2B9D17306C8B007DBDA5 /* SourceCode.cpp */; };
+ 0F8F2B9E17306C8D007DBDA5 /* UnlinkedSourceCode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F8F2B9D17306C8B007DBDA5 /* UnlinkedSourceCode.cpp */; };
0F8F943C1667631300D61971 /* CodeSpecializationKind.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F8F943A1667631100D61971 /* CodeSpecializationKind.cpp */; };
0F8F94401667633000D61971 /* CodeBlockHash.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F8F943D1667632D00D61971 /* CodeBlockHash.cpp */; };
0F8F94411667633200D61971 /* CodeBlockHash.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F8F943E1667632D00D61971 /* CodeBlockHash.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -1018,6 +1018,7 @@
141448CB13A176EC00F5BA1A /* MarkedBlockSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 141448CA13A176EC00F5BA1A /* MarkedBlockSet.h */; settings = {ATTRIBUTES = (Private, ); }; };
141448CD13A1783700F5BA1A /* TinyBloomFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 141448CC13A1783700F5BA1A /* TinyBloomFilter.h */; settings = {ATTRIBUTES = (Private, ); }; };
14150133154BB13F005D8C98 /* WeakSetInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 14150132154BB13F005D8C98 /* WeakSetInlines.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 14201D591DECF26A00904BD3 /* SourceCode.h in Headers */ = {isa = PBXBuildFile; fileRef = 14201D581DECF26A00904BD3 /* SourceCode.h */; settings = {ATTRIBUTES = (Private, ); }; };
1421359B0A677F4F00A8195E /* JSBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1421359A0A677F4F00A8195E /* JSBase.cpp */; };
14280823107EC02C0013E7B2 /* Debugger.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F692A8580255597D01FF60F7 /* Debugger.cpp */; };
1428082D107EC0570013E7B2 /* CallData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCA62DFE0E2826230004F30D /* CallData.cpp */; };
@@ -1149,6 +1150,7 @@
148F21BC107EC54D0042EC2C /* Parser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93F0B3A909BB4DC00068FCE3 /* Parser.cpp */; };
149559EE0DDCDDF700648087 /* DebuggerCallFrame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 149559ED0DDCDDF700648087 /* DebuggerCallFrame.cpp */; };
14A1563210966365006FA260 /* DateInstanceCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 14A1563010966365006FA260 /* DateInstanceCache.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 14AB66761DECF40900A56C26 /* UnlinkedSourceCode.h in Headers */ = {isa = PBXBuildFile; fileRef = 14AB66751DECF40900A56C26 /* UnlinkedSourceCode.h */; settings = {ATTRIBUTES = (Private, ); }; };
14ABDF600A437FEF00ECCA01 /* JSCallbackObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14ABDF5E0A437FEF00ECCA01 /* JSCallbackObject.cpp */; };
14AD910C1DCA92940014F9FE /* EvalCodeBlock.h in Headers */ = {isa = PBXBuildFile; fileRef = 14AD91061DCA92940014F9FE /* EvalCodeBlock.h */; };
14AD910D1DCA92940014F9FE /* FunctionCodeBlock.h in Headers */ = {isa = PBXBuildFile; fileRef = 14AD91071DCA92940014F9FE /* FunctionCodeBlock.h */; };
@@ -2082,7 +2084,6 @@
BC18C45D0E16F5CD00B34460 /* Register.h in Headers */ = {isa = PBXBuildFile; fileRef = 149B24FF0D8AF6D1009CB8C7 /* Register.h */; settings = {ATTRIBUTES = (Private, ); }; };
BC18C45E0E16F5CD00B34460 /* CLoopStack.h in Headers */ = {isa = PBXBuildFile; fileRef = 14D792640DAA03FB001A9F05 /* CLoopStack.h */; settings = {ATTRIBUTES = (Private, ); }; };
BC18C4630E16F5CD00B34460 /* SourceProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 65E866ED0DD59AFA00A2B2A1 /* SourceProvider.h */; settings = {ATTRIBUTES = (Private, ); }; };
- BC18C4640E16F5CD00B34460 /* SourceCode.h in Headers */ = {isa = PBXBuildFile; fileRef = 65E866EE0DD59AFA00A2B2A1 /* SourceCode.h */; settings = {ATTRIBUTES = (Private, ); }; };
BC18C4660E16F5CD00B34460 /* StringConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = BC18C3C10E16EE3300B34460 /* StringConstructor.h */; };
BC18C4680E16F5CD00B34460 /* StringObject.h in Headers */ = {isa = PBXBuildFile; fileRef = BC18C3C30E16EE3300B34460 /* StringObject.h */; settings = {ATTRIBUTES = (Private, ); }; };
BC18C46A0E16F5CD00B34460 /* StringPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = BC18C3C60E16EE3300B34460 /* StringPrototype.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -2949,7 +2950,7 @@
0F8F2B94172E049E007DBDA5 /* FTLLink.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = FTLLink.h; path = ftl/FTLLink.h; sourceTree = "<group>"; };
0F8F2B97172F04FD007DBDA5 /* DFGDesiredIdentifiers.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = DFGDesiredIdentifiers.cpp; path = dfg/DFGDesiredIdentifiers.cpp; sourceTree = "<group>"; };
0F8F2B98172F04FD007DBDA5 /* DFGDesiredIdentifiers.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = DFGDesiredIdentifiers.h; path = dfg/DFGDesiredIdentifiers.h; sourceTree = "<group>"; };
- 0F8F2B9D17306C8B007DBDA5 /* SourceCode.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = SourceCode.cpp; sourceTree = "<group>"; };
+ 0F8F2B9D17306C8B007DBDA5 /* UnlinkedSourceCode.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = UnlinkedSourceCode.cpp; sourceTree = "<group>"; };
0F8F943A1667631100D61971 /* CodeSpecializationKind.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CodeSpecializationKind.cpp; sourceTree = "<group>"; };
0F8F943D1667632D00D61971 /* CodeBlockHash.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CodeBlockHash.cpp; sourceTree = "<group>"; };
0F8F943E1667632D00D61971 /* CodeBlockHash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CodeBlockHash.h; sourceTree = "<group>"; };
@@ -3424,6 +3425,7 @@
141448CA13A176EC00F5BA1A /* MarkedBlockSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MarkedBlockSet.h; sourceTree = "<group>"; };
141448CC13A1783700F5BA1A /* TinyBloomFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TinyBloomFilter.h; sourceTree = "<group>"; };
14150132154BB13F005D8C98 /* WeakSetInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WeakSetInlines.h; sourceTree = "<group>"; };
+ 14201D581DECF26A00904BD3 /* SourceCode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SourceCode.h; sourceTree = "<group>"; };
1421359A0A677F4F00A8195E /* JSBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSBase.cpp; sourceTree = "<group>"; };
142711380A460BBB0080EEEA /* JSBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSBase.h; sourceTree = "<group>"; };
1429D77B0ED20D7300B89619 /* Interpreter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Interpreter.h; sourceTree = "<group>"; };
@@ -3510,6 +3512,7 @@
149DAAF212EB559D0083B12B /* ConservativeRoots.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConservativeRoots.h; sourceTree = "<group>"; };
14A1563010966365006FA260 /* DateInstanceCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DateInstanceCache.h; sourceTree = "<group>"; };
14A396A60CD2933100B5B4FF /* SymbolTable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SymbolTable.h; sourceTree = "<group>"; };
+ 14AB66751DECF40900A56C26 /* UnlinkedSourceCode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UnlinkedSourceCode.h; sourceTree = "<group>"; };
14ABB36E099C076400E2A24F /* JSCJSValue.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSCJSValue.h; sourceTree = "<group>"; };
14ABB454099C2A0F00E2A24F /* JSType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSType.h; sourceTree = "<group>"; };
14ABDF5D0A437FEF00ECCA01 /* JSCallbackObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCallbackObject.h; sourceTree = "<group>"; };
@@ -3762,7 +3765,6 @@
65C7A1710A8EAACB00FA37EA /* JSWrapperObject.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSWrapperObject.cpp; sourceTree = "<group>"; };
65C7A1720A8EAACB00FA37EA /* JSWrapperObject.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSWrapperObject.h; sourceTree = "<group>"; };
65E866ED0DD59AFA00A2B2A1 /* SourceProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SourceProvider.h; sourceTree = "<group>"; };
- 65E866EE0DD59AFA00A2B2A1 /* SourceCode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SourceCode.h; sourceTree = "<group>"; };
65EA4C99092AF9E20093D800 /* JSLock.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSLock.cpp; sourceTree = "<group>"; tabWidth = 8; };
65EA4C9A092AF9E20093D800 /* JSLock.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = JSLock.h; sourceTree = "<group>"; tabWidth = 8; };
65EA73620BAE35D1001BB560 /* CommonIdentifiers.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = CommonIdentifiers.cpp; sourceTree = "<group>"; };
@@ -6038,6 +6040,7 @@
F692A8660255597D01FF60F7 /* Lexer.h */,
E3794E731B77EB97005543AE /* ModuleAnalyzer.cpp */,
E3794E741B77EB97005543AE /* ModuleAnalyzer.h */,
+ 000BEAF0DF604481AF6AB68C /* ModuleScopeData.h */,
930DAD030FB1EB1A0082D205 /* NodeConstructors.h */,
F692A86D0255597D01FF60F7 /* Nodes.cpp */,
F692A86E0255597D01FF60F7 /* Nodes.h */,
@@ -6051,8 +6054,8 @@
A77F18241641925400640A47 /* ParserModes.h */,
65303D631447B9E100D3F904 /* ParserTokens.h */,
869EBCB60E8C6D4A008722CC /* ResultType.h */,
- 0F8F2B9D17306C8B007DBDA5 /* SourceCode.cpp */,
- 65E866EE0DD59AFA00A2B2A1 /* SourceCode.h */,
+ 0F8F2B9D17306C8B007DBDA5 /* UnlinkedSourceCode.cpp */,
+ 14201D581DECF26A00904BD3 /* SourceCode.h */,
70B7918E1C0244C9002481E2 /* SourceCodeKey.h */,
0F493AF816D0CAD10084508B /* SourceProvider.cpp */,
65E866ED0DD59AFA00A2B2A1 /* SourceProvider.h */,
@@ -6060,9 +6063,9 @@
E49DC15112EF272200184A1F /* SourceProviderCache.h */,
E49DC14912EF261A00184A1F /* SourceProviderCacheItem.h */,
A7A7EE7711B98B8D0065A14F /* SyntaxChecker.h */,
+ 14AB66751DECF40900A56C26 /* UnlinkedSourceCode.h */,
79EE0BFD1B4AFB85000385C9 /* VariableEnvironment.cpp */,
79EE0BFE1B4AFB85000385C9 /* VariableEnvironment.h */,
- 000BEAF0DF604481AF6AB68C /* ModuleScopeData.h */,
);
path = parser;
sourceTree = "<group>";
@@ -8099,6 +8102,7 @@
A7D89CFE17A0B8CC00773AD8 /* DFGOSRAvailabilityAnalysisPhase.h in Headers */,
0FD82E57141DAF1000179C94 /* DFGOSREntry.h in Headers */,
0F40E4A71C497F7400A577FA /* AirOpcode.h in Headers */,
+ 14AB66761DECF40900A56C26 /* UnlinkedSourceCode.h in Headers */,
0FDF67D71D9DC442001B9825 /* AirKind.h in Headers */,
0FD8A32617D51F5700CA2C40 /* DFGOSREntrypointCreationPhase.h in Headers */,
0FC0976A1468A6F700CF2442 /* DFGOSRExit.h in Headers */,
@@ -8778,6 +8782,7 @@
86158AB3155C8B4000B45C9C /* PropertyName.h in Headers */,
BC18C4540E16F5CD00B34460 /* PropertyNameArray.h in Headers */,
0FF7168C15A3B235008F5DAA /* PropertyOffset.h in Headers */,
+ 14201D591DECF26A00904BD3 /* SourceCode.h in Headers */,
BC18C4550E16F5CD00B34460 /* PropertySlot.h in Headers */,
0FB7F39C15ED8E4600F167B2 /* PropertyStorage.h in Headers */,
53FA2AE11CF37F3F0022711D /* LLIntPrototypeLoadAdaptiveStructureWatchpoint.h in Headers */,
@@ -8853,7 +8858,6 @@
C2160FE715F7E95E00942DFC /* SlotVisitorInlines.h in Headers */,
A709F2F017A0AC0400512E98 /* SlowPathCall.h in Headers */,
933040040E6A749400786E6A /* SmallStrings.h in Headers */,
- BC18C4640E16F5CD00B34460 /* SourceCode.h in Headers */,
0F7C39FD1C8F659500480151 /* RegExpObjectInlines.h in Headers */,
0F7CF9521DC027D90098CC12 /* StopIfNecessaryTimer.h in Headers */,
BC18C4630E16F5CD00B34460 /* SourceProvider.h in Headers */,
@@ -10306,7 +10310,7 @@
0F2B670417B6B5AB00A7AE3F /* SimpleTypedArrayController.cpp in Sources */,
C225494315F7DBAA0065E898 /* SlotVisitor.cpp in Sources */,
9330402C0E6A764000786E6A /* SmallStrings.cpp in Sources */,
- 0F8F2B9E17306C8D007DBDA5 /* SourceCode.cpp in Sources */,
+ 0F8F2B9E17306C8D007DBDA5 /* UnlinkedSourceCode.cpp in Sources */,
0F493AFA16D0CAD30084508B /* SourceProvider.cpp in Sources */,
0F338DF51BE93D550013C88F /* B3ConstrainedValue.cpp in Sources */,
E49DC16B12EF293E00184A1F /* SourceProviderCache.cpp in Sources */,
Deleted: trunk/Source/_javascript_Core/parser/SourceCode.cpp (209219 => 209220)
--- trunk/Source/_javascript_Core/parser/SourceCode.cpp 2016-12-02 00:04:13 UTC (rev 209219)
+++ trunk/Source/_javascript_Core/parser/SourceCode.cpp 2016-12-02 00:24:17 UTC (rev 209220)
@@ -1,43 +0,0 @@
-/*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "SourceCode.h"
-
-#include "JSCInlines.h"
-#include <wtf/text/CString.h>
-
-namespace JSC {
-
-CString SourceCode::toUTF8() const
-{
- if (!m_provider)
- return CString("", 0);
-
- return m_provider->source().substring(m_startChar, m_endChar - m_startChar).utf8();
-}
-
-} // namespace JSC
-
Modified: trunk/Source/_javascript_Core/parser/SourceCode.h (209219 => 209220)
--- trunk/Source/_javascript_Core/parser/SourceCode.h 2016-12-02 00:04:13 UTC (rev 209219)
+++ trunk/Source/_javascript_Core/parser/SourceCode.h 2016-12-02 00:24:17 UTC (rev 209220)
@@ -28,31 +28,21 @@
#pragma once
-#include "SourceProvider.h"
-#include <wtf/RefPtr.h>
+#include "UnlinkedSourceCode.h"
namespace JSC {
- class SourceCode {
+ class SourceCode : public UnlinkedSourceCode {
public:
SourceCode()
- : m_provider(0)
- , m_startChar(0)
- , m_endChar(0)
+ : UnlinkedSourceCode()
, m_firstLine(0)
, m_startColumn(0)
{
}
- SourceCode(WTF::HashTableDeletedValueType)
- : m_provider(WTF::HashTableDeletedValue)
- {
- }
-
SourceCode(PassRefPtr<SourceProvider> provider)
- : m_provider(provider)
- , m_startChar(0)
- , m_endChar(m_provider->source().length())
+ : UnlinkedSourceCode(provider)
, m_firstLine(1)
, m_startColumn(1)
{
@@ -59,40 +49,22 @@
}
SourceCode(PassRefPtr<SourceProvider> provider, int firstLine, int startColumn)
- : m_provider(provider)
- , m_startChar(0)
- , m_endChar(m_provider->source().length())
+ : UnlinkedSourceCode(provider)
, m_firstLine(std::max(firstLine, 1))
, m_startColumn(std::max(startColumn, 1))
{
}
- SourceCode(PassRefPtr<SourceProvider> provider, int start, int end, int firstLine, int startColumn)
- : m_provider(provider)
- , m_startChar(start)
- , m_endChar(end)
+ SourceCode(PassRefPtr<SourceProvider> provider, int startOffset, int endOffset, int firstLine, int startColumn)
+ : UnlinkedSourceCode(provider, startOffset, endOffset)
, m_firstLine(std::max(firstLine, 1))
, m_startColumn(std::max(startColumn, 1))
{
}
- bool isHashTableDeletedValue() const { return m_provider.isHashTableDeletedValue(); }
+ int firstLine() const { return m_firstLine; }
+ int startColumn() const { return m_startColumn; }
- unsigned hash() const
- {
- ASSERT(m_provider);
- return m_provider->hash();
- }
-
- StringView view() const
- {
- if (!m_provider)
- return StringView();
- return m_provider->getRange(m_startChar, m_endChar);
- }
-
- CString toUTF8() const;
-
intptr_t providerID() const
{
if (!m_provider)
@@ -99,21 +71,12 @@
return SourceProvider::nullID;
return m_provider->asID();
}
-
- bool isNull() const { return !m_provider; }
+
SourceProvider* provider() const { return m_provider.get(); }
- int firstLine() const { return m_firstLine; }
- int startColumn() const { return m_startColumn; }
- int startOffset() const { return m_startChar; }
- int endOffset() const { return m_endChar; }
- int length() const { return m_endChar - m_startChar; }
-
+
SourceCode subExpression(unsigned openBrace, unsigned closeBrace, int firstLine, int startColumn);
private:
- RefPtr<SourceProvider> m_provider;
- int m_startChar;
- int m_endChar;
int m_firstLine;
int m_startColumn;
};
Modified: trunk/Source/_javascript_Core/parser/SourceCodeKey.h (209219 => 209220)
--- trunk/Source/_javascript_Core/parser/SourceCodeKey.h 2016-12-02 00:04:13 UTC (rev 209219)
+++ trunk/Source/_javascript_Core/parser/SourceCodeKey.h 2016-12-02 00:24:17 UTC (rev 209220)
@@ -27,7 +27,7 @@
#pragma once
#include "ParserModes.h"
-#include "SourceCode.h"
+#include "UnlinkedSourceCode.h"
#include <wtf/HashTraits.h>
namespace JSC {
@@ -76,7 +76,7 @@
}
SourceCodeKey(
- const SourceCode& sourceCode, const String& name, SourceCodeType codeType, JSParserStrictMode strictMode,
+ const UnlinkedSourceCode& sourceCode, const String& name, SourceCodeType codeType, JSParserStrictMode strictMode,
JSParserScriptMode scriptMode, DerivedContextType derivedContextType, EvalContextType evalContextType, bool isArrowFunctionContext,
DebuggerMode debuggerMode, TypeProfilerEnabled typeProfilerEnabled, ControlFlowProfilerEnabled controlFlowProfilerEnabled)
: m_sourceCode(sourceCode)
@@ -124,7 +124,7 @@
};
private:
- SourceCode m_sourceCode;
+ UnlinkedSourceCode m_sourceCode;
String m_name;
SourceCodeFlags m_flags;
unsigned m_hash;
Copied: trunk/Source/_javascript_Core/parser/UnlinkedSourceCode.cpp (from rev 209219, trunk/Source/_javascript_Core/parser/SourceCode.cpp) (0 => 209220)
--- trunk/Source/_javascript_Core/parser/UnlinkedSourceCode.cpp (rev 0)
+++ trunk/Source/_javascript_Core/parser/UnlinkedSourceCode.cpp 2016-12-02 00:24:17 UTC (rev 209220)
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2013, 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "UnlinkedSourceCode.h"
+
+#include "JSCInlines.h"
+#include <wtf/text/CString.h>
+
+namespace JSC {
+
+CString UnlinkedSourceCode::toUTF8() const
+{
+ if (!m_provider)
+ return CString("", 0);
+
+ return m_provider->source().substring(m_startChar, m_endChar - m_startChar).utf8();
+}
+
+} // namespace JSC
+
Copied: trunk/Source/_javascript_Core/parser/UnlinkedSourceCode.h (from rev 209192, trunk/Source/_javascript_Core/parser/SourceCode.h) (0 => 209220)
--- trunk/Source/_javascript_Core/parser/UnlinkedSourceCode.h (rev 0)
+++ trunk/Source/_javascript_Core/parser/UnlinkedSourceCode.h 2016-12-02 00:24:17 UTC (rev 209220)
@@ -0,0 +1,99 @@
+/*
+ * Copyright (C) 2008, 2013, 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include "SourceProvider.h"
+#include <wtf/RefPtr.h>
+
+namespace JSC {
+
+ class UnlinkedSourceCode {
+ public:
+ UnlinkedSourceCode()
+ : m_provider(0)
+ , m_startChar(0)
+ , m_endChar(0)
+ {
+ }
+
+ UnlinkedSourceCode(WTF::HashTableDeletedValueType)
+ : m_provider(WTF::HashTableDeletedValue)
+ {
+ }
+
+ UnlinkedSourceCode(PassRefPtr<SourceProvider> provider)
+ : m_provider(provider)
+ , m_startChar(0)
+ , m_endChar(m_provider->source().length())
+ {
+ }
+
+ UnlinkedSourceCode(PassRefPtr<SourceProvider> provider, int startOffset, int endOffset)
+ : m_provider(provider)
+ , m_startChar(startOffset)
+ , m_endChar(endOffset)
+ {
+ }
+
+ UnlinkedSourceCode(const UnlinkedSourceCode& other)
+ : m_provider(other.m_provider)
+ , m_startChar(other.m_startChar)
+ , m_endChar(other.m_endChar)
+ {
+ }
+
+ bool isHashTableDeletedValue() const { return m_provider.isHashTableDeletedValue(); }
+
+ unsigned hash() const
+ {
+ ASSERT(m_provider);
+ return m_provider->hash();
+ }
+
+ StringView view() const
+ {
+ if (!m_provider)
+ return StringView();
+ return m_provider->getRange(m_startChar, m_endChar);
+ }
+
+ CString toUTF8() const;
+
+ bool isNull() const { return !m_provider; }
+ int startOffset() const { return m_startChar; }
+ int endOffset() const { return m_endChar; }
+ int length() const { return m_endChar - m_startChar; }
+
+ protected:
+ RefPtr<SourceProvider> m_provider;
+ int m_startChar;
+ int m_endChar;
+ };
+
+} // namespace JSC
Modified: trunk/Source/_javascript_Core/runtime/CodeCache.h (209219 => 209220)
--- trunk/Source/_javascript_Core/runtime/CodeCache.h 2016-12-02 00:04:13 UTC (rev 209219)
+++ trunk/Source/_javascript_Core/runtime/CodeCache.h 2016-12-02 00:24:17 UTC (rev 209220)
@@ -30,7 +30,6 @@
#include "JSCInlines.h"
#include "Parser.h"
#include "ParserModes.h"
-#include "SourceCode.h"
#include "SourceCodeKey.h"
#include "Strong.h"
#include "StrongInlines.h"
@@ -38,6 +37,7 @@
#include "UnlinkedEvalCodeBlock.h"
#include "UnlinkedModuleProgramCodeBlock.h"
#include "UnlinkedProgramCodeBlock.h"
+#include "UnlinkedSourceCode.h"
#include <wtf/CurrentTime.h>
#include <wtf/Forward.h>
#include <wtf/text/WTFString.h>