OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_RUNTIME_H_ | 5 #ifndef V8_RUNTIME_H_ |
6 #define V8_RUNTIME_H_ | 6 #define V8_RUNTIME_H_ |
7 | 7 |
8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
9 #include "src/zone.h" | 9 #include "src/zone.h" |
10 | 10 |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 F(IsValidSmi, 1, 1) \ | 182 F(IsValidSmi, 1, 1) \ |
183 \ | 183 \ |
184 /* Classes support */ \ | 184 /* Classes support */ \ |
185 F(ToMethod, 2, 1) \ | 185 F(ToMethod, 2, 1) \ |
186 F(HomeObjectSymbol, 0, 1) \ | 186 F(HomeObjectSymbol, 0, 1) \ |
187 F(ThrowNonMethodError, 0, 1) \ | 187 F(ThrowNonMethodError, 0, 1) \ |
188 F(ThrowUnsupportedSuperError, 0, 1) \ | 188 F(ThrowUnsupportedSuperError, 0, 1) \ |
189 F(LoadFromSuper, 3, 1) | 189 F(LoadFromSuper, 3, 1) |
190 | 190 |
191 | 191 |
192 #define RUNTIME_FUNCTION_LIST_ALWAYS_2(F) \ | 192 #define RUNTIME_FUNCTION_LIST_ALWAYS_2(F) \ |
193 /* Reflection */ \ | 193 /* Reflection */ \ |
194 F(FunctionSetInstanceClassName, 2, 1) \ | 194 F(FunctionSetInstanceClassName, 2, 1) \ |
195 F(FunctionSetLength, 2, 1) \ | 195 F(FunctionSetLength, 2, 1) \ |
196 F(FunctionSetPrototype, 2, 1) \ | 196 F(FunctionSetPrototype, 2, 1) \ |
197 F(FunctionGetName, 1, 1) \ | 197 F(FunctionGetName, 1, 1) \ |
198 F(FunctionSetName, 2, 1) \ | 198 F(FunctionSetName, 2, 1) \ |
199 F(FunctionNameShouldPrintAsAnonymous, 1, 1) \ | 199 F(FunctionNameShouldPrintAsAnonymous, 1, 1) \ |
200 F(FunctionMarkNameShouldPrintAsAnonymous, 1, 1) \ | 200 F(FunctionMarkNameShouldPrintAsAnonymous, 1, 1) \ |
201 F(FunctionIsGenerator, 1, 1) \ | 201 F(FunctionIsGenerator, 1, 1) \ |
202 F(FunctionIsArrow, 1, 1) \ | 202 F(FunctionIsArrow, 1, 1) \ |
203 F(FunctionIsConciseMethod, 1, 1) \ | 203 F(FunctionIsConciseMethod, 1, 1) \ |
204 F(FunctionBindArguments, 4, 1) \ | 204 F(FunctionBindArguments, 4, 1) \ |
205 F(BoundFunctionGetBindings, 1, 1) \ | 205 F(BoundFunctionGetBindings, 1, 1) \ |
206 F(FunctionRemovePrototype, 1, 1) \ | 206 F(FunctionRemovePrototype, 1, 1) \ |
207 F(FunctionGetSourceCode, 1, 1) \ | 207 F(FunctionGetSourceCode, 1, 1) \ |
208 F(FunctionGetScript, 1, 1) \ | 208 F(FunctionGetScript, 1, 1) \ |
209 F(FunctionGetScriptSourcePosition, 1, 1) \ | 209 F(FunctionGetScriptSourcePosition, 1, 1) \ |
210 F(FunctionGetPositionForOffset, 2, 1) \ | 210 F(FunctionGetPositionForOffset, 2, 1) \ |
211 F(FunctionIsAPIFunction, 1, 1) \ | 211 F(FunctionIsAPIFunction, 1, 1) \ |
212 F(FunctionIsBuiltin, 1, 1) \ | 212 F(FunctionIsBuiltin, 1, 1) \ |
213 F(GetScript, 1, 1) \ | 213 F(GetScript, 1, 1) \ |
214 F(CollectStackTrace, 2, 1) \ | 214 F(CollectStackTrace, 2, 1) \ |
215 F(GetV8Version, 0, 1) \ | 215 F(GetV8Version, 0, 1) \ |
216 F(GeneratorGetFunction, 1, 1) \ | 216 F(GeneratorGetFunction, 1, 1) \ |
217 F(GeneratorGetContext, 1, 1) \ | 217 F(GeneratorGetContext, 1, 1) \ |
218 F(GeneratorGetReceiver, 1, 1) \ | 218 F(GeneratorGetReceiver, 1, 1) \ |
219 F(GeneratorGetContinuation, 1, 1) \ | 219 F(GeneratorGetContinuation, 1, 1) \ |
220 F(GeneratorGetSourcePosition, 1, 1) \ | 220 F(GeneratorGetSourcePosition, 1, 1) \ |
221 \ | 221 \ |
222 F(SetCode, 2, 1) \ | 222 F(SetCode, 2, 1) \ |
223 \ | 223 \ |
224 F(CreateApiFunction, 2, 1) \ | 224 F(CreateApiFunction, 2, 1) \ |
225 F(IsTemplate, 1, 1) \ | 225 F(IsTemplate, 1, 1) \ |
226 F(GetTemplateField, 2, 1) \ | 226 F(GetTemplateField, 2, 1) \ |
227 F(DisableAccessChecks, 1, 1) \ | 227 F(DisableAccessChecks, 1, 1) \ |
228 F(EnableAccessChecks, 1, 1) \ | 228 F(EnableAccessChecks, 1, 1) \ |
229 \ | 229 \ |
230 /* Dates */ \ | 230 /* Dates */ \ |
231 F(DateCurrentTime, 0, 1) \ | 231 F(DateCurrentTime, 0, 1) \ |
232 F(DateParseString, 2, 1) \ | 232 F(DateParseString, 2, 1) \ |
233 F(DateLocalTimezone, 1, 1) \ | 233 F(DateLocalTimezone, 1, 1) \ |
234 F(DateToUTC, 1, 1) \ | 234 F(DateToUTC, 1, 1) \ |
235 F(DateMakeDay, 2, 1) \ | 235 F(DateMakeDay, 2, 1) \ |
236 F(DateSetValue, 3, 1) \ | 236 F(DateSetValue, 3, 1) \ |
237 F(DateCacheVersion, 0, 1) \ | 237 F(DateCacheVersion, 0, 1) \ |
238 \ | 238 \ |
239 /* Globals */ \ | 239 /* Globals */ \ |
240 F(CompileString, 2, 1) \ | 240 F(CompileString, 2, 1) \ |
241 \ | 241 \ |
242 /* Eval */ \ | 242 /* Eval */ \ |
243 F(GlobalProxy, 1, 1) \ | 243 F(GlobalProxy, 1, 1) \ |
244 F(IsAttachedGlobal, 1, 1) \ | 244 F(IsAttachedGlobal, 1, 1) \ |
245 \ | 245 \ |
246 F(AddNamedProperty, 4, 1) \ | 246 F(AddNamedProperty, 4, 1) \ |
247 F(AddPropertyForTemplate, 4, 1) \ | 247 F(AddPropertyForTemplate, 4, 1) \ |
248 F(SetProperty, 4, 1) \ | 248 F(SetProperty, 4, 1) \ |
249 F(AddElement, 4, 1) \ | 249 F(AddElement, 4, 1) \ |
250 F(DefineApiAccessorProperty, 5, 1) \ | 250 F(DefineApiAccessorProperty, 5, 1) \ |
251 F(DefineDataPropertyUnchecked, 4, 1) \ | 251 F(DefineDataPropertyUnchecked, 4, 1) \ |
252 F(DefineAccessorPropertyUnchecked, 5, 1) \ | 252 F(DefineAccessorPropertyUnchecked, 5, 1) \ |
253 F(GetDataProperty, 2, 1) \ | 253 F(GetDataProperty, 2, 1) \ |
254 F(SetHiddenProperty, 3, 1) \ | 254 F(SetHiddenProperty, 3, 1) \ |
255 \ | 255 \ |
256 /* Arrays */ \ | 256 /* Arrays */ \ |
257 F(RemoveArrayHoles, 2, 1) \ | 257 F(RemoveArrayHoles, 2, 1) \ |
258 F(GetArrayKeys, 2, 1) \ | 258 F(GetArrayKeys, 2, 1) \ |
259 F(MoveArrayContents, 2, 1) \ | 259 F(MoveArrayContents, 2, 1) \ |
260 F(EstimateNumberOfElements, 1, 1) \ | 260 F(EstimateNumberOfElements, 1, 1) \ |
261 F(NormalizeElements, 1, 1) \ | 261 F(NormalizeElements, 1, 1) \ |
262 \ | 262 \ |
263 /* Getters and Setters */ \ | 263 /* Getters and Setters */ \ |
264 F(LookupAccessor, 3, 1) \ | 264 F(LookupAccessor, 3, 1) \ |
265 \ | 265 \ |
266 /* ES5 */ \ | 266 /* ES5 */ \ |
267 F(ObjectFreeze, 1, 1) \ | 267 F(ObjectFreeze, 1, 1) \ |
268 \ | 268 \ |
269 /* Harmony modules */ \ | 269 /* Harmony modules */ \ |
270 F(IsJSModule, 1, 1) \ | 270 F(IsJSModule, 1, 1) \ |
271 \ | 271 \ |
272 /* Harmony symbols */ \ | 272 /* Harmony symbols */ \ |
273 F(CreateSymbol, 1, 1) \ | 273 F(CreateSymbol, 1, 1) \ |
274 F(CreatePrivateSymbol, 1, 1) \ | 274 F(CreatePrivateSymbol, 1, 1) \ |
275 F(CreateGlobalPrivateOwnSymbol, 1, 1) \ | 275 F(CreateGlobalPrivateOwnSymbol, 1, 1) \ |
276 F(CreatePrivateOwnSymbol, 1, 1) \ | 276 F(CreatePrivateOwnSymbol, 1, 1) \ |
277 F(NewSymbolWrapper, 1, 1) \ | 277 F(NewSymbolWrapper, 1, 1) \ |
278 F(SymbolDescription, 1, 1) \ | 278 F(SymbolDescription, 1, 1) \ |
279 F(SymbolRegistry, 0, 1) \ | 279 F(SymbolRegistry, 0, 1) \ |
280 F(SymbolIsPrivate, 1, 1) \ | 280 F(SymbolIsPrivate, 1, 1) \ |
281 \ | 281 \ |
282 /* Harmony proxies */ \ | 282 /* Harmony proxies */ \ |
283 F(CreateJSProxy, 2, 1) \ | 283 F(CreateJSProxy, 2, 1) \ |
284 F(CreateJSFunctionProxy, 4, 1) \ | 284 F(CreateJSFunctionProxy, 4, 1) \ |
285 F(IsJSProxy, 1, 1) \ | 285 F(IsJSProxy, 1, 1) \ |
286 F(IsJSFunctionProxy, 1, 1) \ | 286 F(IsJSFunctionProxy, 1, 1) \ |
287 F(GetHandler, 1, 1) \ | 287 F(GetHandler, 1, 1) \ |
288 F(GetCallTrap, 1, 1) \ | 288 F(GetCallTrap, 1, 1) \ |
289 F(GetConstructTrap, 1, 1) \ | 289 F(GetConstructTrap, 1, 1) \ |
290 F(Fix, 1, 1) \ | 290 F(Fix, 1, 1) \ |
291 \ | 291 \ |
292 /* Harmony sets */ \ | 292 /* Harmony sets */ \ |
293 F(SetInitialize, 1, 1) \ | 293 F(SetInitialize, 1, 1) \ |
294 F(SetAdd, 2, 1) \ | 294 F(SetAdd, 2, 1) \ |
295 F(SetHas, 2, 1) \ | 295 F(SetHas, 2, 1) \ |
296 F(SetDelete, 2, 1) \ | 296 F(SetDelete, 2, 1) \ |
297 F(SetClear, 1, 1) \ | 297 F(SetClear, 1, 1) \ |
298 F(SetGetSize, 1, 1) \ | 298 F(SetGetSize, 1, 1) \ |
299 \ | 299 \ |
300 F(SetIteratorInitialize, 3, 1) \ | 300 F(SetIteratorInitialize, 3, 1) \ |
301 F(SetIteratorNext, 2, 1) \ | 301 F(SetIteratorNext, 2, 1) \ |
302 \ | 302 \ |
303 /* Harmony maps */ \ | 303 /* Harmony maps */ \ |
304 F(MapInitialize, 1, 1) \ | 304 F(MapInitialize, 1, 1) \ |
305 F(MapGet, 2, 1) \ | 305 F(MapGet, 2, 1) \ |
306 F(MapHas, 2, 1) \ | 306 F(MapHas, 2, 1) \ |
307 F(MapDelete, 2, 1) \ | 307 F(MapDelete, 2, 1) \ |
308 F(MapClear, 1, 1) \ | 308 F(MapClear, 1, 1) \ |
309 F(MapSet, 3, 1) \ | 309 F(MapSet, 3, 1) \ |
310 F(MapGetSize, 1, 1) \ | 310 F(MapGetSize, 1, 1) \ |
311 \ | 311 \ |
312 F(MapIteratorInitialize, 3, 1) \ | 312 F(MapIteratorInitialize, 3, 1) \ |
313 F(MapIteratorNext, 2, 1) \ | 313 F(MapIteratorNext, 2, 1) \ |
314 \ | 314 \ |
315 /* Harmony weak maps and sets */ \ | 315 /* Harmony weak maps and sets */ \ |
316 F(WeakCollectionInitialize, 1, 1) \ | 316 F(WeakCollectionInitialize, 1, 1) \ |
317 F(WeakCollectionGet, 2, 1) \ | 317 F(WeakCollectionGet, 2, 1) \ |
318 F(WeakCollectionHas, 2, 1) \ | 318 F(WeakCollectionHas, 2, 1) \ |
319 F(WeakCollectionDelete, 2, 1) \ | 319 F(WeakCollectionDelete, 2, 1) \ |
320 F(WeakCollectionSet, 3, 1) \ | 320 F(WeakCollectionSet, 3, 1) \ |
321 \ | 321 \ |
322 F(GetWeakMapEntries, 1, 1) \ | 322 F(GetWeakMapEntries, 1, 1) \ |
323 F(GetWeakSetValues, 1, 1) \ | 323 F(GetWeakSetValues, 1, 1) \ |
324 \ | 324 \ |
325 /* Harmony events */ \ | 325 /* Harmony events */ \ |
326 F(EnqueueMicrotask, 1, 1) \ | 326 F(EnqueueMicrotask, 1, 1) \ |
327 F(RunMicrotasks, 0, 1) \ | 327 F(RunMicrotasks, 0, 1) \ |
328 \ | 328 \ |
329 /* Harmony observe */ \ | 329 /* Harmony observe */ \ |
330 F(IsObserved, 1, 1) \ | 330 F(IsObserved, 1, 1) \ |
331 F(SetIsObserved, 1, 1) \ | 331 F(SetIsObserved, 1, 1) \ |
332 F(GetObservationState, 0, 1) \ | 332 F(GetObservationState, 0, 1) \ |
333 F(ObservationWeakMapCreate, 0, 1) \ | 333 F(ObservationWeakMapCreate, 0, 1) \ |
334 F(ObserverObjectAndRecordHaveSameOrigin, 3, 1) \ | 334 F(ObserverObjectAndRecordHaveSameOrigin, 3, 1) \ |
335 F(ObjectWasCreatedInCurrentOrigin, 1, 1) \ | 335 F(ObjectWasCreatedInCurrentOrigin, 1, 1) \ |
336 F(GetObjectContextObjectObserve, 1, 1) \ | 336 F(GetObjectContextObjectObserve, 1, 1) \ |
337 F(GetObjectContextObjectGetNotifier, 1, 1) \ | 337 F(GetObjectContextObjectGetNotifier, 1, 1) \ |
338 F(GetObjectContextNotifierPerformChange, 1, 1) \ | 338 F(GetObjectContextNotifierPerformChange, 1, 1) \ |
339 \ | 339 \ |
340 /* Harmony typed arrays */ \ | 340 /* Harmony typed arrays */ \ |
341 F(ArrayBufferInitialize, 2, 1) \ | 341 F(ArrayBufferInitialize, 2, 1) \ |
342 F(ArrayBufferSliceImpl, 3, 1) \ | 342 F(ArrayBufferSliceImpl, 3, 1) \ |
343 F(ArrayBufferIsView, 1, 1) \ | 343 F(ArrayBufferIsView, 1, 1) \ |
344 F(ArrayBufferNeuter, 1, 1) \ | 344 F(ArrayBufferNeuter, 1, 1) \ |
345 \ | 345 \ |
346 F(TypedArrayInitializeFromArrayLike, 4, 1) \ | 346 F(TypedArrayInitializeFromArrayLike, 4, 1) \ |
347 F(TypedArrayGetBuffer, 1, 1) \ | 347 F(TypedArrayGetBuffer, 1, 1) \ |
348 F(TypedArraySetFastCases, 3, 1) \ | 348 F(TypedArraySetFastCases, 3, 1) \ |
349 \ | 349 \ |
350 F(DataViewGetBuffer, 1, 1) \ | 350 F(DataViewGetBuffer, 1, 1) \ |
351 F(DataViewGetInt8, 3, 1) \ | 351 F(DataViewGetInt8, 3, 1) \ |
352 F(DataViewGetUint8, 3, 1) \ | 352 F(DataViewGetUint8, 3, 1) \ |
353 F(DataViewGetInt16, 3, 1) \ | 353 F(DataViewGetInt16, 3, 1) \ |
354 F(DataViewGetUint16, 3, 1) \ | 354 F(DataViewGetUint16, 3, 1) \ |
355 F(DataViewGetInt32, 3, 1) \ | 355 F(DataViewGetInt32, 3, 1) \ |
356 F(DataViewGetUint32, 3, 1) \ | 356 F(DataViewGetUint32, 3, 1) \ |
357 F(DataViewGetFloat32, 3, 1) \ | 357 F(DataViewGetFloat32, 3, 1) \ |
358 F(DataViewGetFloat64, 3, 1) \ | 358 F(DataViewGetFloat64, 3, 1) \ |
359 \ | 359 \ |
360 F(DataViewSetInt8, 4, 1) \ | 360 F(DataViewSetInt8, 4, 1) \ |
361 F(DataViewSetUint8, 4, 1) \ | 361 F(DataViewSetUint8, 4, 1) \ |
362 F(DataViewSetInt16, 4, 1) \ | 362 F(DataViewSetInt16, 4, 1) \ |
363 F(DataViewSetUint16, 4, 1) \ | 363 F(DataViewSetUint16, 4, 1) \ |
364 F(DataViewSetInt32, 4, 1) \ | 364 F(DataViewSetInt32, 4, 1) \ |
365 F(DataViewSetUint32, 4, 1) \ | 365 F(DataViewSetUint32, 4, 1) \ |
366 F(DataViewSetFloat32, 4, 1) \ | 366 F(DataViewSetFloat32, 4, 1) \ |
367 F(DataViewSetFloat64, 4, 1) \ | 367 F(DataViewSetFloat64, 4, 1) \ |
368 \ | 368 \ |
369 /* Statements */ \ | 369 /* Statements */ \ |
370 F(NewObjectFromBound, 1, 1) \ | 370 F(NewObjectFromBound, 1, 1) \ |
371 \ | 371 \ |
372 /* Declarations and initialization */ \ | 372 /* Declarations and initialization */ \ |
373 F(InitializeVarGlobal, 3, 1) \ | 373 F(InitializeVarGlobal, 3, 1) \ |
374 F(OptimizeObjectForAddingMultipleProperties, 2, 1) \ | 374 F(OptimizeObjectForAddingMultipleProperties, 2, 1) \ |
375 \ | 375 \ |
376 /* Debugging */ \ | 376 /* Debugging */ \ |
377 F(DebugPrint, 1, 1) \ | 377 F(DebugPrint, 1, 1) \ |
378 F(GlobalPrint, 1, 1) \ | 378 F(GlobalPrint, 1, 1) \ |
379 F(DebugTrace, 0, 1) \ | 379 F(DebugTrace, 0, 1) \ |
380 F(TraceEnter, 0, 1) \ | 380 F(TraceEnter, 0, 1) \ |
381 F(TraceExit, 1, 1) \ | 381 F(TraceExit, 1, 1) \ |
382 F(Abort, 1, 1) \ | 382 F(Abort, 1, 1) \ |
383 F(AbortJS, 1, 1) \ | 383 F(AbortJS, 1, 1) \ |
384 /* ES5 */ \ | 384 /* ES5 */ \ |
385 F(OwnKeys, 1, 1) \ | 385 F(OwnKeys, 1, 1) \ |
386 \ | 386 \ |
387 /* Message objects */ \ | 387 /* Message objects */ \ |
388 F(MessageGetStartPosition, 1, 1) \ | 388 F(MessageGetStartPosition, 1, 1) \ |
389 F(MessageGetScript, 1, 1) \ | 389 F(MessageGetScript, 1, 1) \ |
390 \ | 390 \ |
391 /* Pseudo functions - handled as macros by parser */ \ | 391 /* Pseudo functions - handled as macros by parser */ \ |
392 F(IS_VAR, 1, 1) \ | 392 F(IS_VAR, 1, 1) \ |
393 \ | 393 \ |
394 /* expose boolean functions from objects-inl.h */ \ | 394 /* expose boolean functions from objects-inl.h */ \ |
395 F(HasFastSmiElements, 1, 1) \ | 395 F(HasFastSmiElements, 1, 1) \ |
396 F(HasFastSmiOrObjectElements, 1, 1) \ | 396 F(HasFastSmiOrObjectElements, 1, 1) \ |
397 F(HasFastObjectElements, 1, 1) \ | 397 F(HasFastObjectElements, 1, 1) \ |
398 F(HasFastDoubleElements, 1, 1) \ | 398 F(HasFastDoubleElements, 1, 1) \ |
399 F(HasFastHoleyElements, 1, 1) \ | 399 F(HasFastHoleyElements, 1, 1) \ |
400 F(HasDictionaryElements, 1, 1) \ | 400 F(HasDictionaryElements, 1, 1) \ |
401 F(HasSloppyArgumentsElements, 1, 1) \ | 401 F(HasSloppyArgumentsElements, 1, 1) \ |
402 F(HasExternalUint8ClampedElements, 1, 1) \ | 402 F(HasExternalUint8ClampedElements, 1, 1) \ |
403 F(HasExternalArrayElements, 1, 1) \ | 403 F(HasExternalArrayElements, 1, 1) \ |
404 F(HasExternalInt8Elements, 1, 1) \ | 404 F(HasExternalInt8Elements, 1, 1) \ |
405 F(HasExternalUint8Elements, 1, 1) \ | 405 F(HasExternalUint8Elements, 1, 1) \ |
406 F(HasExternalInt16Elements, 1, 1) \ | 406 F(HasExternalInt16Elements, 1, 1) \ |
407 F(HasExternalUint16Elements, 1, 1) \ | 407 F(HasExternalUint16Elements, 1, 1) \ |
408 F(HasExternalInt32Elements, 1, 1) \ | 408 F(HasExternalInt32Elements, 1, 1) \ |
409 F(HasExternalUint32Elements, 1, 1) \ | 409 F(HasExternalUint32Elements, 1, 1) \ |
410 F(HasExternalFloat32Elements, 1, 1) \ | 410 F(HasExternalFloat32Elements, 1, 1) \ |
411 F(HasExternalFloat64Elements, 1, 1) \ | 411 F(HasExternalFloat64Elements, 1, 1) \ |
412 F(HasFixedUint8ClampedElements, 1, 1) \ | 412 F(HasFixedUint8ClampedElements, 1, 1) \ |
413 F(HasFixedInt8Elements, 1, 1) \ | 413 F(HasFixedInt8Elements, 1, 1) \ |
414 F(HasFixedUint8Elements, 1, 1) \ | 414 F(HasFixedUint8Elements, 1, 1) \ |
415 F(HasFixedInt16Elements, 1, 1) \ | 415 F(HasFixedInt16Elements, 1, 1) \ |
416 F(HasFixedUint16Elements, 1, 1) \ | 416 F(HasFixedUint16Elements, 1, 1) \ |
417 F(HasFixedInt32Elements, 1, 1) \ | 417 F(HasFixedInt32Elements, 1, 1) \ |
418 F(HasFixedUint32Elements, 1, 1) \ | 418 F(HasFixedUint32Elements, 1, 1) \ |
419 F(HasFixedFloat32Elements, 1, 1) \ | 419 F(HasFixedFloat32Elements, 1, 1) \ |
420 F(HasFixedFloat64Elements, 1, 1) \ | 420 F(HasFixedFloat64Elements, 1, 1) \ |
421 F(HasFastProperties, 1, 1) \ | 421 F(HasFastProperties, 1, 1) \ |
422 F(TransitionElementsKind, 2, 1) \ | 422 F(TransitionElementsKind, 2, 1) \ |
423 F(HaveSameMap, 2, 1) \ | 423 F(HaveSameMap, 2, 1) \ |
424 F(IsJSGlobalProxy, 1, 1) \ | 424 F(IsJSGlobalProxy, 1, 1) \ |
425 F(ForInInit, 2, 2) /* TODO(turbofan): Only temporary */ \ | |
426 F(ForInNext, 4, 2) /* TODO(turbofan): Only temporary */ \ | |
427 F(ForInCacheArrayLength, 2, 1) /* TODO(turbofan): Only temporary */ | 425 F(ForInCacheArrayLength, 2, 1) /* TODO(turbofan): Only temporary */ |
428 | 426 |
429 | 427 |
430 #define RUNTIME_FUNCTION_LIST_ALWAYS_3(F) \ | 428 #define RUNTIME_FUNCTION_LIST_ALWAYS_3(F) \ |
431 /* String and Regexp */ \ | 429 /* String and Regexp */ \ |
432 F(NumberToStringRT, 1, 1) \ | 430 F(NumberToStringRT, 1, 1) \ |
433 F(RegExpConstructResult, 3, 1) \ | 431 F(RegExpConstructResult, 3, 1) \ |
434 F(RegExpExecRT, 4, 1) \ | 432 F(RegExpExecRT, 4, 1) \ |
435 F(StringAdd, 2, 1) \ | 433 F(StringAdd, 2, 1) \ |
436 F(SubString, 3, 1) \ | 434 F(SubString, 3, 1) \ |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
488 F(PromoteScheduledException, 0, 1) \ | 486 F(PromoteScheduledException, 0, 1) \ |
489 \ | 487 \ |
490 /* Contexts */ \ | 488 /* Contexts */ \ |
491 F(NewGlobalContext, 2, 1) \ | 489 F(NewGlobalContext, 2, 1) \ |
492 F(NewFunctionContext, 1, 1) \ | 490 F(NewFunctionContext, 1, 1) \ |
493 F(PushWithContext, 2, 1) \ | 491 F(PushWithContext, 2, 1) \ |
494 F(PushCatchContext, 3, 1) \ | 492 F(PushCatchContext, 3, 1) \ |
495 F(PushBlockContext, 2, 1) \ | 493 F(PushBlockContext, 2, 1) \ |
496 F(PushModuleContext, 2, 1) \ | 494 F(PushModuleContext, 2, 1) \ |
497 F(DeleteLookupSlot, 2, 1) \ | 495 F(DeleteLookupSlot, 2, 1) \ |
498 F(LoadLookupSlot, 2, 2) \ | |
499 F(LoadLookupSlotNoReferenceError, 2, 2) \ | |
500 F(StoreLookupSlot, 4, 1) \ | 496 F(StoreLookupSlot, 4, 1) \ |
501 \ | 497 \ |
502 /* Declarations and initialization */ \ | 498 /* Declarations and initialization */ \ |
503 F(DeclareGlobals, 3, 1) \ | 499 F(DeclareGlobals, 3, 1) \ |
504 F(DeclareModules, 1, 1) \ | 500 F(DeclareModules, 1, 1) \ |
505 F(DeclareLookupSlot, 4, 1) \ | 501 F(DeclareLookupSlot, 4, 1) \ |
506 F(InitializeConstGlobal, 2, 1) \ | 502 F(InitializeConstGlobal, 2, 1) \ |
507 F(InitializeLegacyConstLookupSlot, 3, 1) \ | 503 F(InitializeLegacyConstLookupSlot, 3, 1) \ |
508 \ | 504 \ |
509 /* Eval */ \ | |
510 F(ResolvePossiblyDirectEval, 5, 2) \ | |
511 \ | |
512 /* Maths */ \ | 505 /* Maths */ \ |
513 F(MathPowSlow, 2, 1) \ | 506 F(MathPowSlow, 2, 1) \ |
514 F(MathPowRT, 2, 1) | 507 F(MathPowRT, 2, 1) |
515 | 508 |
516 | 509 |
517 #define RUNTIME_FUNCTION_LIST_DEBUGGER(F) \ | 510 #define RUNTIME_FUNCTION_LIST_RETURN_PAIR(F) \ |
518 /* Debugger support*/ \ | 511 F(LoadLookupSlot, 2, 2) \ |
519 F(DebugBreak, 0, 1) \ | 512 F(LoadLookupSlotNoReferenceError, 2, 2) \ |
520 F(SetDebugEventListener, 2, 1) \ | 513 F(ResolvePossiblyDirectEval, 5, 2) \ |
521 F(Break, 0, 1) \ | 514 F(ForInInit, 2, 2) /* TODO(turbofan): Only temporary */ \ |
522 F(DebugGetPropertyDetails, 2, 1) \ | 515 F(ForInNext, 4, 2) /* TODO(turbofan): Only temporary */ |
523 F(DebugGetProperty, 2, 1) \ | 516 |
524 F(DebugPropertyTypeFromDetails, 1, 1) \ | 517 |
525 F(DebugPropertyAttributesFromDetails, 1, 1) \ | 518 #define RUNTIME_FUNCTION_LIST_DEBUGGER(F) \ |
526 F(DebugPropertyIndexFromDetails, 1, 1) \ | 519 /* Debugger support*/ \ |
527 F(DebugNamedInterceptorPropertyValue, 2, 1) \ | 520 F(DebugBreak, 0, 1) \ |
528 F(DebugIndexedInterceptorElementValue, 2, 1) \ | 521 F(SetDebugEventListener, 2, 1) \ |
529 F(CheckExecutionState, 1, 1) \ | 522 F(Break, 0, 1) \ |
530 F(GetFrameCount, 1, 1) \ | 523 F(DebugGetPropertyDetails, 2, 1) \ |
531 F(GetFrameDetails, 2, 1) \ | 524 F(DebugGetProperty, 2, 1) \ |
532 F(GetScopeCount, 2, 1) \ | 525 F(DebugPropertyTypeFromDetails, 1, 1) \ |
533 F(GetStepInPositions, 2, 1) \ | 526 F(DebugPropertyAttributesFromDetails, 1, 1) \ |
534 F(GetScopeDetails, 4, 1) \ | 527 F(DebugPropertyIndexFromDetails, 1, 1) \ |
535 F(GetAllScopesDetails, 4, 1) \ | 528 F(DebugNamedInterceptorPropertyValue, 2, 1) \ |
536 F(GetFunctionScopeCount, 1, 1) \ | 529 F(DebugIndexedInterceptorElementValue, 2, 1) \ |
537 F(GetFunctionScopeDetails, 2, 1) \ | 530 F(CheckExecutionState, 1, 1) \ |
538 F(SetScopeVariableValue, 6, 1) \ | 531 F(GetFrameCount, 1, 1) \ |
539 F(DebugPrintScopes, 0, 1) \ | 532 F(GetFrameDetails, 2, 1) \ |
540 F(GetThreadCount, 1, 1) \ | 533 F(GetScopeCount, 2, 1) \ |
541 F(GetThreadDetails, 2, 1) \ | 534 F(GetStepInPositions, 2, 1) \ |
542 F(SetDisableBreak, 1, 1) \ | 535 F(GetScopeDetails, 4, 1) \ |
543 F(GetBreakLocations, 2, 1) \ | 536 F(GetAllScopesDetails, 4, 1) \ |
544 F(SetFunctionBreakPoint, 3, 1) \ | 537 F(GetFunctionScopeCount, 1, 1) \ |
545 F(SetScriptBreakPoint, 4, 1) \ | 538 F(GetFunctionScopeDetails, 2, 1) \ |
546 F(ClearBreakPoint, 1, 1) \ | 539 F(SetScopeVariableValue, 6, 1) \ |
547 F(ChangeBreakOnException, 2, 1) \ | 540 F(DebugPrintScopes, 0, 1) \ |
548 F(IsBreakOnException, 1, 1) \ | 541 F(GetThreadCount, 1, 1) \ |
549 F(PrepareStep, 4, 1) \ | 542 F(GetThreadDetails, 2, 1) \ |
550 F(ClearStepping, 0, 1) \ | 543 F(SetDisableBreak, 1, 1) \ |
551 F(DebugEvaluate, 6, 1) \ | 544 F(GetBreakLocations, 2, 1) \ |
552 F(DebugEvaluateGlobal, 4, 1) \ | 545 F(SetFunctionBreakPoint, 3, 1) \ |
553 F(DebugGetLoadedScripts, 0, 1) \ | 546 F(SetScriptBreakPoint, 4, 1) \ |
554 F(DebugReferencedBy, 3, 1) \ | 547 F(ClearBreakPoint, 1, 1) \ |
555 F(DebugConstructedBy, 2, 1) \ | 548 F(ChangeBreakOnException, 2, 1) \ |
556 F(DebugGetPrototype, 1, 1) \ | 549 F(IsBreakOnException, 1, 1) \ |
557 F(DebugSetScriptSource, 2, 1) \ | 550 F(PrepareStep, 4, 1) \ |
558 F(DebugCallbackSupportsStepping, 1, 1) \ | 551 F(ClearStepping, 0, 1) \ |
559 F(SystemBreak, 0, 1) \ | 552 F(DebugEvaluate, 6, 1) \ |
560 F(DebugDisassembleFunction, 1, 1) \ | 553 F(DebugEvaluateGlobal, 4, 1) \ |
561 F(DebugDisassembleConstructor, 1, 1) \ | 554 F(DebugGetLoadedScripts, 0, 1) \ |
562 F(FunctionGetInferredName, 1, 1) \ | 555 F(DebugReferencedBy, 3, 1) \ |
| 556 F(DebugConstructedBy, 2, 1) \ |
| 557 F(DebugGetPrototype, 1, 1) \ |
| 558 F(DebugSetScriptSource, 2, 1) \ |
| 559 F(DebugCallbackSupportsStepping, 1, 1) \ |
| 560 F(SystemBreak, 0, 1) \ |
| 561 F(DebugDisassembleFunction, 1, 1) \ |
| 562 F(DebugDisassembleConstructor, 1, 1) \ |
| 563 F(FunctionGetInferredName, 1, 1) \ |
563 F(LiveEditFindSharedFunctionInfosForScript, 1, 1) \ | 564 F(LiveEditFindSharedFunctionInfosForScript, 1, 1) \ |
564 F(LiveEditGatherCompileInfo, 2, 1) \ | 565 F(LiveEditGatherCompileInfo, 2, 1) \ |
565 F(LiveEditReplaceScript, 3, 1) \ | 566 F(LiveEditReplaceScript, 3, 1) \ |
566 F(LiveEditReplaceFunctionCode, 2, 1) \ | 567 F(LiveEditReplaceFunctionCode, 2, 1) \ |
567 F(LiveEditFunctionSourceUpdated, 1, 1) \ | 568 F(LiveEditFunctionSourceUpdated, 1, 1) \ |
568 F(LiveEditFunctionSetScript, 2, 1) \ | 569 F(LiveEditFunctionSetScript, 2, 1) \ |
569 F(LiveEditReplaceRefToNestedFunction, 3, 1) \ | 570 F(LiveEditReplaceRefToNestedFunction, 3, 1) \ |
570 F(LiveEditPatchFunctionPositions, 2, 1) \ | 571 F(LiveEditPatchFunctionPositions, 2, 1) \ |
571 F(LiveEditCheckAndDropActivations, 2, 1) \ | 572 F(LiveEditCheckAndDropActivations, 2, 1) \ |
572 F(LiveEditCompareStrings, 2, 1) \ | 573 F(LiveEditCompareStrings, 2, 1) \ |
573 F(LiveEditRestartFrame, 2, 1) \ | 574 F(LiveEditRestartFrame, 2, 1) \ |
574 F(GetFunctionCodePositionFromSource, 2, 1) \ | 575 F(GetFunctionCodePositionFromSource, 2, 1) \ |
575 F(ExecuteInDebugContext, 2, 1) \ | 576 F(ExecuteInDebugContext, 2, 1) \ |
576 \ | 577 \ |
577 F(SetFlags, 1, 1) \ | 578 F(SetFlags, 1, 1) \ |
578 F(CollectGarbage, 1, 1) \ | 579 F(CollectGarbage, 1, 1) \ |
579 F(GetHeapUsage, 0, 1) \ | 580 F(GetHeapUsage, 0, 1) |
580 | 581 |
581 | 582 |
582 #ifdef V8_I18N_SUPPORT | 583 #ifdef V8_I18N_SUPPORT |
583 #define RUNTIME_FUNCTION_LIST_I18N_SUPPORT(F) \ | 584 #define RUNTIME_FUNCTION_LIST_I18N_SUPPORT(F) \ |
584 /* i18n support */ \ | 585 /* i18n support */ \ |
585 /* Standalone, helper methods. */ \ | 586 /* Standalone, helper methods. */ \ |
586 F(CanonicalizeLanguageTag, 1, 1) \ | 587 F(CanonicalizeLanguageTag, 1, 1) \ |
587 F(AvailableLocalesOf, 1, 1) \ | 588 F(AvailableLocalesOf, 1, 1) \ |
588 F(GetDefaultICULocale, 0, 1) \ | 589 F(GetDefaultICULocale, 0, 1) \ |
589 F(GetLanguageTagVariants, 1, 1) \ | 590 F(GetLanguageTagVariants, 1, 1) \ |
590 F(IsInitializedIntlObject, 1, 1) \ | 591 F(IsInitializedIntlObject, 1, 1) \ |
591 F(IsInitializedIntlObjectOfType, 2, 1) \ | 592 F(IsInitializedIntlObjectOfType, 2, 1) \ |
592 F(MarkAsInitializedIntlObjectOfType, 3, 1) \ | 593 F(MarkAsInitializedIntlObjectOfType, 3, 1) \ |
593 F(GetImplFromInitializedIntlObject, 1, 1) \ | 594 F(GetImplFromInitializedIntlObject, 1, 1) \ |
594 \ | 595 \ |
595 /* Date format and parse. */ \ | 596 /* Date format and parse. */ \ |
596 F(CreateDateTimeFormat, 3, 1) \ | 597 F(CreateDateTimeFormat, 3, 1) \ |
597 F(InternalDateFormat, 2, 1) \ | 598 F(InternalDateFormat, 2, 1) \ |
598 F(InternalDateParse, 2, 1) \ | 599 F(InternalDateParse, 2, 1) \ |
599 \ | 600 \ |
600 /* Number format and parse. */ \ | 601 /* Number format and parse. */ \ |
601 F(CreateNumberFormat, 3, 1) \ | 602 F(CreateNumberFormat, 3, 1) \ |
602 F(InternalNumberFormat, 2, 1) \ | 603 F(InternalNumberFormat, 2, 1) \ |
603 F(InternalNumberParse, 2, 1) \ | 604 F(InternalNumberParse, 2, 1) \ |
604 \ | 605 \ |
605 /* Collator. */ \ | 606 /* Collator. */ \ |
606 F(CreateCollator, 3, 1) \ | 607 F(CreateCollator, 3, 1) \ |
607 F(InternalCompare, 3, 1) \ | 608 F(InternalCompare, 3, 1) \ |
608 \ | 609 \ |
609 /* String.prototype.normalize. */ \ | 610 /* String.prototype.normalize. */ \ |
610 F(StringNormalize, 2, 1) \ | 611 F(StringNormalize, 2, 1) \ |
611 \ | 612 \ |
612 /* Break iterator. */ \ | 613 /* Break iterator. */ \ |
613 F(CreateBreakIterator, 3, 1) \ | 614 F(CreateBreakIterator, 3, 1) \ |
614 F(BreakIteratorAdoptText, 2, 1) \ | 615 F(BreakIteratorAdoptText, 2, 1) \ |
615 F(BreakIteratorFirst, 1, 1) \ | 616 F(BreakIteratorFirst, 1, 1) \ |
616 F(BreakIteratorNext, 1, 1) \ | 617 F(BreakIteratorNext, 1, 1) \ |
617 F(BreakIteratorCurrent, 1, 1) \ | 618 F(BreakIteratorCurrent, 1, 1) \ |
618 F(BreakIteratorBreakType, 1, 1) \ | 619 F(BreakIteratorBreakType, 1, 1) |
619 | 620 |
620 #else | 621 #else |
621 #define RUNTIME_FUNCTION_LIST_I18N_SUPPORT(F) | 622 #define RUNTIME_FUNCTION_LIST_I18N_SUPPORT(F) |
622 #endif | 623 #endif |
623 | 624 |
624 | 625 |
625 #ifdef DEBUG | 626 #ifdef DEBUG |
626 #define RUNTIME_FUNCTION_LIST_DEBUG(F) \ | 627 #define RUNTIME_FUNCTION_LIST_DEBUG(F) \ |
627 /* Testing */ \ | 628 /* Testing */ \ |
628 F(ListNatives, 0, 1) | 629 F(ListNatives, 0, 1) |
629 #else | 630 #else |
630 #define RUNTIME_FUNCTION_LIST_DEBUG(F) | 631 #define RUNTIME_FUNCTION_LIST_DEBUG(F) |
631 #endif | 632 #endif |
632 | 633 |
633 // ---------------------------------------------------------------------------- | 634 // ---------------------------------------------------------------------------- |
634 // RUNTIME_FUNCTION_LIST defines all runtime functions accessed | 635 // RUNTIME_FUNCTION_LIST defines all runtime functions accessed |
635 // either directly by id (via the code generator), or indirectly | 636 // either directly by id (via the code generator), or indirectly |
636 // via a native call by name (from within JS code). | 637 // via a native call by name (from within JS code). |
637 // Entries have the form F(name, number of arguments, number of return values). | 638 // Entries have the form F(name, number of arguments, number of return values). |
638 | 639 |
639 #define RUNTIME_FUNCTION_LIST(F) \ | 640 #define RUNTIME_FUNCTION_LIST_RETURN_OBJECT(F) \ |
640 RUNTIME_FUNCTION_LIST_ALWAYS_1(F) \ | 641 RUNTIME_FUNCTION_LIST_ALWAYS_1(F) \ |
641 RUNTIME_FUNCTION_LIST_ALWAYS_2(F) \ | 642 RUNTIME_FUNCTION_LIST_ALWAYS_2(F) \ |
642 RUNTIME_FUNCTION_LIST_ALWAYS_3(F) \ | 643 RUNTIME_FUNCTION_LIST_ALWAYS_3(F) \ |
643 RUNTIME_FUNCTION_LIST_DEBUG(F) \ | 644 RUNTIME_FUNCTION_LIST_DEBUG(F) \ |
644 RUNTIME_FUNCTION_LIST_DEBUGGER(F) \ | 645 RUNTIME_FUNCTION_LIST_DEBUGGER(F) \ |
645 RUNTIME_FUNCTION_LIST_I18N_SUPPORT(F) | 646 RUNTIME_FUNCTION_LIST_I18N_SUPPORT(F) |
646 | 647 |
| 648 |
| 649 #define RUNTIME_FUNCTION_LIST(F) \ |
| 650 RUNTIME_FUNCTION_LIST_RETURN_OBJECT(F) \ |
| 651 RUNTIME_FUNCTION_LIST_RETURN_PAIR(F) |
| 652 |
647 // ---------------------------------------------------------------------------- | 653 // ---------------------------------------------------------------------------- |
648 // INLINE_FUNCTION_LIST defines all inlined functions accessed | 654 // INLINE_FUNCTION_LIST defines all inlined functions accessed |
649 // with a native call of the form %_name from within JS code. | 655 // with a native call of the form %_name from within JS code. |
650 // Entries have the form F(name, number of arguments, number of return values). | 656 // Entries have the form F(name, number of arguments, number of return values). |
651 #define INLINE_FUNCTION_LIST(F) \ | 657 #define INLINE_FUNCTION_LIST(F) \ |
652 F(IsSmi, 1, 1) \ | 658 F(IsSmi, 1, 1) \ |
653 F(IsNonNegativeSmi, 1, 1) \ | 659 F(IsNonNegativeSmi, 1, 1) \ |
654 F(IsArray, 1, 1) \ | 660 F(IsArray, 1, 1) \ |
655 F(IsRegExp, 1, 1) \ | 661 F(IsRegExp, 1, 1) \ |
656 F(IsConstructCall, 0, 1) \ | 662 F(IsConstructCall, 0, 1) \ |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
691 | 697 |
692 | 698 |
693 // ---------------------------------------------------------------------------- | 699 // ---------------------------------------------------------------------------- |
694 // INLINE_OPTIMIZED_FUNCTION_LIST defines all inlined functions accessed | 700 // INLINE_OPTIMIZED_FUNCTION_LIST defines all inlined functions accessed |
695 // with a native call of the form %_name from within JS code that also have | 701 // with a native call of the form %_name from within JS code that also have |
696 // a corresponding runtime function, that is called from non-optimized code. | 702 // a corresponding runtime function, that is called from non-optimized code. |
697 // For the benefit of (fuzz) tests, the runtime version can also be called | 703 // For the benefit of (fuzz) tests, the runtime version can also be called |
698 // directly as %name (i.e. without the leading underscore). | 704 // directly as %name (i.e. without the leading underscore). |
699 // Entries have the form F(name, number of arguments, number of return values). | 705 // Entries have the form F(name, number of arguments, number of return values). |
700 #define INLINE_OPTIMIZED_FUNCTION_LIST(F) \ | 706 #define INLINE_OPTIMIZED_FUNCTION_LIST(F) \ |
701 /* Typed Arrays */ \ | 707 /* Typed Arrays */ \ |
702 F(TypedArrayInitialize, 5, 1) \ | 708 F(TypedArrayInitialize, 5, 1) \ |
703 F(DataViewInitialize, 4, 1) \ | 709 F(DataViewInitialize, 4, 1) \ |
704 F(MaxSmi, 0, 1) \ | 710 F(MaxSmi, 0, 1) \ |
705 F(TypedArrayMaxSizeInHeap, 0, 1) \ | 711 F(TypedArrayMaxSizeInHeap, 0, 1) \ |
706 F(ArrayBufferViewGetByteLength, 1, 1) \ | 712 F(ArrayBufferViewGetByteLength, 1, 1) \ |
707 F(ArrayBufferViewGetByteOffset, 1, 1) \ | 713 F(ArrayBufferViewGetByteOffset, 1, 1) \ |
708 F(TypedArrayGetLength, 1, 1) \ | 714 F(TypedArrayGetLength, 1, 1) \ |
709 /* ArrayBuffer */ \ | 715 /* ArrayBuffer */ \ |
710 F(ArrayBufferGetByteLength, 1, 1) \ | 716 F(ArrayBufferGetByteLength, 1, 1) \ |
711 /* Maths */ \ | 717 /* Maths */ \ |
712 F(ConstructDouble, 2, 1) \ | 718 F(ConstructDouble, 2, 1) \ |
713 F(DoubleHi, 1, 1) \ | 719 F(DoubleHi, 1, 1) \ |
714 F(DoubleLo, 1, 1) \ | 720 F(DoubleLo, 1, 1) \ |
715 F(MathSqrtRT, 1, 1) \ | 721 F(MathSqrtRT, 1, 1) \ |
716 F(MathLogRT, 1, 1) | 722 F(MathLogRT, 1, 1) |
717 | 723 |
718 | 724 |
719 //--------------------------------------------------------------------------- | 725 //--------------------------------------------------------------------------- |
720 // Runtime provides access to all C++ runtime functions. | 726 // Runtime provides access to all C++ runtime functions. |
721 | 727 |
722 class RuntimeState { | 728 class RuntimeState { |
723 public: | 729 public: |
724 StaticResource<ConsStringIteratorOp>* string_iterator() { | 730 StaticResource<ConsStringIteratorOp>* string_iterator() { |
725 return &string_iterator_; | 731 return &string_iterator_; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
758 friend class Runtime; | 764 friend class Runtime; |
759 | 765 |
760 DISALLOW_COPY_AND_ASSIGN(RuntimeState); | 766 DISALLOW_COPY_AND_ASSIGN(RuntimeState); |
761 }; | 767 }; |
762 | 768 |
763 | 769 |
764 class Runtime : public AllStatic { | 770 class Runtime : public AllStatic { |
765 public: | 771 public: |
766 enum FunctionId { | 772 enum FunctionId { |
767 #define F(name, nargs, ressize) k##name, | 773 #define F(name, nargs, ressize) k##name, |
768 RUNTIME_FUNCTION_LIST(F) | 774 RUNTIME_FUNCTION_LIST(F) INLINE_OPTIMIZED_FUNCTION_LIST(F) |
769 INLINE_OPTIMIZED_FUNCTION_LIST(F) | |
770 #undef F | 775 #undef F |
771 #define F(name, nargs, ressize) kInline##name, | 776 #define F(name, nargs, ressize) kInline##name, |
772 INLINE_FUNCTION_LIST(F) | 777 INLINE_FUNCTION_LIST(F) |
773 #undef F | 778 #undef F |
774 #define F(name, nargs, ressize) kInlineOptimized##name, | 779 #define F(name, nargs, ressize) kInlineOptimized##name, |
775 INLINE_OPTIMIZED_FUNCTION_LIST(F) | 780 INLINE_OPTIMIZED_FUNCTION_LIST(F) |
776 #undef F | 781 #undef F |
777 kNumFunctions, | 782 kNumFunctions, |
778 kFirstInlineFunction = kInlineIsSmi | 783 kFirstInlineFunction = kInlineIsSmi |
779 }; | 784 }; |
780 | 785 |
781 enum IntrinsicType { | 786 enum IntrinsicType { RUNTIME, INLINE, INLINE_OPTIMIZED }; |
782 RUNTIME, | |
783 INLINE, | |
784 INLINE_OPTIMIZED | |
785 }; | |
786 | 787 |
787 // Intrinsic function descriptor. | 788 // Intrinsic function descriptor. |
788 struct Function { | 789 struct Function { |
789 FunctionId function_id; | 790 FunctionId function_id; |
790 IntrinsicType intrinsic_type; | 791 IntrinsicType intrinsic_type; |
791 // The JS name of the function. | 792 // The JS name of the function. |
792 const char* name; | 793 const char* name; |
793 | 794 |
794 // The C++ (native) entry point. NULL if the function is inlined. | 795 // The C++ (native) entry point. NULL if the function is inlined. |
795 byte* entry; | 796 byte* entry; |
(...skipping 15 matching lines...) Expand all Loading... |
811 // Get the intrinsic function with the given name, which must be internalized. | 812 // Get the intrinsic function with the given name, which must be internalized. |
812 static const Function* FunctionForName(Handle<String> name); | 813 static const Function* FunctionForName(Handle<String> name); |
813 | 814 |
814 // Get the intrinsic function with the given FunctionId. | 815 // Get the intrinsic function with the given FunctionId. |
815 static const Function* FunctionForId(FunctionId id); | 816 static const Function* FunctionForId(FunctionId id); |
816 | 817 |
817 // Get the intrinsic function with the given function entry address. | 818 // Get the intrinsic function with the given function entry address. |
818 static const Function* FunctionForEntry(Address ref); | 819 static const Function* FunctionForEntry(Address ref); |
819 | 820 |
820 // General-purpose helper functions for runtime system. | 821 // General-purpose helper functions for runtime system. |
821 static int StringMatch(Isolate* isolate, | 822 static int StringMatch(Isolate* isolate, Handle<String> sub, |
822 Handle<String> sub, | 823 Handle<String> pat, int index); |
823 Handle<String> pat, | |
824 int index); | |
825 | 824 |
826 static bool IsUpperCaseChar(RuntimeState* runtime_state, uint16_t ch); | 825 static bool IsUpperCaseChar(RuntimeState* runtime_state, uint16_t ch); |
827 | 826 |
828 // TODO(1240886): Some of the following methods are *not* handle safe, but | 827 // TODO(1240886): Some of the following methods are *not* handle safe, but |
829 // accept handle arguments. This seems fragile. | 828 // accept handle arguments. This seems fragile. |
830 | 829 |
831 // Support getting the characters in a string using [] notation as | 830 // Support getting the characters in a string using [] notation as |
832 // in Firefox/SpiderMonkey, Safari and Opera. | 831 // in Firefox/SpiderMonkey, Safari and Opera. |
833 MUST_USE_RESULT static MaybeHandle<Object> GetElementOrCharAt( | 832 MUST_USE_RESULT static MaybeHandle<Object> GetElementOrCharAt( |
834 Isolate* isolate, | 833 Isolate* isolate, Handle<Object> object, uint32_t index); |
835 Handle<Object> object, | |
836 uint32_t index); | |
837 | 834 |
838 MUST_USE_RESULT static MaybeHandle<Object> SetObjectProperty( | 835 MUST_USE_RESULT static MaybeHandle<Object> SetObjectProperty( |
839 Isolate* isolate, Handle<Object> object, Handle<Object> key, | 836 Isolate* isolate, Handle<Object> object, Handle<Object> key, |
840 Handle<Object> value, StrictMode strict_mode); | 837 Handle<Object> value, StrictMode strict_mode); |
841 | 838 |
842 MUST_USE_RESULT static MaybeHandle<Object> DefineObjectProperty( | 839 MUST_USE_RESULT static MaybeHandle<Object> DefineObjectProperty( |
843 Handle<JSObject> object, Handle<Object> key, Handle<Object> value, | 840 Handle<JSObject> object, Handle<Object> key, Handle<Object> value, |
844 PropertyAttributes attr); | 841 PropertyAttributes attr); |
845 | 842 |
846 MUST_USE_RESULT static MaybeHandle<Object> DeleteObjectProperty( | 843 MUST_USE_RESULT static MaybeHandle<Object> DeleteObjectProperty( |
847 Isolate* isolate, | 844 Isolate* isolate, Handle<JSReceiver> object, Handle<Object> key, |
848 Handle<JSReceiver> object, | |
849 Handle<Object> key, | |
850 JSReceiver::DeleteMode mode); | 845 JSReceiver::DeleteMode mode); |
851 | 846 |
852 MUST_USE_RESULT static MaybeHandle<Object> HasObjectProperty( | 847 MUST_USE_RESULT static MaybeHandle<Object> HasObjectProperty( |
853 Isolate* isolate, | 848 Isolate* isolate, Handle<JSReceiver> object, Handle<Object> key); |
854 Handle<JSReceiver> object, | |
855 Handle<Object> key); | |
856 | 849 |
857 MUST_USE_RESULT static MaybeHandle<Object> GetObjectProperty( | 850 MUST_USE_RESULT static MaybeHandle<Object> GetObjectProperty( |
858 Isolate* isolate, | 851 Isolate* isolate, Handle<Object> object, Handle<Object> key); |
859 Handle<Object> object, | |
860 Handle<Object> key); | |
861 | 852 |
862 static void SetupArrayBuffer(Isolate* isolate, | 853 static void SetupArrayBuffer(Isolate* isolate, |
863 Handle<JSArrayBuffer> array_buffer, | 854 Handle<JSArrayBuffer> array_buffer, |
864 bool is_external, | 855 bool is_external, void* data, |
865 void* data, | |
866 size_t allocated_length); | 856 size_t allocated_length); |
867 | 857 |
868 static bool SetupArrayBufferAllocatingData( | 858 static bool SetupArrayBufferAllocatingData(Isolate* isolate, |
869 Isolate* isolate, | 859 Handle<JSArrayBuffer> array_buffer, |
870 Handle<JSArrayBuffer> array_buffer, | 860 size_t allocated_length, |
871 size_t allocated_length, | 861 bool initialize = true); |
872 bool initialize = true); | |
873 | 862 |
874 static void NeuterArrayBuffer(Handle<JSArrayBuffer> array_buffer); | 863 static void NeuterArrayBuffer(Handle<JSArrayBuffer> array_buffer); |
875 | 864 |
876 static void FreeArrayBuffer( | 865 static void FreeArrayBuffer(Isolate* isolate, |
877 Isolate* isolate, | 866 JSArrayBuffer* phantom_array_buffer); |
878 JSArrayBuffer* phantom_array_buffer); | |
879 | 867 |
880 enum TypedArrayId { | 868 enum TypedArrayId { |
881 // arrayIds below should be synchromized with typedarray.js natives. | 869 // arrayIds below should be synchromized with typedarray.js natives. |
882 ARRAY_ID_UINT8 = 1, | 870 ARRAY_ID_UINT8 = 1, |
883 ARRAY_ID_INT8 = 2, | 871 ARRAY_ID_INT8 = 2, |
884 ARRAY_ID_UINT16 = 3, | 872 ARRAY_ID_UINT16 = 3, |
885 ARRAY_ID_INT16 = 4, | 873 ARRAY_ID_INT16 = 4, |
886 ARRAY_ID_UINT32 = 5, | 874 ARRAY_ID_UINT32 = 5, |
887 ARRAY_ID_INT32 = 6, | 875 ARRAY_ID_INT32 = 6, |
888 ARRAY_ID_FLOAT32 = 7, | 876 ARRAY_ID_FLOAT32 = 7, |
889 ARRAY_ID_FLOAT64 = 8, | 877 ARRAY_ID_FLOAT64 = 8, |
890 ARRAY_ID_UINT8_CLAMPED = 9, | 878 ARRAY_ID_UINT8_CLAMPED = 9, |
891 | |
892 ARRAY_ID_FIRST = ARRAY_ID_UINT8, | 879 ARRAY_ID_FIRST = ARRAY_ID_UINT8, |
893 ARRAY_ID_LAST = ARRAY_ID_UINT8_CLAMPED | 880 ARRAY_ID_LAST = ARRAY_ID_UINT8_CLAMPED |
894 }; | 881 }; |
895 | 882 |
896 static void ArrayIdToTypeAndSize(int array_id, | 883 static void ArrayIdToTypeAndSize(int array_id, ExternalArrayType* type, |
897 ExternalArrayType *type, | 884 ElementsKind* external_elements_kind, |
898 ElementsKind* external_elements_kind, | 885 ElementsKind* fixed_elements_kind, |
899 ElementsKind* fixed_elements_kind, | 886 size_t* element_size); |
900 size_t *element_size); | |
901 | 887 |
902 // Used in runtime.cc and hydrogen's VisitArrayLiteral. | 888 // Used in runtime.cc and hydrogen's VisitArrayLiteral. |
903 MUST_USE_RESULT static MaybeHandle<Object> CreateArrayLiteralBoilerplate( | 889 MUST_USE_RESULT static MaybeHandle<Object> CreateArrayLiteralBoilerplate( |
904 Isolate* isolate, | 890 Isolate* isolate, Handle<FixedArray> literals, |
905 Handle<FixedArray> literals, | |
906 Handle<FixedArray> elements); | 891 Handle<FixedArray> elements); |
907 }; | 892 }; |
908 | 893 |
909 | 894 |
910 //--------------------------------------------------------------------------- | 895 //--------------------------------------------------------------------------- |
911 // Constants used by interface to runtime functions. | 896 // Constants used by interface to runtime functions. |
912 | 897 |
913 class AllocateDoubleAlignFlag: public BitField<bool, 0, 1> {}; | 898 class AllocateDoubleAlignFlag : public BitField<bool, 0, 1> {}; |
914 class AllocateTargetSpace: public BitField<AllocationSpace, 1, 3> {}; | 899 class AllocateTargetSpace : public BitField<AllocationSpace, 1, 3> {}; |
915 | 900 |
916 class DeclareGlobalsEvalFlag: public BitField<bool, 0, 1> {}; | 901 class DeclareGlobalsEvalFlag : public BitField<bool, 0, 1> {}; |
917 class DeclareGlobalsNativeFlag: public BitField<bool, 1, 1> {}; | 902 class DeclareGlobalsNativeFlag : public BitField<bool, 1, 1> {}; |
918 class DeclareGlobalsStrictMode: public BitField<StrictMode, 2, 1> {}; | 903 class DeclareGlobalsStrictMode : public BitField<StrictMode, 2, 1> {}; |
919 | 904 } |
920 } } // namespace v8::internal | 905 } // namespace v8::internal |
921 | 906 |
922 #endif // V8_RUNTIME_H_ | 907 #endif // V8_RUNTIME_H_ |
OLD | NEW |