]>
git.saurik.com Git - apple/javascriptcore.git/blob - bytecode/Instruction.h
ca457758c459442bcbd1494aacd9d51553ae27e8
2 * Copyright (C) 2008, 2012, 2013 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 "MacroAssembler.h"
34 #include "PropertySlot.h"
35 #include "SpecialPointer.h"
36 #include "Structure.h"
37 #include "StructureChain.h"
38 #include "VirtualRegister.h"
39 #include <wtf/VectorTraits.h>
43 class ArrayAllocationProfile
;
45 class ObjectAllocationProfile
;
46 class VariableWatchpointSet
;
47 struct LLIntCallLinkInfo
;
56 Instruction(Opcode opcode
)
58 #if !ENABLE(COMPUTED_GOTO_OPCODES)
59 // We have to initialize one of the pointer members to ensure that
60 // the entire struct is initialized, when opcode is not a pointer.
66 Instruction(int operand
)
68 // We have to initialize one of the pointer members to ensure that
69 // the entire struct is initialized in 64-bit.
74 Instruction(VM
& vm
, JSCell
* owner
, Structure
* structure
)
77 u
.structure
.set(vm
, owner
, structure
);
79 Instruction(VM
& vm
, JSCell
* owner
, StructureChain
* structureChain
)
81 u
.structureChain
.clear();
82 u
.structureChain
.set(vm
, owner
, structureChain
);
84 Instruction(VM
& vm
, JSCell
* owner
, JSCell
* jsCell
)
87 u
.jsCell
.set(vm
, owner
, jsCell
);
90 Instruction(PropertySlot::GetValueFunc getterFunc
) { u
.getterFunc
= getterFunc
; }
92 Instruction(LLIntCallLinkInfo
* callLinkInfo
) { u
.callLinkInfo
= callLinkInfo
; }
93 Instruction(ValueProfile
* profile
) { u
.profile
= profile
; }
94 Instruction(ArrayProfile
* profile
) { u
.arrayProfile
= profile
; }
95 Instruction(ArrayAllocationProfile
* profile
) { u
.arrayAllocationProfile
= profile
; }
96 Instruction(ObjectAllocationProfile
* profile
) { u
.objectAllocationProfile
= profile
; }
97 Instruction(WriteBarrier
<Unknown
>* registerPointer
) { u
.registerPointer
= registerPointer
; }
98 Instruction(Special::Pointer pointer
) { u
.specialPointer
= pointer
; }
99 Instruction(StringImpl
* uid
) { u
.uid
= uid
; }
100 Instruction(bool* predicatePointer
) { u
.predicatePointer
= predicatePointer
; }
105 WriteBarrierBase
<Structure
> structure
;
106 WriteBarrierBase
<StructureChain
> structureChain
;
107 WriteBarrierBase
<JSCell
> jsCell
;
108 WriteBarrier
<Unknown
>* registerPointer
;
109 Special::Pointer specialPointer
;
110 PropertySlot::GetValueFunc getterFunc
;
111 LLIntCallLinkInfo
* callLinkInfo
;
113 ValueProfile
* profile
;
114 ArrayProfile
* arrayProfile
;
115 ArrayAllocationProfile
* arrayAllocationProfile
;
116 ObjectAllocationProfile
* objectAllocationProfile
;
117 VariableWatchpointSet
* watchpointSet
;
118 WriteBarrierBase
<JSActivation
> activation
;
120 bool* predicatePointer
;
124 Instruction(StructureChain
*);
125 Instruction(Structure
*);
132 template<> struct VectorTraits
<JSC::Instruction
> : VectorTraitsBase
<true, JSC::Instruction
> { };
136 #endif // Instruction_h