]>
git.saurik.com Git - apple/javascriptcore.git/blob - bytecode/Instruction.h
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 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.
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 "ResolveOperation.h"
36 #include "SpecialPointer.h"
37 #include "Structure.h"
38 #include "StructureChain.h"
39 #include <wtf/VectorTraits.h>
43 class ArrayAllocationProfile
;
45 class ObjectAllocationProfile
;
46 struct LLIntCallLinkInfo
;
55 Instruction(Opcode opcode
)
57 #if !ENABLE(COMPUTED_GOTO_OPCODES)
58 // We have to initialize one of the pointer members to ensure that
59 // the entire struct is initialized, when opcode is not a pointer.
65 Instruction(int operand
)
67 // We have to initialize one of the pointer members to ensure that
68 // the entire struct is initialized in 64-bit.
73 Instruction(VM
& vm
, JSCell
* owner
, Structure
* structure
)
76 u
.structure
.set(vm
, owner
, structure
);
78 Instruction(VM
& vm
, JSCell
* owner
, StructureChain
* structureChain
)
80 u
.structureChain
.clear();
81 u
.structureChain
.set(vm
, owner
, structureChain
);
83 Instruction(VM
& vm
, JSCell
* owner
, JSCell
* jsCell
)
86 u
.jsCell
.set(vm
, owner
, jsCell
);
89 Instruction(PropertySlot::GetValueFunc getterFunc
) { u
.getterFunc
= getterFunc
; }
91 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
; }
98 Instruction(WriteBarrier
<Unknown
>* registerPointer
) { u
.registerPointer
= registerPointer
; }
100 Instruction(Special::Pointer pointer
) { u
.specialPointer
= pointer
; }
102 Instruction(bool* predicatePointer
) { u
.predicatePointer
= predicatePointer
; }
107 WriteBarrierBase
<Structure
> structure
;
108 WriteBarrierBase
<StructureChain
> structureChain
;
109 WriteBarrierBase
<JSCell
> jsCell
;
110 WriteBarrier
<Unknown
>* registerPointer
;
111 Special::Pointer specialPointer
;
112 PropertySlot::GetValueFunc getterFunc
;
113 LLIntCallLinkInfo
* callLinkInfo
;
114 ValueProfile
* profile
;
115 ArrayProfile
* arrayProfile
;
116 ArrayAllocationProfile
* arrayAllocationProfile
;
117 ObjectAllocationProfile
* objectAllocationProfile
;
119 bool* predicatePointer
;
120 ResolveOperations
* resolveOperations
;
121 PutToBaseOperation
* putToBaseOperation
;
125 Instruction(StructureChain
*);
126 Instruction(Structure
*);
133 template<> struct VectorTraits
<JSC::Instruction
> : VectorTraitsBase
<true, JSC::Instruction
> { };
137 #endif // Instruction_h