| 1 | /* |
| 2 | * Copyright (C) 2008 Apple Inc. All rights reserved. |
| 3 | * |
| 4 | * Redistribution and use in source and binary forms, with or without |
| 5 | * modification, are permitted provided that the following conditions |
| 6 | * are met: |
| 7 | * |
| 8 | * 1. Redistributions of source code must retain the above copyright |
| 9 | * notice, this list of conditions and the following disclaimer. |
| 10 | * 2. Redistributions in binary form must reproduce the above copyright |
| 11 | * notice, this list of conditions and the following disclaimer in the |
| 12 | * documentation and/or other materials provided with the distribution. |
| 13 | * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of |
| 14 | * its contributors may be used to endorse or promote products derived |
| 15 | * from this software without specific prior written permission. |
| 16 | * |
| 17 | * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY |
| 18 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
| 19 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 20 | * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY |
| 21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
| 22 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
| 23 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
| 24 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
| 26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 | */ |
| 28 | |
| 29 | #ifndef Instruction_h |
| 30 | #define Instruction_hcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/bytecode/Instruction.h:30:9`! |
| 31 | |
| 32 | #include "MacroAssembler.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/assembler/MacroAssembler.h`/ |
| 33 | #include "Opcode.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/bytecode/Opcode.h`/ |
| 34 | #include "Structure.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Structure.h`/ |
| 35 | #include "StructureChain.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/runtime/StructureChain.h`/ |
| 36 | #include <wtf/VectorTraits.h>cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/wtf/VectorTraits.h`/ |
| 37 | |
| 38 | #define POLYMORPHIC_LIST_CACHE_SIZEcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/bytecode/Instruction.h:38:9`! 8 |
| 39 | |
| 40 | namespace JSCcxx . . $ `<built-in>:463:9`! { |
| 41 | |
| 42 | // *Sigh*, If the JIT is enabled we need to track the stubRountine (of type CodeLocationLabel), |
| 43 | // 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 |
| 44 | // curently actually use PolymorphicAccessStructureLists, which we should). Anyway, this seems like the best |
| 45 | // solution for now - will need to something smarter if/when we actually want mixed-mode operation. |
| 46 | #if ENABLEcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h:57:9`!(JIT) |
| 47 | typedef CodeLocationLabelcxx . . $ QTJSC/CodeLocationLabel# PolymorphicAccessStructureListStubRoutineTypecxx . . $ QTJSC/PolymorphicAccessStructureListStubRoutineType#; |
| 48 | #else |
| 49 | typedef void* PolymorphicAccessStructureListStubRoutineType; |
| 50 | #endif |
| 51 | |
| 52 | class JSCellcxx . . $ QTJSC/JSCell#; |
| 53 | class Structurecxx . . $ QTJSC/Structure#; |
| 54 | class StructureChaincxx . . $ QTJSC/StructureChain#; |
| 55 | |
| 56 | // 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. |
| 57 | struct PolymorphicAccessStructureListcxx . . $ QTJSC/PolymorphicAccessStructureList# : FastAllocBasecxx . . $ FastAllocBase# { |
| 58 | struct PolymorphicStubInfocxx . . $ QTJSC/PolymorphicAccessStructureList#PolymorphicStubInfo# { |
| 59 | bool isChaincxx . . $ QTJSC/PolymorphicAccessStructureList#PolymorphicStubInfo#isChain.; |
| 60 | PolymorphicAccessStructureListStubRoutineTypecxx . . $ QTJSC/PolymorphicAccessStructureListStubRoutineType# stubRoutinecxx . . $ QTJSC/PolymorphicAccessStructureList#PolymorphicStubInfo#stubRoutine.; |
| 61 | Structurecxx . . $ QTJSC/Structure#* basecxx . . $ QTJSC/PolymorphicAccessStructureList#PolymorphicStubInfo#base.; |
| 62 | unioncxx . . $ QTJSC/PolymorphicAccessStructureList#PolymorphicStubInfo#$anonymous_type_0# { |
| 63 | Structurecxx . . $ QTJSC/Structure#* protocxx . . $ QTJSC/PolymorphicAccessStructureList#PolymorphicStubInfo#$anonymous_type_0#proto.; |
| 64 | StructureChaincxx . . $ QTJSC/StructureChain#* chaincxx . . $ QTJSC/PolymorphicAccessStructureList#PolymorphicStubInfo#$anonymous_type_0#chain.; |
| 65 | } ucxx . . $ QTJSC/PolymorphicAccessStructureList#PolymorphicStubInfo#u.; |
| 66 | |
| 67 | void setcxx . . $ QTJSC/PolymorphicAccessStructureList#PolymorphicStubInfo#set(9a9c6f9b0a6d4439).(PolymorphicAccessStructureListStubRoutineTypecxx . . $ QTJSC/PolymorphicAccessStructureListStubRoutineType# _stubRoutine, Structurecxx . . $ QTJSC/Structure#* _base) |
| 68 | { |
| 69 | stubRoutinecxx . . $ QTJSC/PolymorphicAccessStructureList#PolymorphicStubInfo#stubRoutine. =cxx . . $ QTJSC/CodeLocationLabel#`operator=`(e826e8306788b997). _stubRoutine; |
| 70 | basecxx . . $ QTJSC/PolymorphicAccessStructureList#PolymorphicStubInfo#base. = _base; |
| 71 | ucxx . . $ QTJSC/PolymorphicAccessStructureList#PolymorphicStubInfo#u..protocxx . . $ QTJSC/PolymorphicAccessStructureList#PolymorphicStubInfo#$anonymous_type_0#proto. = 0; |
| 72 | isChaincxx . . $ QTJSC/PolymorphicAccessStructureList#PolymorphicStubInfo#isChain. = false; |
| 73 | } |
| 74 | |
| 75 | void setcxx . . $ QTJSC/PolymorphicAccessStructureList#PolymorphicStubInfo#set(51b059db5b1f45c3).(PolymorphicAccessStructureListStubRoutineTypecxx . . $ QTJSC/PolymorphicAccessStructureListStubRoutineType# _stubRoutine, Structurecxx . . $ QTJSC/Structure#* _base, Structurecxx . . $ QTJSC/Structure#* _proto) |
| 76 | { |
| 77 | stubRoutinecxx . . $ QTJSC/PolymorphicAccessStructureList#PolymorphicStubInfo#stubRoutine. =cxx . . $ QTJSC/CodeLocationLabel#`operator=`(e826e8306788b997). _stubRoutine; |
| 78 | basecxx . . $ QTJSC/PolymorphicAccessStructureList#PolymorphicStubInfo#base. = _base; |
| 79 | ucxx . . $ QTJSC/PolymorphicAccessStructureList#PolymorphicStubInfo#u..protocxx . . $ QTJSC/PolymorphicAccessStructureList#PolymorphicStubInfo#$anonymous_type_0#proto. = _proto; |
| 80 | isChaincxx . . $ QTJSC/PolymorphicAccessStructureList#PolymorphicStubInfo#isChain. = false; |
| 81 | } |
| 82 | |
| 83 | void setcxx . . $ QTJSC/PolymorphicAccessStructureList#PolymorphicStubInfo#set(78847568bb0cbb9e).(PolymorphicAccessStructureListStubRoutineTypecxx . . $ QTJSC/PolymorphicAccessStructureListStubRoutineType# _stubRoutine, Structurecxx . . $ QTJSC/Structure#* _base, StructureChaincxx . . $ QTJSC/StructureChain#* _chain) |
| 84 | { |
| 85 | stubRoutinecxx . . $ QTJSC/PolymorphicAccessStructureList#PolymorphicStubInfo#stubRoutine. =cxx . . $ QTJSC/CodeLocationLabel#`operator=`(e826e8306788b997). _stubRoutine; |
| 86 | basecxx . . $ QTJSC/PolymorphicAccessStructureList#PolymorphicStubInfo#base. = _base; |
| 87 | ucxx . . $ QTJSC/PolymorphicAccessStructureList#PolymorphicStubInfo#u..chaincxx . . $ QTJSC/PolymorphicAccessStructureList#PolymorphicStubInfo#$anonymous_type_0#chain. = _chain; |
| 88 | isChaincxx . . $ QTJSC/PolymorphicAccessStructureList#PolymorphicStubInfo#isChain. = true; |
| 89 | } |
| 90 | } listcxx . . $ QTJSC/PolymorphicAccessStructureList#list.[POLYMORPHIC_LIST_CACHE_SIZEcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/bytecode/Instruction.h:38:9`!]; |
| 91 | |
| 92 | PolymorphicAccessStructureListcxx . . $ QTJSC/PolymorphicAccessStructureList#PolymorphicAccessStructureList(9a9c6f9b0a6d4439).(PolymorphicAccessStructureListStubRoutineTypecxx . . $ QTJSC/PolymorphicAccessStructureListStubRoutineType# stubRoutine, Structurecxx . . $ QTJSC/Structure#* firstBase) |
| 93 | { |
| 94 | listcxx . . $ QTJSC/PolymorphicAccessStructureList#list.[0].setcxx . . $ QTJSC/PolymorphicAccessStructureList#PolymorphicStubInfo#set(9a9c6f9b0a6d4439).(stubRoutine, firstBase); |
| 95 | } |
| 96 | |
| 97 | PolymorphicAccessStructureListcxx . . $ QTJSC/PolymorphicAccessStructureList#PolymorphicAccessStructureList(51b059db5b1f45c3).(PolymorphicAccessStructureListStubRoutineTypecxx . . $ QTJSC/PolymorphicAccessStructureListStubRoutineType# stubRoutine, Structurecxx . . $ QTJSC/Structure#* firstBase, Structurecxx . . $ QTJSC/Structure#* firstProto) |
| 98 | { |
| 99 | listcxx . . $ QTJSC/PolymorphicAccessStructureList#list.[0].setcxx . . $ QTJSC/PolymorphicAccessStructureList#PolymorphicStubInfo#set(51b059db5b1f45c3).(stubRoutine, firstBase, firstProto); |
| 100 | } |
| 101 | |
| 102 | PolymorphicAccessStructureListcxx . . $ QTJSC/PolymorphicAccessStructureList#PolymorphicAccessStructureList(78847568bb0cbb9e).(PolymorphicAccessStructureListStubRoutineTypecxx . . $ QTJSC/PolymorphicAccessStructureListStubRoutineType# stubRoutine, Structurecxx . . $ QTJSC/Structure#* firstBase, StructureChaincxx . . $ QTJSC/StructureChain#* firstChain) |
| 103 | { |
| 104 | listcxx . . $ QTJSC/PolymorphicAccessStructureList#list.[0].setcxx . . $ QTJSC/PolymorphicAccessStructureList#PolymorphicStubInfo#set(78847568bb0cbb9e).(stubRoutine, firstBase, firstChain); |
| 105 | } |
| 106 | |
| 107 | void derefStructurescxx . . $ QTJSC/PolymorphicAccessStructureList#derefStructures(d4f767463ce0a6b3).(int count) |
| 108 | { |
| 109 | for (int i = 0; i < count; ++i) { |
| 110 | PolymorphicStubInfocxx . . $ QTJSC/PolymorphicAccessStructureList#PolymorphicStubInfo#& info = listcxx . . $ QTJSC/PolymorphicAccessStructureList#list.[i]; |
| 111 | |
| 112 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(info.base); |
| 113 | info.basecxx . . $ QTJSC/PolymorphicAccessStructureList#PolymorphicStubInfo#base.->deref(); |
| 114 | |
| 115 | if (info.ucxx . . $ QTJSC/PolymorphicAccessStructureList#PolymorphicStubInfo#u..protocxx . . $ QTJSC/PolymorphicAccessStructureList#PolymorphicStubInfo#$anonymous_type_0#proto.) { |
| 116 | if (info.isChaincxx . . $ QTJSC/PolymorphicAccessStructureList#PolymorphicStubInfo#isChain.) |
| 117 | info.ucxx . . $ QTJSC/PolymorphicAccessStructureList#PolymorphicStubInfo#u..chaincxx . . $ QTJSC/PolymorphicAccessStructureList#PolymorphicStubInfo#$anonymous_type_0#chain.->deref(); |
| 118 | else |
| 119 | info.ucxx . . $ QTJSC/PolymorphicAccessStructureList#PolymorphicStubInfo#u..protocxx . . $ QTJSC/PolymorphicAccessStructureList#PolymorphicStubInfo#$anonymous_type_0#proto.->deref(); |
| 120 | } |
| 121 | } |
| 122 | } |
| 123 | }; |
| 124 | |
| 125 | struct Instructioncxx . . $ QTJSC/Instruction# { |
| 126 | Instructioncxx . . $ QTJSC/Instruction#Instruction(a81355e90ec84b8c).(Opcodecxx . . $ QTJSC/Opcode# opcode) |
| 127 | { |
| 128 | #if !HAVEcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h:46:9`!(COMPUTED_GOTO) |
| 129 | // We have to initialize one of the pointer members to ensure that |
| 130 | // the entire struct is initialized, when opcode is not a pointer. |
| 131 | ucxx . . $ QTJSC/Instruction#u..jsCellcxx . . $ QTJSC/Instruction#$anonymous_type_1#jsCell. = 0; |
| 132 | #endif |
| 133 | ucxx . . $ QTJSC/Instruction#u..opcodecxx . . $ QTJSC/Instruction#$anonymous_type_1#opcode. = opcode; |
| 134 | } |
| 135 | |
| 136 | Instructioncxx . . $ QTJSC/Instruction#Instruction(d4f767463ce0a6b3).(int operand) |
| 137 | { |
| 138 | // We have to initialize one of the pointer members to ensure that |
| 139 | // the entire struct is initialized in 64-bit. |
| 140 | ucxx . . $ QTJSC/Instruction#u..jsCellcxx . . $ QTJSC/Instruction#$anonymous_type_1#jsCell. = 0; |
| 141 | ucxx . . $ QTJSC/Instruction#u..operandcxx . . $ QTJSC/Instruction#$anonymous_type_1#operand. = operand; |
| 142 | } |
| 143 | |
| 144 | Instructioncxx . . $ QTJSC/Instruction#Instruction(32e4947f9059a24a).(Structurecxx . . $ QTJSC/Structure#* structure) { ucxx . . $ QTJSC/Instruction#u..structurecxx . . $ QTJSC/Instruction#$anonymous_type_1#structure. = structure; } |
| 145 | Instructioncxx . . $ QTJSC/Instruction#Instruction(7c0226cede3bf439).(StructureChaincxx . . $ QTJSC/StructureChain#* structureChain) { ucxx . . $ QTJSC/Instruction#u..structureChaincxx . . $ QTJSC/Instruction#$anonymous_type_1#structureChain. = structureChain; } |
| 146 | Instructioncxx . . $ QTJSC/Instruction#Instruction(c6d88d3bdacccd64).(JSCellcxx . . $ QTJSC/JSCell#* jsCell) { ucxx . . $ QTJSC/Instruction#u..jsCellcxx . . $ QTJSC/Instruction#$anonymous_type_1#jsCell. = jsCell; } |
| 147 | Instructioncxx . . $ QTJSC/Instruction#Instruction(5baafb6dfa24d72).(PolymorphicAccessStructureListcxx . . $ QTJSC/PolymorphicAccessStructureList#* polymorphicStructures) { ucxx . . $ QTJSC/Instruction#u..polymorphicStructurescxx . . $ QTJSC/Instruction#$anonymous_type_1#polymorphicStructures. = polymorphicStructures; } |
| 148 | |
| 149 | unioncxx . . $ QTJSC/Instruction#$anonymous_type_1# { |
| 150 | Opcodecxx . . $ QTJSC/Opcode# opcodecxx . . $ QTJSC/Instruction#$anonymous_type_1#opcode.; |
| 151 | int operandcxx . . $ QTJSC/Instruction#$anonymous_type_1#operand.; |
| 152 | Structurecxx . . $ QTJSC/Structure#* structurecxx . . $ QTJSC/Instruction#$anonymous_type_1#structure.; |
| 153 | StructureChaincxx . . $ QTJSC/StructureChain#* structureChaincxx . . $ QTJSC/Instruction#$anonymous_type_1#structureChain.; |
| 154 | JSCellcxx . . $ QTJSC/JSCell#* jsCellcxx . . $ QTJSC/Instruction#$anonymous_type_1#jsCell.; |
| 155 | PolymorphicAccessStructureListcxx . . $ QTJSC/PolymorphicAccessStructureList#* polymorphicStructurescxx . . $ QTJSC/Instruction#$anonymous_type_1#polymorphicStructures.; |
| 156 | } ucxx . . $ QTJSC/Instruction#u.; |
| 157 | }; |
| 158 | |
| 159 | } // namespace JSC |
| 160 | |
| 161 | namespace WTFcxx . . $ `<built-in>:467:9`! { |
| 162 | |
| 163 | template<> struct VectorTraitscxx . . $ QTWTF/VectorTraits#<JSCcxx . . $ `<built-in>:463:9`!::Instructioncxx . . $ QTJSC/Instruction#> : VectorTraitsBase<true, JSCcxx . . $ `<built-in>:463:9`!::Instruction> { }; |
| 164 | |
| 165 | } // namespace WTF |
| 166 | |
| 167 | #endif // Instruction_h |