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

Side by Side Diff: src/runtime.h

Issue 201042: Win64 - Allow returning two values from a runtime function. (Closed)
Patch Set: Fixed typo. Created 11 years, 3 months 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
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 25 matching lines...) Expand all
36 // ---------------------------------------------------------------------------- 36 // ----------------------------------------------------------------------------
37 // RUNTIME_FUNCTION_LIST_ALWAYS defines runtime calls available in both 37 // RUNTIME_FUNCTION_LIST_ALWAYS defines runtime calls available in both
38 // release and debug mode. 38 // release and debug mode.
39 // This macro should only be used by the macro RUNTIME_FUNCTION_LIST. 39 // This macro should only be used by the macro RUNTIME_FUNCTION_LIST.
40 40
41 // WARNING: RUNTIME_FUNCTION_LIST_ALWAYS_* is a very large macro that caused 41 // WARNING: RUNTIME_FUNCTION_LIST_ALWAYS_* is a very large macro that caused
42 // MSVC Intellisense to crash. It was broken into two macros to work around 42 // MSVC Intellisense to crash. It was broken into two macros to work around
43 // this problem. Please avoid large recursive macros whenever possible. 43 // this problem. Please avoid large recursive macros whenever possible.
44 #define RUNTIME_FUNCTION_LIST_ALWAYS_1(F) \ 44 #define RUNTIME_FUNCTION_LIST_ALWAYS_1(F) \
45 /* Property access */ \ 45 /* Property access */ \
46 F(GetProperty, 2) \ 46 F(GetProperty, 2, 1) \
47 F(KeyedGetProperty, 2) \ 47 F(KeyedGetProperty, 2, 1) \
48 F(DeleteProperty, 2) \ 48 F(DeleteProperty, 2, 1) \
49 F(HasLocalProperty, 2) \ 49 F(HasLocalProperty, 2, 1) \
50 F(HasProperty, 2) \ 50 F(HasProperty, 2, 1) \
51 F(HasElement, 2) \ 51 F(HasElement, 2, 1) \
52 F(IsPropertyEnumerable, 2) \ 52 F(IsPropertyEnumerable, 2, 1) \
53 F(GetPropertyNames, 1) \ 53 F(GetPropertyNames, 1, 1) \
54 F(GetPropertyNamesFast, 1) \ 54 F(GetPropertyNamesFast, 1, 1) \
55 F(GetArgumentsProperty, 1) \ 55 F(GetArgumentsProperty, 1, 1) \
56 F(ToFastProperties, 1) \ 56 F(ToFastProperties, 1, 1) \
57 F(ToSlowProperties, 1) \ 57 F(ToSlowProperties, 1, 1) \
58 \ 58 \
59 F(IsInPrototypeChain, 2) \ 59 F(IsInPrototypeChain, 2, 1) \
60 F(SetHiddenPrototype, 2) \ 60 F(SetHiddenPrototype, 2, 1) \
61 \ 61 \
62 F(IsConstructCall, 0) \ 62 F(IsConstructCall, 0, 1) \
63 \ 63 \
64 /* Utilities */ \ 64 /* Utilities */ \
65 F(GetCalledFunction, 0) \ 65 F(GetCalledFunction, 0, 1) \
66 F(GetFunctionDelegate, 1) \ 66 F(GetFunctionDelegate, 1, 1) \
67 F(GetConstructorDelegate, 1) \ 67 F(GetConstructorDelegate, 1, 1) \
68 F(NewArguments, 1) \ 68 F(NewArguments, 1, 1) \
69 F(NewArgumentsFast, 3) \ 69 F(NewArgumentsFast, 3, 1) \
70 F(LazyCompile, 1) \ 70 F(LazyCompile, 1, 1) \
71 F(SetNewFunctionAttributes, 1) \ 71 F(SetNewFunctionAttributes, 1, 1) \
72 \ 72 \
73 /* Array join support */ \ 73 /* Array join support */ \
74 F(PushIfAbsent, 2) \ 74 F(PushIfAbsent, 2, 1) \
75 F(ArrayConcat, 1) \ 75 F(ArrayConcat, 1, 1) \
76 \ 76 \
77 /* Conversions */ \ 77 /* Conversions */ \
78 F(ToBool, 1) \ 78 F(ToBool, 1, 1) \
79 F(Typeof, 1) \ 79 F(Typeof, 1, 1) \
80 \ 80 \
81 F(StringToNumber, 1) \ 81 F(StringToNumber, 1, 1) \
82 F(StringFromCharCodeArray, 1) \ 82 F(StringFromCharCodeArray, 1, 1) \
83 F(StringParseInt, 2) \ 83 F(StringParseInt, 2, 1) \
84 F(StringParseFloat, 1) \ 84 F(StringParseFloat, 1, 1) \
85 F(StringToLowerCase, 1) \ 85 F(StringToLowerCase, 1, 1) \
86 F(StringToUpperCase, 1) \ 86 F(StringToUpperCase, 1, 1) \
87 F(CharFromCode, 1) \ 87 F(CharFromCode, 1, 1) \
88 F(URIEscape, 1) \ 88 F(URIEscape, 1, 1) \
89 F(URIUnescape, 1) \ 89 F(URIUnescape, 1, 1) \
90 \ 90 \
91 F(NumberToString, 1) \ 91 F(NumberToString, 1, 1) \
92 F(NumberToInteger, 1) \ 92 F(NumberToInteger, 1, 1) \
93 F(NumberToJSUint32, 1) \ 93 F(NumberToJSUint32, 1, 1) \
94 F(NumberToJSInt32, 1) \ 94 F(NumberToJSInt32, 1, 1) \
95 F(NumberToSmi, 1) \ 95 F(NumberToSmi, 1, 1) \
96 \ 96 \
97 /* Arithmetic operations */ \ 97 /* Arithmetic operations */ \
98 F(NumberAdd, 2) \ 98 F(NumberAdd, 2, 1) \
99 F(NumberSub, 2) \ 99 F(NumberSub, 2, 1) \
100 F(NumberMul, 2) \ 100 F(NumberMul, 2, 1) \
101 F(NumberDiv, 2) \ 101 F(NumberDiv, 2, 1) \
102 F(NumberMod, 2) \ 102 F(NumberMod, 2, 1) \
103 F(NumberUnaryMinus, 1) \ 103 F(NumberUnaryMinus, 1, 1) \
104 \ 104 \
105 F(StringAdd, 2) \ 105 F(StringAdd, 2, 1) \
106 F(StringBuilderConcat, 2) \ 106 F(StringBuilderConcat, 2, 1) \
107 \ 107 \
108 /* Bit operations */ \ 108 /* Bit operations */ \
109 F(NumberOr, 2) \ 109 F(NumberOr, 2, 1) \
110 F(NumberAnd, 2) \ 110 F(NumberAnd, 2, 1) \
111 F(NumberXor, 2) \ 111 F(NumberXor, 2, 1) \
112 F(NumberNot, 1) \ 112 F(NumberNot, 1, 1) \
113 \ 113 \
114 F(NumberShl, 2) \ 114 F(NumberShl, 2, 1) \
115 F(NumberShr, 2) \ 115 F(NumberShr, 2, 1) \
116 F(NumberSar, 2) \ 116 F(NumberSar, 2, 1) \
117 \ 117 \
118 /* Comparisons */ \ 118 /* Comparisons */ \
119 F(NumberEquals, 2) \ 119 F(NumberEquals, 2, 1) \
120 F(StringEquals, 2) \ 120 F(StringEquals, 2, 1) \
121 \ 121 \
122 F(NumberCompare, 3) \ 122 F(NumberCompare, 3, 1) \
123 F(SmiLexicographicCompare, 2) \ 123 F(SmiLexicographicCompare, 2, 1) \
124 F(StringCompare, 2) \ 124 F(StringCompare, 2, 1) \
125 \ 125 \
126 /* Math */ \ 126 /* Math */ \
127 F(Math_abs, 1) \ 127 F(Math_abs, 1, 1) \
128 F(Math_acos, 1) \ 128 F(Math_acos, 1, 1) \
129 F(Math_asin, 1) \ 129 F(Math_asin, 1, 1) \
130 F(Math_atan, 1) \ 130 F(Math_atan, 1, 1) \
131 F(Math_atan2, 2) \ 131 F(Math_atan2, 2, 1) \
132 F(Math_ceil, 1) \ 132 F(Math_ceil, 1, 1) \
133 F(Math_cos, 1) \ 133 F(Math_cos, 1, 1) \
134 F(Math_exp, 1) \ 134 F(Math_exp, 1, 1) \
135 F(Math_floor, 1) \ 135 F(Math_floor, 1, 1) \
136 F(Math_log, 1) \ 136 F(Math_log, 1, 1) \
137 F(Math_pow, 2) \ 137 F(Math_pow, 2, 1) \
138 F(Math_round, 1) \ 138 F(Math_round, 1, 1) \
139 F(Math_sin, 1) \ 139 F(Math_sin, 1, 1) \
140 F(Math_sqrt, 1) \ 140 F(Math_sqrt, 1, 1) \
141 F(Math_tan, 1) \ 141 F(Math_tan, 1, 1) \
142 \ 142 \
143 /* Regular expressions */ \ 143 /* Regular expressions */ \
144 F(RegExpCompile, 3) \ 144 F(RegExpCompile, 3, 1) \
145 F(RegExpExec, 4) \ 145 F(RegExpExec, 4, 1) \
146 \ 146 \
147 /* Strings */ \ 147 /* Strings */ \
148 F(StringCharCodeAt, 2) \ 148 F(StringCharCodeAt, 2, 1) \
149 F(StringIndexOf, 3) \ 149 F(StringIndexOf, 3, 1) \
150 F(StringLastIndexOf, 3) \ 150 F(StringLastIndexOf, 3, 1) \
151 F(StringLocaleCompare, 2) \ 151 F(StringLocaleCompare, 2, 1) \
152 F(StringSlice, 3) \ 152 F(StringSlice, 3, 1) \
153 F(StringReplaceRegExpWithString, 4) \ 153 F(StringReplaceRegExpWithString, 4, 1) \
154 F(StringMatch, 3) \ 154 F(StringMatch, 3, 1) \
155 \ 155 \
156 /* Numbers */ \ 156 /* Numbers */ \
157 F(NumberToRadixString, 2) \ 157 F(NumberToRadixString, 2, 1) \
158 F(NumberToFixed, 2) \ 158 F(NumberToFixed, 2, 1) \
159 F(NumberToExponential, 2) \ 159 F(NumberToExponential, 2, 1) \
160 F(NumberToPrecision, 2) 160 F(NumberToPrecision, 2, 1)
161 161
162 #define RUNTIME_FUNCTION_LIST_ALWAYS_2(F) \ 162 #define RUNTIME_FUNCTION_LIST_ALWAYS_2(F) \
163 /* Reflection */ \ 163 /* Reflection */ \
164 F(FunctionSetInstanceClassName, 2) \ 164 F(FunctionSetInstanceClassName, 2, 1) \
165 F(FunctionSetLength, 2) \ 165 F(FunctionSetLength, 2, 1) \
166 F(FunctionSetPrototype, 2) \ 166 F(FunctionSetPrototype, 2, 1) \
167 F(FunctionGetName, 1) \ 167 F(FunctionGetName, 1, 1) \
168 F(FunctionSetName, 2) \ 168 F(FunctionSetName, 2, 1) \
169 F(FunctionGetSourceCode, 1) \ 169 F(FunctionGetSourceCode, 1, 1) \
170 F(FunctionGetScript, 1) \ 170 F(FunctionGetScript, 1, 1) \
171 F(FunctionGetScriptSourcePosition, 1) \ 171 F(FunctionGetScriptSourcePosition, 1, 1) \
172 F(FunctionGetPositionForOffset, 2) \ 172 F(FunctionGetPositionForOffset, 2, 1) \
173 F(FunctionIsAPIFunction, 1) \ 173 F(FunctionIsAPIFunction, 1, 1) \
174 F(GetScript, 1) \ 174 F(GetScript, 1, 1) \
175 F(CollectStackTrace, 2) \ 175 F(CollectStackTrace, 2, 1) \
176 \ 176 \
177 F(ClassOf, 1) \ 177 F(ClassOf, 1, 1) \
178 F(SetCode, 2) \ 178 F(SetCode, 2, 1) \
179 \ 179 \
180 F(CreateApiFunction, 1) \ 180 F(CreateApiFunction, 1, 1) \
181 F(IsTemplate, 1) \ 181 F(IsTemplate, 1, 1) \
182 F(GetTemplateField, 2) \ 182 F(GetTemplateField, 2, 1) \
183 F(DisableAccessChecks, 1) \ 183 F(DisableAccessChecks, 1, 1) \
184 F(EnableAccessChecks, 1) \ 184 F(EnableAccessChecks, 1, 1) \
185 \ 185 \
186 /* Dates */ \ 186 /* Dates */ \
187 F(DateCurrentTime, 0) \ 187 F(DateCurrentTime, 0, 1) \
188 F(DateParseString, 2) \ 188 F(DateParseString, 2, 1) \
189 F(DateLocalTimezone, 1) \ 189 F(DateLocalTimezone, 1, 1) \
190 F(DateLocalTimeOffset, 0) \ 190 F(DateLocalTimeOffset, 0, 1) \
191 F(DateDaylightSavingsOffset, 1) \ 191 F(DateDaylightSavingsOffset, 1, 1) \
192 \ 192 \
193 /* Numbers */ \ 193 /* Numbers */ \
194 F(NumberIsFinite, 1) \ 194 F(NumberIsFinite, 1, 1) \
195 \ 195 \
196 /* Globals */ \ 196 /* Globals */ \
197 F(CompileString, 2) \ 197 F(CompileString, 2, 1) \
198 F(GlobalPrint, 1) \ 198 F(GlobalPrint, 1, 1) \
199 \ 199 \
200 /* Eval */ \ 200 /* Eval */ \
201 F(GlobalReceiver, 1) \ 201 F(GlobalReceiver, 1, 1) \
202 F(ResolvePossiblyDirectEval, 2) \ 202 F(ResolvePossiblyDirectEval, 2, 1) \
203 \ 203 \
204 F(SetProperty, -1 /* 3 or 4 */) \ 204 F(SetProperty, -1 /* 3 or 4 */, 1) \
205 F(IgnoreAttributesAndSetProperty, -1 /* 3 or 4 */) \ 205 F(IgnoreAttributesAndSetProperty, -1 /* 3 or 4 */, 1) \
206 \ 206 \
207 /* Arrays */ \ 207 /* Arrays */ \
208 F(RemoveArrayHoles, 2) \ 208 F(RemoveArrayHoles, 2, 1) \
209 F(GetArrayKeys, 2) \ 209 F(GetArrayKeys, 2, 1) \
210 F(MoveArrayContents, 2) \ 210 F(MoveArrayContents, 2, 1) \
211 F(EstimateNumberOfElements, 1) \ 211 F(EstimateNumberOfElements, 1, 1) \
212 \ 212 \
213 /* Getters and Setters */ \ 213 /* Getters and Setters */ \
214 F(DefineAccessor, -1 /* 4 or 5 */) \ 214 F(DefineAccessor, -1 /* 4 or 5 */, 1) \
215 F(LookupAccessor, 3) \ 215 F(LookupAccessor, 3, 1) \
216 \ 216 \
217 /* Literals */ \ 217 /* Literals */ \
218 F(MaterializeRegExpLiteral, 4)\ 218 F(MaterializeRegExpLiteral, 4, 1)\
219 F(CreateArrayLiteralBoilerplate, 3) \ 219 F(CreateArrayLiteralBoilerplate, 3, 1) \
220 F(CreateObjectLiteralBoilerplate, 3) \ 220 F(CreateObjectLiteralBoilerplate, 3, 1) \
221 F(CloneLiteralBoilerplate, 1) \ 221 F(CloneLiteralBoilerplate, 1, 1) \
222 F(CloneShallowLiteralBoilerplate, 1) \ 222 F(CloneShallowLiteralBoilerplate, 1, 1) \
223 \ 223 \
224 /* Catch context extension objects */ \ 224 /* Catch context extension objects */ \
225 F(CreateCatchExtensionObject, 2) \ 225 F(CreateCatchExtensionObject, 2, 1) \
226 \ 226 \
227 /* Statements */ \ 227 /* Statements */ \
228 F(NewClosure, 2) \ 228 F(NewClosure, 2, 1) \
229 F(NewObject, 1) \ 229 F(NewObject, 1, 1) \
230 F(Throw, 1) \ 230 F(Throw, 1, 1) \
231 F(ReThrow, 1) \ 231 F(ReThrow, 1, 1) \
232 F(ThrowReferenceError, 1) \ 232 F(ThrowReferenceError, 1, 1) \
233 F(StackGuard, 1) \ 233 F(StackGuard, 1, 1) \
234 \ 234 \
235 /* Contexts */ \ 235 /* Contexts */ \
236 F(NewContext, 1) \ 236 F(NewContext, 1, 1) \
237 F(PushContext, 1) \ 237 F(PushContext, 1, 1) \
238 F(PushCatchContext, 1) \ 238 F(PushCatchContext, 1, 1) \
239 F(LookupContext, 2) \ 239 F(LookupContext, 2, 1) \
240 F(LoadContextSlot, 2) \ 240 F(LoadContextSlot, 2, 2) \
241 F(LoadContextSlotNoReferenceError, 2) \ 241 F(LoadContextSlotNoReferenceError, 2, 2) \
242 F(StoreContextSlot, 3) \ 242 F(StoreContextSlot, 3, 1) \
243 \ 243 \
244 /* Declarations and initialization */ \ 244 /* Declarations and initialization */ \
245 F(DeclareGlobals, 3) \ 245 F(DeclareGlobals, 3, 1) \
246 F(DeclareContextSlot, 4) \ 246 F(DeclareContextSlot, 4, 1) \
247 F(InitializeVarGlobal, -1 /* 1 or 2 */) \ 247 F(InitializeVarGlobal, -1 /* 1 or 2 */, 1) \
248 F(InitializeConstGlobal, 2) \ 248 F(InitializeConstGlobal, 2, 1) \
249 F(InitializeConstContextSlot, 3) \ 249 F(InitializeConstContextSlot, 3, 1) \
250 F(OptimizeObjectForAddingMultipleProperties, 2) \ 250 F(OptimizeObjectForAddingMultipleProperties, 2, 1) \
251 F(TransformToFastProperties, 1) \ 251 F(TransformToFastProperties, 1, 1) \
252 \ 252 \
253 /* Debugging */ \ 253 /* Debugging */ \
254 F(DebugPrint, 1) \ 254 F(DebugPrint, 1, 1) \
255 F(DebugTrace, 0) \ 255 F(DebugTrace, 0, 1) \
256 F(TraceEnter, 0) \ 256 F(TraceEnter, 0, 1) \
257 F(TraceExit, 1) \ 257 F(TraceExit, 1, 1) \
258 F(Abort, 2) \ 258 F(Abort, 2, 1) \
259 /* Logging */ \ 259 /* Logging */ \
260 F(Log, 2) \ 260 F(Log, 2, 1) \
261 \ 261 \
262 /* Pseudo functions - handled as macros by parser */ \ 262 /* Pseudo functions - handled as macros by parser */ \
263 F(IS_VAR, 1) 263 F(IS_VAR, 1, 1)
264 264
265 #ifdef ENABLE_DEBUGGER_SUPPORT 265 #ifdef ENABLE_DEBUGGER_SUPPORT
266 #define RUNTIME_FUNCTION_LIST_DEBUGGER_SUPPORT(F) \ 266 #define RUNTIME_FUNCTION_LIST_DEBUGGER_SUPPORT(F) \
267 /* Debugger support*/ \ 267 /* Debugger support*/ \
268 F(DebugBreak, 0) \ 268 F(DebugBreak, 0, 1) \
269 F(SetDebugEventListener, 2) \ 269 F(SetDebugEventListener, 2, 1) \
270 F(Break, 0) \ 270 F(Break, 0, 1) \
271 F(DebugGetPropertyDetails, 2) \ 271 F(DebugGetPropertyDetails, 2, 1) \
272 F(DebugGetProperty, 2) \ 272 F(DebugGetProperty, 2, 1) \
273 F(DebugLocalPropertyNames, 1) \ 273 F(DebugLocalPropertyNames, 1, 1) \
274 F(DebugLocalElementNames, 1) \ 274 F(DebugLocalElementNames, 1, 1) \
275 F(DebugPropertyTypeFromDetails, 1) \ 275 F(DebugPropertyTypeFromDetails, 1, 1) \
276 F(DebugPropertyAttributesFromDetails, 1) \ 276 F(DebugPropertyAttributesFromDetails, 1, 1) \
277 F(DebugPropertyIndexFromDetails, 1) \ 277 F(DebugPropertyIndexFromDetails, 1, 1) \
278 F(DebugInterceptorInfo, 1) \ 278 F(DebugInterceptorInfo, 1, 1) \
279 F(DebugNamedInterceptorPropertyNames, 1) \ 279 F(DebugNamedInterceptorPropertyNames, 1, 1) \
280 F(DebugIndexedInterceptorElementNames, 1) \ 280 F(DebugIndexedInterceptorElementNames, 1, 1) \
281 F(DebugNamedInterceptorPropertyValue, 2) \ 281 F(DebugNamedInterceptorPropertyValue, 2, 1) \
282 F(DebugIndexedInterceptorElementValue, 2) \ 282 F(DebugIndexedInterceptorElementValue, 2, 1) \
283 F(CheckExecutionState, 1) \ 283 F(CheckExecutionState, 1, 1) \
284 F(GetFrameCount, 1) \ 284 F(GetFrameCount, 1, 1) \
285 F(GetFrameDetails, 2) \ 285 F(GetFrameDetails, 2, 1) \
286 F(GetScopeCount, 2) \ 286 F(GetScopeCount, 2, 1) \
287 F(GetScopeDetails, 3) \ 287 F(GetScopeDetails, 3, 1) \
288 F(DebugPrintScopes, 0) \ 288 F(DebugPrintScopes, 0, 1) \
289 F(GetCFrames, 1) \ 289 F(GetCFrames, 1, 1) \
290 F(GetThreadCount, 1) \ 290 F(GetThreadCount, 1, 1) \
291 F(GetThreadDetails, 2) \ 291 F(GetThreadDetails, 2, 1) \
292 F(GetBreakLocations, 1) \ 292 F(GetBreakLocations, 1, 1) \
293 F(SetFunctionBreakPoint, 3) \ 293 F(SetFunctionBreakPoint, 3, 1) \
294 F(SetScriptBreakPoint, 3) \ 294 F(SetScriptBreakPoint, 3, 1) \
295 F(ClearBreakPoint, 1) \ 295 F(ClearBreakPoint, 1, 1) \
296 F(ChangeBreakOnException, 2) \ 296 F(ChangeBreakOnException, 2, 1) \
297 F(PrepareStep, 3) \ 297 F(PrepareStep, 3, 1) \
298 F(ClearStepping, 0) \ 298 F(ClearStepping, 0, 1) \
299 F(DebugEvaluate, 4) \ 299 F(DebugEvaluate, 4, 1) \
300 F(DebugEvaluateGlobal, 3) \ 300 F(DebugEvaluateGlobal, 3, 1) \
301 F(DebugGetLoadedScripts, 0) \ 301 F(DebugGetLoadedScripts, 0, 1) \
302 F(DebugReferencedBy, 3) \ 302 F(DebugReferencedBy, 3, 1) \
303 F(DebugConstructedBy, 2) \ 303 F(DebugConstructedBy, 2, 1) \
304 F(DebugGetPrototype, 1) \ 304 F(DebugGetPrototype, 1, 1) \
305 F(SystemBreak, 0) \ 305 F(SystemBreak, 0, 1) \
306 F(DebugDisassembleFunction, 1) \ 306 F(DebugDisassembleFunction, 1, 1) \
307 F(DebugDisassembleConstructor, 1) \ 307 F(DebugDisassembleConstructor, 1, 1) \
308 F(FunctionGetInferredName, 1) 308 F(FunctionGetInferredName, 1, 1)
309 #else 309 #else
310 #define RUNTIME_FUNCTION_LIST_DEBUGGER_SUPPORT(F) 310 #define RUNTIME_FUNCTION_LIST_DEBUGGER_SUPPORT(F)
311 #endif 311 #endif
312 312
313 #ifdef DEBUG 313 #ifdef DEBUG
314 #define RUNTIME_FUNCTION_LIST_DEBUG(F) \ 314 #define RUNTIME_FUNCTION_LIST_DEBUG(F) \
315 /* Testing */ \ 315 /* Testing */ \
316 F(ListNatives, 0) 316 F(ListNatives, 0, 1)
317 #else 317 #else
318 #define RUNTIME_FUNCTION_LIST_DEBUG(F) 318 #define RUNTIME_FUNCTION_LIST_DEBUG(F)
319 #endif 319 #endif
320 320
321 321
322 // ---------------------------------------------------------------------------- 322 // ----------------------------------------------------------------------------
323 // RUNTIME_FUNCTION_LIST defines all runtime functions accessed 323 // RUNTIME_FUNCTION_LIST defines all runtime functions accessed
324 // either directly by id (via the code generator), or indirectly 324 // either directly by id (via the code generator), or indirectly
325 // via a native call by name (from within JS code). 325 // via a native call by name (from within JS code).
326 326
327 #define RUNTIME_FUNCTION_LIST(F) \ 327 #define RUNTIME_FUNCTION_LIST(F) \
328 RUNTIME_FUNCTION_LIST_ALWAYS_1(F) \ 328 RUNTIME_FUNCTION_LIST_ALWAYS_1(F) \
329 RUNTIME_FUNCTION_LIST_ALWAYS_2(F) \ 329 RUNTIME_FUNCTION_LIST_ALWAYS_2(F) \
330 RUNTIME_FUNCTION_LIST_DEBUG(F) \ 330 RUNTIME_FUNCTION_LIST_DEBUG(F) \
331 RUNTIME_FUNCTION_LIST_DEBUGGER_SUPPORT(F) 331 RUNTIME_FUNCTION_LIST_DEBUGGER_SUPPORT(F)
332 332
333 // ---------------------------------------------------------------------------- 333 // ----------------------------------------------------------------------------
334 // Runtime provides access to all C++ runtime functions. 334 // Runtime provides access to all C++ runtime functions.
335 335
336 class Runtime : public AllStatic { 336 class Runtime : public AllStatic {
337 public: 337 public:
338 enum FunctionId { 338 enum FunctionId {
339 #define F(name, nargs) k##name, 339 #define F(name, nargs, ressize) k##name,
340 RUNTIME_FUNCTION_LIST(F) 340 RUNTIME_FUNCTION_LIST(F)
341 kNofFunctions 341 kNofFunctions
342 #undef F 342 #undef F
343 }; 343 };
344 344
345 // Runtime function descriptor. 345 // Runtime function descriptor.
346 struct Function { 346 struct Function {
347 // The JS name of the function. 347 // The JS name of the function.
348 const char* name; 348 const char* name;
349 349
350 // The name of the stub that calls the runtime function. 350 // The name of the stub that calls the runtime function.
351 const char* stub_name; 351 const char* stub_name;
352 352
353 // The C++ (native) entry point. 353 // The C++ (native) entry point.
354 byte* entry; 354 byte* entry;
355 355
356 // The number of arguments expected; nargs < 0 if variable no. of 356 // The number of arguments expected; nargs < 0 if variable no. of
357 // arguments. 357 // arguments.
358 int nargs; 358 int nargs;
359 int stub_id; 359 int stub_id;
360 // Size of result, if complex (larger than a single pointer),
361 // otherwise zero.
362 int result_size;
360 }; 363 };
361 364
362 // Get the runtime function with the given function id. 365 // Get the runtime function with the given function id.
363 static Function* FunctionForId(FunctionId fid); 366 static Function* FunctionForId(FunctionId fid);
364 367
365 // Get the runtime function with the given name. 368 // Get the runtime function with the given name.
366 static Function* FunctionForName(const char* name); 369 static Function* FunctionForName(const char* name);
367 370
368 static int StringMatch(Handle<String> sub, Handle<String> pat, int index); 371 static int StringMatch(Handle<String> sub, Handle<String> pat, int index);
369 372
(...skipping 26 matching lines...) Expand all
396 int position); 399 int position);
397 400
398 // Helper functions used stubs. 401 // Helper functions used stubs.
399 static void PerformGC(Object* result); 402 static void PerformGC(Object* result);
400 }; 403 };
401 404
402 405
403 } } // namespace v8::internal 406 } } // namespace v8::internal
404 407
405 #endif // V8_RUNTIME_H_ 408 #endif // V8_RUNTIME_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698