Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (143391 => 143392)
--- trunk/Source/_javascript_Core/ChangeLog 2013-02-19 23:15:42 UTC (rev 143391)
+++ trunk/Source/_javascript_Core/ChangeLog 2013-02-19 23:19:25 UTC (rev 143392)
@@ -1,5 +1,26 @@
2013-02-19 Filip Pizlo <[email protected]>
+ Moved PolymorphicAccessStructureList into its own file.
+
+ Rubber stamped by Mark Hahnenberg.
+
+ * GNUmakefile.list.am:
+ * _javascript_Core.vcproj/_javascript_Core/_javascript_Core.vcproj:
+ * _javascript_Core.xcodeproj/project.pbxproj:
+ * bytecode/Instruction.h:
+ (JSC):
+ * bytecode/PolymorphicAccessStructureList.h: Added.
+ (JSC):
+ (PolymorphicAccessStructureList):
+ (PolymorphicStubInfo):
+ (JSC::PolymorphicAccessStructureList::PolymorphicStubInfo::PolymorphicStubInfo):
+ (JSC::PolymorphicAccessStructureList::PolymorphicStubInfo::set):
+ (JSC::PolymorphicAccessStructureList::PolymorphicAccessStructureList):
+ (JSC::PolymorphicAccessStructureList::visitWeak):
+ * bytecode/StructureStubInfo.h:
+
+2013-02-19 Filip Pizlo <[email protected]>
+
Fix indentation of Instruction.h
Rubber stamped by Mark Hahnenberg.
Modified: trunk/Source/_javascript_Core/GNUmakefile.list.am (143391 => 143392)
--- trunk/Source/_javascript_Core/GNUmakefile.list.am 2013-02-19 23:15:42 UTC (rev 143391)
+++ trunk/Source/_javascript_Core/GNUmakefile.list.am 2013-02-19 23:19:25 UTC (rev 143392)
@@ -130,6 +130,7 @@
Source/_javascript_Core/bytecode/Opcode.cpp \
Source/_javascript_Core/bytecode/Opcode.h \
Source/_javascript_Core/bytecode/Operands.h \
+ Source/_javascript_Core/bytecode/PolymorphicAccessStructureList.h \
Source/_javascript_Core/bytecode/PolymorphicPutByIdList.cpp \
Source/_javascript_Core/bytecode/PolymorphicPutByIdList.h \
Source/_javascript_Core/bytecode/PreciseJumpTargets.cpp \
Modified: trunk/Source/_javascript_Core/_javascript_Core.vcproj/_javascript_Core/_javascript_Core.vcproj (143391 => 143392)
--- trunk/Source/_javascript_Core/_javascript_Core.vcproj/_javascript_Core/_javascript_Core.vcproj 2013-02-19 23:15:42 UTC (rev 143391)
+++ trunk/Source/_javascript_Core/_javascript_Core.vcproj/_javascript_Core/_javascript_Core.vcproj 2013-02-19 23:19:25 UTC (rev 143392)
@@ -1874,10 +1874,18 @@
>
</File>
<File
+ RelativePath="..\..\bytecode\PolymorphicAccessStructureList.h"
+ >
+ </File>
+ <File
RelativePath="..\..\bytecode\PolymorphicPutByIdList.cpp"
>
</File>
<File
+ RelativePath="..\..\bytecode\PolymorphicPutByIdList.h"
+ >
+ </File>
+ <File
RelativePath="..\..\bytecode\PutByIdStatus.cpp"
>
</File>
Modified: trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj (143391 => 143392)
--- trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj 2013-02-19 23:15:42 UTC (rev 143391)
+++ trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj 2013-02-19 23:19:25 UTC (rev 143392)
@@ -109,6 +109,7 @@
0F2C557014738F3500121E4F /* DFGCodeBlocks.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F2C556D14738F2E00121E4F /* DFGCodeBlocks.cpp */; };
0F2E892C16D028AD009E4FD2 /* UnusedPointer.h in Headers */ = {isa = PBXBuildFile; fileRef = 65987F2F16828A7E003C2F8D /* UnusedPointer.h */; settings = {ATTRIBUTES = (Private, ); }; };
0F2E892D16D02BAF009E4FD2 /* DFGMinifiedID.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB4B51016B3A964003F696B /* DFGMinifiedID.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 0F34B14C16D43E0D001CDA5A /* PolymorphicAccessStructureList.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F34B14B16D43E0C001CDA5A /* PolymorphicAccessStructureList.h */; settings = {ATTRIBUTES = (Private, ); }; };
0F3B3A1A153E68F2003ED0FF /* DFGConstantFoldingPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F3B3A17153E68EF003ED0FF /* DFGConstantFoldingPhase.cpp */; };
0F3B3A1B153E68F4003ED0FF /* DFGConstantFoldingPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F3B3A18153E68EF003ED0FF /* DFGConstantFoldingPhase.h */; settings = {ATTRIBUTES = (Private, ); }; };
0F3B3A271544C995003ED0FF /* DFGCFGSimplificationPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F3B3A241544C991003ED0FF /* DFGCFGSimplificationPhase.cpp */; };
@@ -1000,6 +1001,7 @@
0F2BDC5015228FFA00CD8910 /* DFGVariableEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGVariableEvent.cpp; path = dfg/DFGVariableEvent.cpp; sourceTree = "<group>"; };
0F2C556D14738F2E00121E4F /* DFGCodeBlocks.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DFGCodeBlocks.cpp; sourceTree = "<group>"; };
0F2C556E14738F2E00121E4F /* DFGCodeBlocks.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DFGCodeBlocks.h; sourceTree = "<group>"; };
+ 0F34B14B16D43E0C001CDA5A /* PolymorphicAccessStructureList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolymorphicAccessStructureList.h; sourceTree = "<group>"; };
0F3B3A17153E68EF003ED0FF /* DFGConstantFoldingPhase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGConstantFoldingPhase.cpp; path = dfg/DFGConstantFoldingPhase.cpp; sourceTree = "<group>"; };
0F3B3A18153E68EF003ED0FF /* DFGConstantFoldingPhase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGConstantFoldingPhase.h; path = dfg/DFGConstantFoldingPhase.h; sourceTree = "<group>"; };
0F3B3A241544C991003ED0FF /* DFGCFGSimplificationPhase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGCFGSimplificationPhase.cpp; path = dfg/DFGCFGSimplificationPhase.cpp; sourceTree = "<group>"; };
@@ -2859,6 +2861,7 @@
969A07940ED1D3AE00F1F681 /* Opcode.cpp */,
969A07950ED1D3AE00F1F681 /* Opcode.h */,
0F2BDC2B151FDE8B00CD8910 /* Operands.h */,
+ 0F34B14B16D43E0C001CDA5A /* PolymorphicAccessStructureList.h */,
0F9FC8BF14E1B5FB00D52AE0 /* PolymorphicPutByIdList.cpp */,
0F9FC8C014E1B5FB00D52AE0 /* PolymorphicPutByIdList.h */,
0F98205D16BFE37F00240D02 /* PreciseJumpTargets.cpp */,
@@ -3198,6 +3201,7 @@
86C36EEA0EE1289D00B3DF59 /* MacroAssembler.h in Headers */,
86D3B2C610156BDE002865E7 /* MacroAssemblerARM.h in Headers */,
86ADD1460FDDEA980006EEC2 /* MacroAssemblerARMv7.h in Headers */,
+ 0F34B14C16D43E0D001CDA5A /* PolymorphicAccessStructureList.h in Headers */,
863B23E00FC6118900703AA4 /* MacroAssemblerCodeRef.h in Headers */,
86C568E111A213EE0007F7F0 /* MacroAssemblerMIPS.h in Headers */,
86AE64A9135E5E1C00963012 /* MacroAssemblerSH4.h in Headers */,
Modified: trunk/Source/_javascript_Core/bytecode/Instruction.h (143391 => 143392)
--- trunk/Source/_javascript_Core/bytecode/Instruction.h 2013-02-19 23:15:42 UTC (rev 143391)
+++ trunk/Source/_javascript_Core/bytecode/Instruction.h 2013-02-19 23:19:25 UTC (rev 143392)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008, 2012 Apple Inc. All rights reserved.
+ * Copyright (C) 2008, 2012, 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
@@ -29,7 +29,6 @@
#ifndef Instruction_h
#define Instruction_h
-#include "JITStubRoutine.h"
#include "MacroAssembler.h"
#include "Opcode.h"
#include "PropertySlot.h"
@@ -39,117 +38,14 @@
#include "StructureChain.h"
#include <wtf/VectorTraits.h>
-#define POLYMORPHIC_LIST_CACHE_SIZE 8
-
namespace JSC {
-// *Sigh*, If the JIT is enabled we need to track the stubRountine (of type CodeLocationLabel),
-// If the JIT is not in use we don't actually need the variable (that said, if the JIT is not in use we don't
-// curently actually use PolymorphicAccessStructureLists, which we should). Anyway, this seems like the best
-// solution for now - will need to something smarter if/when we actually want mixed-mode operation.
-
class ArrayAllocationProfile;
class ArrayProfile;
-class JSCell;
class ObjectAllocationProfile;
-class Structure;
-class StructureChain;
struct LLIntCallLinkInfo;
struct ValueProfile;
-#if ENABLE(JIT)
-// Structure used by op_get_by_id_self_list and op_get_by_id_proto_list instruction to hold data off the main opcode stream.
-struct PolymorphicAccessStructureList {
- WTF_MAKE_FAST_ALLOCATED;
-public:
- struct PolymorphicStubInfo {
- bool isChain;
- bool isDirect;
- RefPtr<JITStubRoutine> stubRoutine;
- WriteBarrier<Structure> base;
- union {
- WriteBarrierBase<Structure> proto;
- WriteBarrierBase<StructureChain> chain;
- } u;
-
- PolymorphicStubInfo()
- {
- u.proto.clear();
- }
-
- void set(JSGlobalData& globalData, JSCell* owner, PassRefPtr<JITStubRoutine> _stubRoutine, Structure* _base, bool isDirect)
- {
- stubRoutine = _stubRoutine;
- base.set(globalData, owner, _base);
- u.proto.clear();
- isChain = false;
- this->isDirect = isDirect;
- }
-
- void set(JSGlobalData& globalData, JSCell* owner, PassRefPtr<JITStubRoutine> _stubRoutine, Structure* _base, Structure* _proto, bool isDirect)
- {
- stubRoutine = _stubRoutine;
- base.set(globalData, owner, _base);
- u.proto.set(globalData, owner, _proto);
- isChain = false;
- this->isDirect = isDirect;
- }
-
- void set(JSGlobalData& globalData, JSCell* owner, PassRefPtr<JITStubRoutine> _stubRoutine, Structure* _base, StructureChain* _chain, bool isDirect)
- {
- stubRoutine = _stubRoutine;
- base.set(globalData, owner, _base);
- u.chain.set(globalData, owner, _chain);
- isChain = true;
- this->isDirect = isDirect;
- }
- } list[POLYMORPHIC_LIST_CACHE_SIZE];
-
- PolymorphicAccessStructureList()
- {
- }
-
- PolymorphicAccessStructureList(JSGlobalData& globalData, JSCell* owner, PassRefPtr<JITStubRoutine> stubRoutine, Structure* firstBase, bool isDirect)
- {
- list[0].set(globalData, owner, stubRoutine, firstBase, isDirect);
- }
-
- PolymorphicAccessStructureList(JSGlobalData& globalData, JSCell* owner, PassRefPtr<JITStubRoutine> stubRoutine, Structure* firstBase, Structure* firstProto, bool isDirect)
- {
- list[0].set(globalData, owner, stubRoutine, firstBase, firstProto, isDirect);
- }
-
- PolymorphicAccessStructureList(JSGlobalData& globalData, JSCell* owner, PassRefPtr<JITStubRoutine> stubRoutine, Structure* firstBase, StructureChain* firstChain, bool isDirect)
- {
- list[0].set(globalData, owner, stubRoutine, firstBase, firstChain, isDirect);
- }
-
- bool visitWeak(int count)
- {
- for (int i = 0; i < count; ++i) {
- PolymorphicStubInfo& info = list[i];
- if (!info.base) {
- // We're being marked during initialisation of an entry
- ASSERT(!info.u.proto);
- continue;
- }
-
- if (!Heap::isMarked(info.base.get()))
- return false;
- if (info.u.proto && !info.isChain
- && !Heap::isMarked(info.u.proto.get()))
- return false;
- if (info.u.chain && info.isChain
- && !Heap::isMarked(info.u.chain.get()))
- return false;
- }
-
- return true;
- }
-};
-
-#endif
-
struct Instruction {
Instruction()
{
Added: trunk/Source/_javascript_Core/bytecode/PolymorphicAccessStructureList.h (0 => 143392)
--- trunk/Source/_javascript_Core/bytecode/PolymorphicAccessStructureList.h (rev 0)
+++ trunk/Source/_javascript_Core/bytecode/PolymorphicAccessStructureList.h 2013-02-19 23:19:25 UTC (rev 143392)
@@ -0,0 +1,139 @@
+/*
+ * 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.
+ */
+
+#ifndef PolymorphicAccessStructureList_h
+#define PolymorphicAccessStructureList_h
+
+#include "JITStubRoutine.h"
+#include "Structure.h"
+#include "StructureChain.h"
+#include <wtf/Platform.h>
+
+#define POLYMORPHIC_LIST_CACHE_SIZE 8
+
+namespace JSC {
+
+// *Sigh*, If the JIT is enabled we need to track the stubRountine (of type CodeLocationLabel),
+// If the JIT is not in use we don't actually need the variable (that said, if the JIT is not in use we don't
+// curently actually use PolymorphicAccessStructureLists, which we should). Anyway, this seems like the best
+// solution for now - will need to something smarter if/when we actually want mixed-mode operation.
+
+#if ENABLE(JIT)
+// Structure used by op_get_by_id_self_list and op_get_by_id_proto_list instruction to hold data off the main opcode stream.
+struct PolymorphicAccessStructureList {
+ WTF_MAKE_FAST_ALLOCATED;
+public:
+ struct PolymorphicStubInfo {
+ bool isChain;
+ bool isDirect;
+ RefPtr<JITStubRoutine> stubRoutine;
+ WriteBarrier<Structure> base;
+ union {
+ WriteBarrierBase<Structure> proto;
+ WriteBarrierBase<StructureChain> chain;
+ } u;
+
+ PolymorphicStubInfo()
+ {
+ u.proto.clear();
+ }
+
+ void set(JSGlobalData& globalData, JSCell* owner, PassRefPtr<JITStubRoutine> _stubRoutine, Structure* _base, bool isDirect)
+ {
+ stubRoutine = _stubRoutine;
+ base.set(globalData, owner, _base);
+ u.proto.clear();
+ isChain = false;
+ this->isDirect = isDirect;
+ }
+
+ void set(JSGlobalData& globalData, JSCell* owner, PassRefPtr<JITStubRoutine> _stubRoutine, Structure* _base, Structure* _proto, bool isDirect)
+ {
+ stubRoutine = _stubRoutine;
+ base.set(globalData, owner, _base);
+ u.proto.set(globalData, owner, _proto);
+ isChain = false;
+ this->isDirect = isDirect;
+ }
+
+ void set(JSGlobalData& globalData, JSCell* owner, PassRefPtr<JITStubRoutine> _stubRoutine, Structure* _base, StructureChain* _chain, bool isDirect)
+ {
+ stubRoutine = _stubRoutine;
+ base.set(globalData, owner, _base);
+ u.chain.set(globalData, owner, _chain);
+ isChain = true;
+ this->isDirect = isDirect;
+ }
+ } list[POLYMORPHIC_LIST_CACHE_SIZE];
+
+ PolymorphicAccessStructureList()
+ {
+ }
+
+ PolymorphicAccessStructureList(JSGlobalData& globalData, JSCell* owner, PassRefPtr<JITStubRoutine> stubRoutine, Structure* firstBase, bool isDirect)
+ {
+ list[0].set(globalData, owner, stubRoutine, firstBase, isDirect);
+ }
+
+ PolymorphicAccessStructureList(JSGlobalData& globalData, JSCell* owner, PassRefPtr<JITStubRoutine> stubRoutine, Structure* firstBase, Structure* firstProto, bool isDirect)
+ {
+ list[0].set(globalData, owner, stubRoutine, firstBase, firstProto, isDirect);
+ }
+
+ PolymorphicAccessStructureList(JSGlobalData& globalData, JSCell* owner, PassRefPtr<JITStubRoutine> stubRoutine, Structure* firstBase, StructureChain* firstChain, bool isDirect)
+ {
+ list[0].set(globalData, owner, stubRoutine, firstBase, firstChain, isDirect);
+ }
+
+ bool visitWeak(int count)
+ {
+ for (int i = 0; i < count; ++i) {
+ PolymorphicStubInfo& info = list[i];
+ if (!info.base) {
+ // We're being marked during initialisation of an entry
+ ASSERT(!info.u.proto);
+ continue;
+ }
+
+ if (!Heap::isMarked(info.base.get()))
+ return false;
+ if (info.u.proto && !info.isChain
+ && !Heap::isMarked(info.u.proto.get()))
+ return false;
+ if (info.u.chain && info.isChain
+ && !Heap::isMarked(info.u.chain.get()))
+ return false;
+ }
+
+ return true;
+ }
+};
+
+#endif // ENABLE(JIT)
+
+} // namespace JSC
+
+#endif // PolymorphicAccessStructureList_h
+
Modified: trunk/Source/_javascript_Core/bytecode/StructureStubInfo.h (143391 => 143392)
--- trunk/Source/_javascript_Core/bytecode/StructureStubInfo.h 2013-02-19 23:15:42 UTC (rev 143391)
+++ trunk/Source/_javascript_Core/bytecode/StructureStubInfo.h 2013-02-19 23:19:25 UTC (rev 143392)
@@ -36,6 +36,7 @@
#include "JITStubRoutine.h"
#include "MacroAssembler.h"
#include "Opcode.h"
+#include "PolymorphicAccessStructureList.h"
#include "Structure.h"
#include "StructureStubClearingWatchpoint.h"
#include <wtf/OwnPtr.h>