2 * Copyright (C) 2008, 2012-2015 Apple Inc. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
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 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.
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.
32 #include "BasicBlockLocation.h"
33 #include "MacroAssembler.h"
35 #include "SymbolTable.h"
36 #include "TypeLocation.h"
37 #include "PropertySlot.h"
38 #include "SpecialPointer.h"
39 #include "Structure.h"
40 #include "StructureChain.h"
41 #include "ToThisStatus.h"
42 #include "VirtualRegister.h"
43 #include <wtf/VectorTraits.h>
47 class ArrayAllocationProfile
;
49 class ObjectAllocationProfile
;
51 struct LLIntCallLinkInfo
;
60 Instruction(Opcode opcode
)
62 #if !ENABLE(COMPUTED_GOTO_OPCODES)
63 // We have to initialize one of the pointer members to ensure that
64 // the entire struct is initialized, when opcode is not a pointer.
70 Instruction(int operand
)
72 // We have to initialize one of the pointer members to ensure that
73 // the entire struct is initialized in 64-bit.
78 Instruction(VM
& vm
, JSCell
* owner
, Structure
* structure
)
81 u
.structure
.set(vm
, owner
, structure
);
83 Instruction(VM
& vm
, JSCell
* owner
, StructureChain
* structureChain
)
85 u
.structureChain
.clear();
86 u
.structureChain
.set(vm
, owner
, structureChain
);
88 Instruction(VM
& vm
, JSCell
* owner
, JSCell
* jsCell
)
91 u
.jsCell
.set(vm
, owner
, jsCell
);
94 Instruction(PropertySlot::GetValueFunc getterFunc
) { u
.getterFunc
= getterFunc
; }
96 Instruction(LLIntCallLinkInfo
* callLinkInfo
) { u
.callLinkInfo
= callLinkInfo
; }
97 Instruction(ValueProfile
* profile
) { u
.profile
= profile
; }
98 Instruction(ArrayProfile
* profile
) { u
.arrayProfile
= profile
; }
99 Instruction(ArrayAllocationProfile
* profile
) { u
.arrayAllocationProfile
= profile
; }
100 Instruction(ObjectAllocationProfile
* profile
) { u
.objectAllocationProfile
= profile
; }
101 Instruction(WriteBarrier
<Unknown
>* variablePointer
) { u
.variablePointer
= variablePointer
; }
102 Instruction(Special::Pointer pointer
) { u
.specialPointer
= pointer
; }
103 Instruction(UniquedStringImpl
* uid
) { u
.uid
= uid
; }
104 Instruction(bool* predicatePointer
) { u
.predicatePointer
= predicatePointer
; }
109 WriteBarrierBase
<Structure
> structure
;
110 WriteBarrierBase
<SymbolTable
> symbolTable
;
111 WriteBarrierBase
<StructureChain
> structureChain
;
112 WriteBarrierBase
<JSCell
> jsCell
;
113 WriteBarrier
<Unknown
>* variablePointer
;
114 Special::Pointer specialPointer
;
115 PropertySlot::GetValueFunc getterFunc
;
116 LLIntCallLinkInfo
* callLinkInfo
;
117 UniquedStringImpl
* uid
;
118 ValueProfile
* profile
;
119 ArrayProfile
* arrayProfile
;
120 ArrayAllocationProfile
* arrayAllocationProfile
;
121 ObjectAllocationProfile
* objectAllocationProfile
;
122 WatchpointSet
* watchpointSet
;
124 bool* predicatePointer
;
125 ToThisStatus toThisStatus
;
126 TypeLocation
* location
;
127 BasicBlockLocation
* basicBlockLocation
;
131 Instruction(StructureChain
*);
132 Instruction(Structure
*);
139 template<> struct VectorTraits
<JSC::Instruction
> : VectorTraitsBase
<true, JSC::Instruction
> { };
143 #endif // Instruction_h