Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Side by Side Diff: src/builtins.h

Issue 11428137: ARM: Make use of d16-d31 when available. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: . Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 19 matching lines...) Expand all
30 30
31 namespace v8 { 31 namespace v8 {
32 namespace internal { 32 namespace internal {
33 33
34 // Specifies extra arguments required by a C++ builtin. 34 // Specifies extra arguments required by a C++ builtin.
35 enum BuiltinExtraArguments { 35 enum BuiltinExtraArguments {
36 NO_EXTRA_ARGUMENTS = 0, 36 NO_EXTRA_ARGUMENTS = 0,
37 NEEDS_CALLED_FUNCTION = 1 37 NEEDS_CALLED_FUNCTION = 1
38 }; 38 };
39 39
40 // Specifies whether or not a builtin should be part of the snapshot.
41 enum InSnapshot {
42 NOT_IN_SNAPSHOT = 0,
43 IN_SNAPSHOT = 1
44 };
45
46 #if defined(V8_TARGET_ARCH_ARM)
47 #define NOT_IN_ARM_SNAPSHOT NOT_IN_SNAPSHOT
48 #else
49 #define NOT_IN_ARM_SNAPSHOT IN_SNAPSHOT
50 #endif
51
40 52
41 #define CODE_AGE_LIST_WITH_ARG(V, A) \ 53 #define CODE_AGE_LIST_WITH_ARG(V, A) \
42 V(Quadragenarian, A) \ 54 V(Quadragenarian, A) \
43 V(Quinquagenarian, A) \ 55 V(Quinquagenarian, A) \
44 V(Sexagenarian, A) \ 56 V(Sexagenarian, A) \
45 V(Septuagenarian, A) \ 57 V(Septuagenarian, A) \
46 V(Octogenarian, A) 58 V(Octogenarian, A)
47 59
48 #define CODE_AGE_LIST_IGNORE_ARG(X, V) V(X) 60 #define CODE_AGE_LIST_IGNORE_ARG(X, V) V(X)
49 61
50 #define CODE_AGE_LIST(V) \ 62 #define CODE_AGE_LIST(V) \
51 CODE_AGE_LIST_WITH_ARG(CODE_AGE_LIST_IGNORE_ARG, V) 63 CODE_AGE_LIST_WITH_ARG(CODE_AGE_LIST_IGNORE_ARG, V)
52 64
53 #define DECLARE_CODE_AGE_BUILTIN(C, V) \ 65 #define DECLARE_CODE_AGE_BUILTIN(C, V) \
54 V(Make##C##CodeYoungAgainOddMarking, BUILTIN, \ 66 V(Make##C##CodeYoungAgainOddMarking, BUILTIN, \
55 UNINITIALIZED, Code::kNoExtraICState) \ 67 UNINITIALIZED, Code::kNoExtraICState, IN_SNAPSHOT) \
56 V(Make##C##CodeYoungAgainEvenMarking, BUILTIN, \ 68 V(Make##C##CodeYoungAgainEvenMarking, BUILTIN, \
57 UNINITIALIZED, Code::kNoExtraICState) 69 UNINITIALIZED, Code::kNoExtraICState, IN_SNAPSHOT)
58 70
59 71
60 // Define list of builtins implemented in C++. 72 // Define list of builtins implemented in C++.
61 #define BUILTIN_LIST_C(V) \ 73 #define BUILTIN_LIST_C(V) \
62 V(Illegal, NO_EXTRA_ARGUMENTS) \ 74 V(Illegal, NO_EXTRA_ARGUMENTS) \
63 \ 75 \
64 V(EmptyFunction, NO_EXTRA_ARGUMENTS) \ 76 V(EmptyFunction, NO_EXTRA_ARGUMENTS) \
65 \ 77 \
66 V(InternalArrayCodeGeneric, NO_EXTRA_ARGUMENTS) \ 78 V(InternalArrayCodeGeneric, NO_EXTRA_ARGUMENTS) \
67 V(ArrayCodeGeneric, NO_EXTRA_ARGUMENTS) \ 79 V(ArrayCodeGeneric, NO_EXTRA_ARGUMENTS) \
68 \ 80 \
69 V(ArrayPush, NO_EXTRA_ARGUMENTS) \ 81 V(ArrayPush, NO_EXTRA_ARGUMENTS) \
70 V(ArrayPop, NO_EXTRA_ARGUMENTS) \ 82 V(ArrayPop, NO_EXTRA_ARGUMENTS) \
71 V(ArrayShift, NO_EXTRA_ARGUMENTS) \ 83 V(ArrayShift, NO_EXTRA_ARGUMENTS) \
72 V(ArrayUnshift, NO_EXTRA_ARGUMENTS) \ 84 V(ArrayUnshift, NO_EXTRA_ARGUMENTS) \
73 V(ArraySlice, NO_EXTRA_ARGUMENTS) \ 85 V(ArraySlice, NO_EXTRA_ARGUMENTS) \
74 V(ArraySplice, NO_EXTRA_ARGUMENTS) \ 86 V(ArraySplice, NO_EXTRA_ARGUMENTS) \
75 V(ArrayConcat, NO_EXTRA_ARGUMENTS) \ 87 V(ArrayConcat, NO_EXTRA_ARGUMENTS) \
76 \ 88 \
77 V(HandleApiCall, NEEDS_CALLED_FUNCTION) \ 89 V(HandleApiCall, NEEDS_CALLED_FUNCTION) \
78 V(HandleApiCallConstruct, NEEDS_CALLED_FUNCTION) \ 90 V(HandleApiCallConstruct, NEEDS_CALLED_FUNCTION) \
79 V(HandleApiCallAsFunction, NO_EXTRA_ARGUMENTS) \ 91 V(HandleApiCallAsFunction, NO_EXTRA_ARGUMENTS) \
80 V(HandleApiCallAsConstructor, NO_EXTRA_ARGUMENTS) \ 92 V(HandleApiCallAsConstructor, NO_EXTRA_ARGUMENTS) \
81 \ 93 \
82 V(StrictModePoisonPill, NO_EXTRA_ARGUMENTS) 94 V(StrictModePoisonPill, NO_EXTRA_ARGUMENTS)
83 95
84 // Define list of builtins implemented in assembly. 96 // Define list of builtins implemented in assembly.
85 #define BUILTIN_LIST_A(V) \ 97 #define BUILTIN_LIST_A(V) \
86 V(ArgumentsAdaptorTrampoline, BUILTIN, UNINITIALIZED, \ 98 V(ArgumentsAdaptorTrampoline, BUILTIN, UNINITIALIZED, \
87 Code::kNoExtraICState) \ 99 Code::kNoExtraICState, \
100 IN_SNAPSHOT) \
88 V(InRecompileQueue, BUILTIN, UNINITIALIZED, \ 101 V(InRecompileQueue, BUILTIN, UNINITIALIZED, \
89 Code::kNoExtraICState) \ 102 Code::kNoExtraICState, \
103 IN_SNAPSHOT) \
90 V(JSConstructStubCountdown, BUILTIN, UNINITIALIZED, \ 104 V(JSConstructStubCountdown, BUILTIN, UNINITIALIZED, \
91 Code::kNoExtraICState) \ 105 Code::kNoExtraICState, \
106 IN_SNAPSHOT) \
92 V(JSConstructStubGeneric, BUILTIN, UNINITIALIZED, \ 107 V(JSConstructStubGeneric, BUILTIN, UNINITIALIZED, \
93 Code::kNoExtraICState) \ 108 Code::kNoExtraICState, \
109 IN_SNAPSHOT) \
94 V(JSConstructStubApi, BUILTIN, UNINITIALIZED, \ 110 V(JSConstructStubApi, BUILTIN, UNINITIALIZED, \
95 Code::kNoExtraICState) \ 111 Code::kNoExtraICState, \
112 IN_SNAPSHOT) \
96 V(JSEntryTrampoline, BUILTIN, UNINITIALIZED, \ 113 V(JSEntryTrampoline, BUILTIN, UNINITIALIZED, \
97 Code::kNoExtraICState) \ 114 Code::kNoExtraICState, \
115 IN_SNAPSHOT) \
98 V(JSConstructEntryTrampoline, BUILTIN, UNINITIALIZED, \ 116 V(JSConstructEntryTrampoline, BUILTIN, UNINITIALIZED, \
99 Code::kNoExtraICState) \ 117 Code::kNoExtraICState, \
118 IN_SNAPSHOT) \
100 V(LazyCompile, BUILTIN, UNINITIALIZED, \ 119 V(LazyCompile, BUILTIN, UNINITIALIZED, \
101 Code::kNoExtraICState) \ 120 Code::kNoExtraICState, \
121 IN_SNAPSHOT) \
102 V(LazyRecompile, BUILTIN, UNINITIALIZED, \ 122 V(LazyRecompile, BUILTIN, UNINITIALIZED, \
103 Code::kNoExtraICState) \ 123 Code::kNoExtraICState, \
124 IN_SNAPSHOT) \
104 V(ParallelRecompile, BUILTIN, UNINITIALIZED, \ 125 V(ParallelRecompile, BUILTIN, UNINITIALIZED, \
105 Code::kNoExtraICState) \ 126 Code::kNoExtraICState, \
127 IN_SNAPSHOT) \
106 V(NotifyDeoptimized, BUILTIN, UNINITIALIZED, \ 128 V(NotifyDeoptimized, BUILTIN, UNINITIALIZED, \
107 Code::kNoExtraICState) \ 129 Code::kNoExtraICState, \
130 IN_SNAPSHOT) \
108 V(NotifyLazyDeoptimized, BUILTIN, UNINITIALIZED, \ 131 V(NotifyLazyDeoptimized, BUILTIN, UNINITIALIZED, \
109 Code::kNoExtraICState) \ 132 Code::kNoExtraICState, \
133 IN_SNAPSHOT) \
110 V(NotifyOSR, BUILTIN, UNINITIALIZED, \ 134 V(NotifyOSR, BUILTIN, UNINITIALIZED, \
111 Code::kNoExtraICState) \ 135 Code::kNoExtraICState, \
136 IN_SNAPSHOT) \
112 \ 137 \
113 V(LoadIC_Miss, BUILTIN, UNINITIALIZED, \ 138 V(LoadIC_Miss, BUILTIN, UNINITIALIZED, \
114 Code::kNoExtraICState) \ 139 Code::kNoExtraICState, \
140 IN_SNAPSHOT) \
115 V(KeyedLoadIC_Miss, BUILTIN, UNINITIALIZED, \ 141 V(KeyedLoadIC_Miss, BUILTIN, UNINITIALIZED, \
116 Code::kNoExtraICState) \ 142 Code::kNoExtraICState, \
143 IN_SNAPSHOT) \
117 V(KeyedLoadIC_MissForceGeneric, BUILTIN, UNINITIALIZED, \ 144 V(KeyedLoadIC_MissForceGeneric, BUILTIN, UNINITIALIZED, \
118 Code::kNoExtraICState) \ 145 Code::kNoExtraICState, \
146 IN_SNAPSHOT) \
119 V(KeyedLoadIC_Slow, BUILTIN, UNINITIALIZED, \ 147 V(KeyedLoadIC_Slow, BUILTIN, UNINITIALIZED, \
120 Code::kNoExtraICState) \ 148 Code::kNoExtraICState, \
149 IN_SNAPSHOT) \
121 V(StoreIC_Miss, BUILTIN, UNINITIALIZED, \ 150 V(StoreIC_Miss, BUILTIN, UNINITIALIZED, \
122 Code::kNoExtraICState) \ 151 Code::kNoExtraICState, \
152 IN_SNAPSHOT) \
123 V(KeyedStoreIC_Miss, BUILTIN, UNINITIALIZED, \ 153 V(KeyedStoreIC_Miss, BUILTIN, UNINITIALIZED, \
124 Code::kNoExtraICState) \ 154 Code::kNoExtraICState, \
155 IN_SNAPSHOT) \
125 V(KeyedStoreIC_MissForceGeneric, BUILTIN, UNINITIALIZED, \ 156 V(KeyedStoreIC_MissForceGeneric, BUILTIN, UNINITIALIZED, \
126 Code::kNoExtraICState) \ 157 Code::kNoExtraICState, \
158 IN_SNAPSHOT) \
127 V(KeyedStoreIC_Slow, BUILTIN, UNINITIALIZED, \ 159 V(KeyedStoreIC_Slow, BUILTIN, UNINITIALIZED, \
128 Code::kNoExtraICState) \ 160 Code::kNoExtraICState, \
161 IN_SNAPSHOT) \
129 V(LoadIC_Initialize, LOAD_IC, UNINITIALIZED, \ 162 V(LoadIC_Initialize, LOAD_IC, UNINITIALIZED, \
130 Code::kNoExtraICState) \ 163 Code::kNoExtraICState, \
164 IN_SNAPSHOT) \
131 V(LoadIC_PreMonomorphic, LOAD_IC, PREMONOMORPHIC, \ 165 V(LoadIC_PreMonomorphic, LOAD_IC, PREMONOMORPHIC, \
132 Code::kNoExtraICState) \ 166 Code::kNoExtraICState, \
167 IN_SNAPSHOT) \
133 V(LoadIC_Normal, LOAD_IC, MONOMORPHIC, \ 168 V(LoadIC_Normal, LOAD_IC, MONOMORPHIC, \
134 Code::kNoExtraICState) \ 169 Code::kNoExtraICState, \
170 IN_SNAPSHOT) \
135 V(LoadIC_ArrayLength, LOAD_IC, MONOMORPHIC, \ 171 V(LoadIC_ArrayLength, LOAD_IC, MONOMORPHIC, \
136 Code::kNoExtraICState) \ 172 Code::kNoExtraICState, \
173 IN_SNAPSHOT) \
137 V(LoadIC_StringLength, LOAD_IC, MONOMORPHIC, \ 174 V(LoadIC_StringLength, LOAD_IC, MONOMORPHIC, \
138 Code::kNoExtraICState) \ 175 Code::kNoExtraICState, \
176 IN_SNAPSHOT) \
139 V(LoadIC_StringWrapperLength, LOAD_IC, MONOMORPHIC, \ 177 V(LoadIC_StringWrapperLength, LOAD_IC, MONOMORPHIC, \
140 Code::kNoExtraICState) \ 178 Code::kNoExtraICState, \
179 IN_SNAPSHOT) \
141 V(LoadIC_FunctionPrototype, LOAD_IC, MONOMORPHIC, \ 180 V(LoadIC_FunctionPrototype, LOAD_IC, MONOMORPHIC, \
142 Code::kNoExtraICState) \ 181 Code::kNoExtraICState, \
182 IN_SNAPSHOT) \
143 V(LoadIC_Megamorphic, LOAD_IC, MEGAMORPHIC, \ 183 V(LoadIC_Megamorphic, LOAD_IC, MEGAMORPHIC, \
144 Code::kNoExtraICState) \ 184 Code::kNoExtraICState, \
185 IN_SNAPSHOT) \
145 V(LoadIC_Getter_ForDeopt, LOAD_IC, MONOMORPHIC, \ 186 V(LoadIC_Getter_ForDeopt, LOAD_IC, MONOMORPHIC, \
146 Code::kNoExtraICState) \ 187 Code::kNoExtraICState, \
188 IN_SNAPSHOT) \
147 \ 189 \
148 V(KeyedLoadIC_Initialize, KEYED_LOAD_IC, UNINITIALIZED, \ 190 V(KeyedLoadIC_Initialize, KEYED_LOAD_IC, UNINITIALIZED, \
149 Code::kNoExtraICState) \ 191 Code::kNoExtraICState, \
192 IN_SNAPSHOT) \
150 V(KeyedLoadIC_PreMonomorphic, KEYED_LOAD_IC, PREMONOMORPHIC, \ 193 V(KeyedLoadIC_PreMonomorphic, KEYED_LOAD_IC, PREMONOMORPHIC, \
151 Code::kNoExtraICState) \ 194 Code::kNoExtraICState, \
195 IN_SNAPSHOT) \
152 V(KeyedLoadIC_Generic, KEYED_LOAD_IC, MEGAMORPHIC, \ 196 V(KeyedLoadIC_Generic, KEYED_LOAD_IC, MEGAMORPHIC, \
153 Code::kNoExtraICState) \ 197 Code::kNoExtraICState, \
198 IN_SNAPSHOT) \
154 V(KeyedLoadIC_String, KEYED_LOAD_IC, MEGAMORPHIC, \ 199 V(KeyedLoadIC_String, KEYED_LOAD_IC, MEGAMORPHIC, \
155 Code::kNoExtraICState) \ 200 Code::kNoExtraICState, \
201 IN_SNAPSHOT) \
156 V(KeyedLoadIC_IndexedInterceptor, KEYED_LOAD_IC, MEGAMORPHIC, \ 202 V(KeyedLoadIC_IndexedInterceptor, KEYED_LOAD_IC, MEGAMORPHIC, \
157 Code::kNoExtraICState) \ 203 Code::kNoExtraICState, \
204 IN_SNAPSHOT) \
158 V(KeyedLoadIC_NonStrictArguments, KEYED_LOAD_IC, MEGAMORPHIC, \ 205 V(KeyedLoadIC_NonStrictArguments, KEYED_LOAD_IC, MEGAMORPHIC, \
159 Code::kNoExtraICState) \ 206 Code::kNoExtraICState, \
207 IN_SNAPSHOT) \
160 \ 208 \
161 V(StoreIC_Initialize, STORE_IC, UNINITIALIZED, \ 209 V(StoreIC_Initialize, STORE_IC, UNINITIALIZED, \
162 Code::kNoExtraICState) \ 210 Code::kNoExtraICState, \
211 IN_SNAPSHOT) \
163 V(StoreIC_ArrayLength, STORE_IC, MONOMORPHIC, \ 212 V(StoreIC_ArrayLength, STORE_IC, MONOMORPHIC, \
164 Code::kNoExtraICState) \ 213 Code::kNoExtraICState, \
214 IN_SNAPSHOT) \
165 V(StoreIC_Normal, STORE_IC, MONOMORPHIC, \ 215 V(StoreIC_Normal, STORE_IC, MONOMORPHIC, \
166 Code::kNoExtraICState) \ 216 Code::kNoExtraICState, \
217 IN_SNAPSHOT) \
167 V(StoreIC_Megamorphic, STORE_IC, MEGAMORPHIC, \ 218 V(StoreIC_Megamorphic, STORE_IC, MEGAMORPHIC, \
168 Code::kNoExtraICState) \ 219 Code::kNoExtraICState, \
220 IN_SNAPSHOT) \
169 V(StoreIC_GlobalProxy, STORE_IC, MEGAMORPHIC, \ 221 V(StoreIC_GlobalProxy, STORE_IC, MEGAMORPHIC, \
170 Code::kNoExtraICState) \ 222 Code::kNoExtraICState, \
223 IN_SNAPSHOT) \
171 V(StoreIC_Initialize_Strict, STORE_IC, UNINITIALIZED, \ 224 V(StoreIC_Initialize_Strict, STORE_IC, UNINITIALIZED, \
172 kStrictMode) \ 225 kStrictMode, \
226 IN_SNAPSHOT) \
173 V(StoreIC_ArrayLength_Strict, STORE_IC, MONOMORPHIC, \ 227 V(StoreIC_ArrayLength_Strict, STORE_IC, MONOMORPHIC, \
174 kStrictMode) \ 228 kStrictMode, \
229 IN_SNAPSHOT) \
175 V(StoreIC_Normal_Strict, STORE_IC, MONOMORPHIC, \ 230 V(StoreIC_Normal_Strict, STORE_IC, MONOMORPHIC, \
176 kStrictMode) \ 231 kStrictMode, \
232 IN_SNAPSHOT) \
177 V(StoreIC_Megamorphic_Strict, STORE_IC, MEGAMORPHIC, \ 233 V(StoreIC_Megamorphic_Strict, STORE_IC, MEGAMORPHIC, \
178 kStrictMode) \ 234 kStrictMode, \
235 IN_SNAPSHOT) \
179 V(StoreIC_GlobalProxy_Strict, STORE_IC, MEGAMORPHIC, \ 236 V(StoreIC_GlobalProxy_Strict, STORE_IC, MEGAMORPHIC, \
180 kStrictMode) \ 237 kStrictMode, \
238 IN_SNAPSHOT) \
181 V(StoreIC_Setter_ForDeopt, STORE_IC, MONOMORPHIC, \ 239 V(StoreIC_Setter_ForDeopt, STORE_IC, MONOMORPHIC, \
182 kStrictMode) \ 240 kStrictMode, \
241 IN_SNAPSHOT) \
183 \ 242 \
184 V(KeyedStoreIC_Initialize, KEYED_STORE_IC, UNINITIALIZED, \ 243 V(KeyedStoreIC_Initialize, KEYED_STORE_IC, UNINITIALIZED, \
185 Code::kNoExtraICState) \ 244 Code::kNoExtraICState, \
245 IN_SNAPSHOT) \
186 V(KeyedStoreIC_Generic, KEYED_STORE_IC, MEGAMORPHIC, \ 246 V(KeyedStoreIC_Generic, KEYED_STORE_IC, MEGAMORPHIC, \
187 Code::kNoExtraICState) \ 247 Code::kNoExtraICState, \
248 IN_SNAPSHOT) \
188 \ 249 \
189 V(KeyedStoreIC_Initialize_Strict, KEYED_STORE_IC, UNINITIALIZED, \ 250 V(KeyedStoreIC_Initialize_Strict, KEYED_STORE_IC, UNINITIALIZED, \
190 kStrictMode) \ 251 kStrictMode, \
252 IN_SNAPSHOT) \
191 V(KeyedStoreIC_Generic_Strict, KEYED_STORE_IC, MEGAMORPHIC, \ 253 V(KeyedStoreIC_Generic_Strict, KEYED_STORE_IC, MEGAMORPHIC, \
192 kStrictMode) \ 254 kStrictMode, \
255 IN_SNAPSHOT) \
193 V(KeyedStoreIC_NonStrictArguments, KEYED_STORE_IC, MEGAMORPHIC, \ 256 V(KeyedStoreIC_NonStrictArguments, KEYED_STORE_IC, MEGAMORPHIC, \
194 Code::kNoExtraICState) \ 257 Code::kNoExtraICState, \
258 IN_SNAPSHOT) \
195 V(TransitionElementsSmiToDouble, BUILTIN, UNINITIALIZED, \ 259 V(TransitionElementsSmiToDouble, BUILTIN, UNINITIALIZED, \
196 Code::kNoExtraICState) \ 260 Code::kNoExtraICState, \
261 IN_SNAPSHOT) \
197 V(TransitionElementsDoubleToObject, BUILTIN, UNINITIALIZED, \ 262 V(TransitionElementsDoubleToObject, BUILTIN, UNINITIALIZED, \
198 Code::kNoExtraICState) \ 263 Code::kNoExtraICState, \
264 IN_SNAPSHOT) \
199 \ 265 \
200 /* Uses KeyedLoadIC_Initialize; must be after in list. */ \ 266 /* Uses KeyedLoadIC_Initialize; must be after in list. */ \
201 V(FunctionCall, BUILTIN, UNINITIALIZED, \ 267 V(FunctionCall, BUILTIN, UNINITIALIZED, \
202 Code::kNoExtraICState) \ 268 Code::kNoExtraICState, \
269 IN_SNAPSHOT) \
203 V(FunctionApply, BUILTIN, UNINITIALIZED, \ 270 V(FunctionApply, BUILTIN, UNINITIALIZED, \
204 Code::kNoExtraICState) \ 271 Code::kNoExtraICState, \
272 IN_SNAPSHOT) \
205 \ 273 \
206 V(InternalArrayCode, BUILTIN, UNINITIALIZED, \ 274 V(InternalArrayCode, BUILTIN, UNINITIALIZED, \
207 Code::kNoExtraICState) \ 275 Code::kNoExtraICState, \
276 IN_SNAPSHOT) \
208 V(ArrayCode, BUILTIN, UNINITIALIZED, \ 277 V(ArrayCode, BUILTIN, UNINITIALIZED, \
209 Code::kNoExtraICState) \ 278 Code::kNoExtraICState, \
279 IN_SNAPSHOT) \
210 V(ArrayConstructCode, BUILTIN, UNINITIALIZED, \ 280 V(ArrayConstructCode, BUILTIN, UNINITIALIZED, \
211 Code::kNoExtraICState) \ 281 Code::kNoExtraICState, \
282 IN_SNAPSHOT) \
212 \ 283 \
213 V(StringConstructCode, BUILTIN, UNINITIALIZED, \ 284 V(StringConstructCode, BUILTIN, UNINITIALIZED, \
214 Code::kNoExtraICState) \ 285 Code::kNoExtraICState, \
286 IN_SNAPSHOT) \
215 \ 287 \
216 V(OnStackReplacement, BUILTIN, UNINITIALIZED, \ 288 V(OnStackReplacement, BUILTIN, UNINITIALIZED, \
217 Code::kNoExtraICState) \ 289 Code::kNoExtraICState, \
290 NOT_IN_ARM_SNAPSHOT) \
218 CODE_AGE_LIST_WITH_ARG(DECLARE_CODE_AGE_BUILTIN, V) 291 CODE_AGE_LIST_WITH_ARG(DECLARE_CODE_AGE_BUILTIN, V)
219 292
220 #ifdef ENABLE_DEBUGGER_SUPPORT 293 #ifdef ENABLE_DEBUGGER_SUPPORT
221 // Define list of builtins used by the debugger implemented in assembly. 294 // Define list of builtins used by the debugger implemented in assembly.
222 #define BUILTIN_LIST_DEBUG_A(V) \ 295 #define BUILTIN_LIST_DEBUG_A(V) \
223 V(Return_DebugBreak, BUILTIN, DEBUG_BREAK, \ 296 V(Return_DebugBreak, BUILTIN, DEBUG_BREAK, \
224 Code::kNoExtraICState) \ 297 Code::kNoExtraICState, \
298 IN_SNAPSHOT) \
225 V(CallFunctionStub_DebugBreak, BUILTIN, DEBUG_BREAK, \ 299 V(CallFunctionStub_DebugBreak, BUILTIN, DEBUG_BREAK, \
226 Code::kNoExtraICState) \ 300 Code::kNoExtraICState, \
301 IN_SNAPSHOT) \
227 V(CallFunctionStub_Recording_DebugBreak, BUILTIN, DEBUG_BREAK, \ 302 V(CallFunctionStub_Recording_DebugBreak, BUILTIN, DEBUG_BREAK, \
228 Code::kNoExtraICState) \ 303 Code::kNoExtraICState, \
304 IN_SNAPSHOT) \
229 V(CallConstructStub_DebugBreak, BUILTIN, DEBUG_BREAK, \ 305 V(CallConstructStub_DebugBreak, BUILTIN, DEBUG_BREAK, \
230 Code::kNoExtraICState) \ 306 Code::kNoExtraICState, \
307 IN_SNAPSHOT) \
231 V(CallConstructStub_Recording_DebugBreak, BUILTIN, DEBUG_BREAK, \ 308 V(CallConstructStub_Recording_DebugBreak, BUILTIN, DEBUG_BREAK, \
232 Code::kNoExtraICState) \ 309 Code::kNoExtraICState, \
310 IN_SNAPSHOT) \
233 V(LoadIC_DebugBreak, LOAD_IC, DEBUG_BREAK, \ 311 V(LoadIC_DebugBreak, LOAD_IC, DEBUG_BREAK, \
234 Code::kNoExtraICState) \ 312 Code::kNoExtraICState, \
313 IN_SNAPSHOT) \
235 V(KeyedLoadIC_DebugBreak, KEYED_LOAD_IC, DEBUG_BREAK, \ 314 V(KeyedLoadIC_DebugBreak, KEYED_LOAD_IC, DEBUG_BREAK, \
236 Code::kNoExtraICState) \ 315 Code::kNoExtraICState, \
316 IN_SNAPSHOT) \
237 V(StoreIC_DebugBreak, STORE_IC, DEBUG_BREAK, \ 317 V(StoreIC_DebugBreak, STORE_IC, DEBUG_BREAK, \
238 Code::kNoExtraICState) \ 318 Code::kNoExtraICState, \
319 IN_SNAPSHOT) \
239 V(KeyedStoreIC_DebugBreak, KEYED_STORE_IC, DEBUG_BREAK, \ 320 V(KeyedStoreIC_DebugBreak, KEYED_STORE_IC, DEBUG_BREAK, \
240 Code::kNoExtraICState) \ 321 Code::kNoExtraICState, \
322 IN_SNAPSHOT) \
241 V(Slot_DebugBreak, BUILTIN, DEBUG_BREAK, \ 323 V(Slot_DebugBreak, BUILTIN, DEBUG_BREAK, \
242 Code::kNoExtraICState) \ 324 Code::kNoExtraICState, \
325 IN_SNAPSHOT) \
243 V(PlainReturn_LiveEdit, BUILTIN, DEBUG_BREAK, \ 326 V(PlainReturn_LiveEdit, BUILTIN, DEBUG_BREAK, \
244 Code::kNoExtraICState) \ 327 Code::kNoExtraICState, \
328 IN_SNAPSHOT) \
245 V(FrameDropper_LiveEdit, BUILTIN, DEBUG_BREAK, \ 329 V(FrameDropper_LiveEdit, BUILTIN, DEBUG_BREAK, \
246 Code::kNoExtraICState) 330 Code::kNoExtraICState, \
331 IN_SNAPSHOT)
247 #else 332 #else
248 #define BUILTIN_LIST_DEBUG_A(V) 333 #define BUILTIN_LIST_DEBUG_A(V)
249 #endif 334 #endif
250 335
251 // Define list of builtins implemented in JavaScript. 336 // Define list of builtins implemented in JavaScript.
252 #define BUILTINS_LIST_JS(V) \ 337 #define BUILTINS_LIST_JS(V) \
253 V(EQUALS, 1) \ 338 V(EQUALS, 1) \
254 V(STRICT_EQUALS, 1) \ 339 V(STRICT_EQUALS, 1) \
255 V(COMPARE, 2) \ 340 V(COMPARE, 2) \
256 V(ADD, 1) \ 341 V(ADD, 1) \
(...skipping 27 matching lines...) Expand all
284 369
285 370
286 class BuiltinFunctionTable; 371 class BuiltinFunctionTable;
287 class ObjectVisitor; 372 class ObjectVisitor;
288 373
289 374
290 class Builtins { 375 class Builtins {
291 public: 376 public:
292 ~Builtins(); 377 ~Builtins();
293 378
294 // Generate all builtin code objects. Should be called once during 379 enum SetUpKind {
295 // isolate initialization. 380 FOR_SNAPSHOT,
296 void SetUp(bool create_heap_objects); 381 ALL,
382 BEFORE_DESERIALIZATION,
383 AFTER_DESERIALIZATION
384 };
385
386 // Generate builtin code object. Should be called during isolate
387 // initialization.
388 void SetUp(SetUpKind kind);
297 void TearDown(); 389 void TearDown();
298 390
299 // Garbage collection support. 391 // Garbage collection support.
300 void IterateBuiltins(ObjectVisitor* v); 392 void IterateBuiltins(ObjectVisitor* v);
301 393
302 // Disassembler support. 394 // Disassembler support.
303 const char* Lookup(byte* pc); 395 const char* Lookup(byte* pc);
304 396
305 enum Name { 397 enum Name {
306 #define DEF_ENUM_C(name, ignore) k##name, 398 #define DEF_ENUM_C(name, ignore) k##name,
307 #define DEF_ENUM_A(name, kind, state, extra) k##name, 399 #define DEF_ENUM_A(name, kind, state, extra, extra2) k##name,
308 BUILTIN_LIST_C(DEF_ENUM_C) 400 BUILTIN_LIST_C(DEF_ENUM_C)
309 BUILTIN_LIST_A(DEF_ENUM_A) 401 BUILTIN_LIST_A(DEF_ENUM_A)
310 BUILTIN_LIST_DEBUG_A(DEF_ENUM_A) 402 BUILTIN_LIST_DEBUG_A(DEF_ENUM_A)
311 #undef DEF_ENUM_C 403 #undef DEF_ENUM_C
312 #undef DEF_ENUM_A 404 #undef DEF_ENUM_A
313 builtin_count 405 builtin_count
314 }; 406 };
315 407
316 enum CFunctionId { 408 enum CFunctionId {
317 #define DEF_ENUM_C(name, ignore) c_##name, 409 #define DEF_ENUM_C(name, ignore) c_##name,
318 BUILTIN_LIST_C(DEF_ENUM_C) 410 BUILTIN_LIST_C(DEF_ENUM_C)
319 #undef DEF_ENUM_C 411 #undef DEF_ENUM_C
320 cfunction_count 412 cfunction_count
321 }; 413 };
322 414
323 enum JavaScript { 415 enum JavaScript {
324 #define DEF_ENUM(name, ignore) name, 416 #define DEF_ENUM(name, ignore) name,
325 BUILTINS_LIST_JS(DEF_ENUM) 417 BUILTINS_LIST_JS(DEF_ENUM)
326 #undef DEF_ENUM 418 #undef DEF_ENUM
327 id_count 419 id_count
328 }; 420 };
329 421
330 #define DECLARE_BUILTIN_ACCESSOR_C(name, ignore) Handle<Code> name(); 422 #define DECLARE_BUILTIN_ACCESSOR_C(name, ignore) Handle<Code> name();
331 #define DECLARE_BUILTIN_ACCESSOR_A(name, kind, state, extra) \ 423 #define DECLARE_BUILTIN_ACCESSOR_A(name, kind, state, extra, extra2) \
332 Handle<Code> name(); 424 Handle<Code> name();
333 BUILTIN_LIST_C(DECLARE_BUILTIN_ACCESSOR_C) 425 BUILTIN_LIST_C(DECLARE_BUILTIN_ACCESSOR_C)
334 BUILTIN_LIST_A(DECLARE_BUILTIN_ACCESSOR_A) 426 BUILTIN_LIST_A(DECLARE_BUILTIN_ACCESSOR_A)
335 BUILTIN_LIST_DEBUG_A(DECLARE_BUILTIN_ACCESSOR_A) 427 BUILTIN_LIST_DEBUG_A(DECLARE_BUILTIN_ACCESSOR_A)
336 #undef DECLARE_BUILTIN_ACCESSOR_C 428 #undef DECLARE_BUILTIN_ACCESSOR_C
337 #undef DECLARE_BUILTIN_ACCESSOR_A 429 #undef DECLARE_BUILTIN_ACCESSOR_A
338 430
339 Code* builtin(Name name) { 431 Code* builtin(Name name) {
340 // Code::cast cannot be used here since we access builtins 432 // Code::cast cannot be used here since we access builtins
341 // during the marking phase of mark sweep. See IC::Clear. 433 // during the marking phase of mark sweep. See IC::Clear.
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 504
413 friend class BuiltinFunctionTable; 505 friend class BuiltinFunctionTable;
414 friend class Isolate; 506 friend class Isolate;
415 507
416 DISALLOW_COPY_AND_ASSIGN(Builtins); 508 DISALLOW_COPY_AND_ASSIGN(Builtins);
417 }; 509 };
418 510
419 } } // namespace v8::internal 511 } } // namespace v8::internal
420 512
421 #endif // V8_BUILTINS_H_ 513 #endif // V8_BUILTINS_H_
OLDNEW
« no previous file with comments | « src/arm/simulator-arm.cc ('k') | src/builtins.cc » ('j') | src/flag-definitions.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698