OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
354 F(GetObservationState, 0, 1) \ | 354 F(GetObservationState, 0, 1) \ |
355 F(ObservationWeakMapCreate, 0, 1) \ | 355 F(ObservationWeakMapCreate, 0, 1) \ |
356 F(UnwrapGlobalProxy, 1, 1) \ | 356 F(UnwrapGlobalProxy, 1, 1) \ |
357 \ | 357 \ |
358 /* Harmony typed arrays */ \ | 358 /* Harmony typed arrays */ \ |
359 F(ArrayBufferInitialize, 2, 1)\ | 359 F(ArrayBufferInitialize, 2, 1)\ |
360 F(ArrayBufferGetByteLength, 1, 1)\ | 360 F(ArrayBufferGetByteLength, 1, 1)\ |
361 F(ArrayBufferSliceImpl, 3, 1) \ | 361 F(ArrayBufferSliceImpl, 3, 1) \ |
362 \ | 362 \ |
363 F(TypedArrayInitialize, 5, 1) \ | 363 F(TypedArrayInitialize, 5, 1) \ |
| 364 F(TypedArrayInitializeFromArrayLike, 4, 1) \ |
364 F(TypedArrayGetBuffer, 1, 1) \ | 365 F(TypedArrayGetBuffer, 1, 1) \ |
365 F(TypedArrayGetByteLength, 1, 1) \ | 366 F(TypedArrayGetByteLength, 1, 1) \ |
366 F(TypedArrayGetByteOffset, 1, 1) \ | 367 F(TypedArrayGetByteOffset, 1, 1) \ |
367 F(TypedArrayGetLength, 1, 1) \ | 368 F(TypedArrayGetLength, 1, 1) \ |
368 F(TypedArraySetFastCases, 3, 1) \ | 369 F(TypedArraySetFastCases, 3, 1) \ |
369 \ | 370 \ |
370 F(DataViewInitialize, 4, 1) \ | 371 F(DataViewInitialize, 4, 1) \ |
371 F(DataViewGetBuffer, 1, 1) \ | 372 F(DataViewGetBuffer, 1, 1) \ |
372 F(DataViewGetByteLength, 1, 1) \ | 373 F(DataViewGetByteLength, 1, 1) \ |
373 F(DataViewGetByteOffset, 1, 1) \ | 374 F(DataViewGetByteOffset, 1, 1) \ |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
526 F(ExecuteInDebugContext, 2, 1) \ | 527 F(ExecuteInDebugContext, 2, 1) \ |
527 \ | 528 \ |
528 F(SetFlags, 1, 1) \ | 529 F(SetFlags, 1, 1) \ |
529 F(CollectGarbage, 1, 1) \ | 530 F(CollectGarbage, 1, 1) \ |
530 F(GetHeapUsage, 0, 1) \ | 531 F(GetHeapUsage, 0, 1) \ |
531 | 532 |
532 #else | 533 #else |
533 #define RUNTIME_FUNCTION_LIST_DEBUGGER_SUPPORT(F) | 534 #define RUNTIME_FUNCTION_LIST_DEBUGGER_SUPPORT(F) |
534 #endif | 535 #endif |
535 | 536 |
| 537 |
| 538 #ifdef V8_I18N_SUPPORT |
| 539 #define RUNTIME_FUNCTION_LIST_I18N_SUPPORT(F) \ |
| 540 /* i18n support */ \ |
| 541 /* Standalone, helper methods. */ \ |
| 542 F(CanonicalizeLanguageTag, 1, 1) \ |
| 543 F(AvailableLocalesOf, 1, 1) \ |
| 544 F(GetDefaultICULocale, 0, 1) \ |
| 545 F(GetLanguageTagVariants, 1, 1) \ |
| 546 |
| 547 #else |
| 548 #define RUNTIME_FUNCTION_LIST_I18N_SUPPORT(F) |
| 549 #endif |
| 550 |
| 551 |
536 #ifdef DEBUG | 552 #ifdef DEBUG |
537 #define RUNTIME_FUNCTION_LIST_DEBUG(F) \ | 553 #define RUNTIME_FUNCTION_LIST_DEBUG(F) \ |
538 /* Testing */ \ | 554 /* Testing */ \ |
539 F(ListNatives, 0, 1) | 555 F(ListNatives, 0, 1) |
540 #else | 556 #else |
541 #define RUNTIME_FUNCTION_LIST_DEBUG(F) | 557 #define RUNTIME_FUNCTION_LIST_DEBUG(F) |
542 #endif | 558 #endif |
543 | 559 |
544 // ---------------------------------------------------------------------------- | 560 // ---------------------------------------------------------------------------- |
545 // RUNTIME_FUNCTION_LIST defines all runtime functions accessed | 561 // RUNTIME_FUNCTION_LIST defines all runtime functions accessed |
546 // either directly by id (via the code generator), or indirectly | 562 // either directly by id (via the code generator), or indirectly |
547 // via a native call by name (from within JS code). | 563 // via a native call by name (from within JS code). |
548 | 564 |
549 #define RUNTIME_FUNCTION_LIST(F) \ | 565 #define RUNTIME_FUNCTION_LIST(F) \ |
550 RUNTIME_FUNCTION_LIST_ALWAYS_1(F) \ | 566 RUNTIME_FUNCTION_LIST_ALWAYS_1(F) \ |
551 RUNTIME_FUNCTION_LIST_ALWAYS_2(F) \ | 567 RUNTIME_FUNCTION_LIST_ALWAYS_2(F) \ |
552 RUNTIME_FUNCTION_LIST_DEBUG(F) \ | 568 RUNTIME_FUNCTION_LIST_DEBUG(F) \ |
553 RUNTIME_FUNCTION_LIST_DEBUGGER_SUPPORT(F) | 569 RUNTIME_FUNCTION_LIST_DEBUGGER_SUPPORT(F) \ |
| 570 RUNTIME_FUNCTION_LIST_I18N_SUPPORT(F) |
554 | 571 |
555 // ---------------------------------------------------------------------------- | 572 // ---------------------------------------------------------------------------- |
556 // INLINE_FUNCTION_LIST defines all inlined functions accessed | 573 // INLINE_FUNCTION_LIST defines all inlined functions accessed |
557 // with a native call of the form %_name from within JS code. | 574 // with a native call of the form %_name from within JS code. |
558 // Entries have the form F(name, number of arguments, number of return values). | 575 // Entries have the form F(name, number of arguments, number of return values). |
559 #define INLINE_FUNCTION_LIST(F) \ | 576 #define INLINE_FUNCTION_LIST(F) \ |
560 F(IsSmi, 1, 1) \ | 577 F(IsSmi, 1, 1) \ |
561 F(IsNonNegativeSmi, 1, 1) \ | 578 F(IsNonNegativeSmi, 1, 1) \ |
562 F(IsArray, 1, 1) \ | 579 F(IsArray, 1, 1) \ |
563 F(IsRegExp, 1, 1) \ | 580 F(IsRegExp, 1, 1) \ |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
777 | 794 |
778 static void SetupArrayBuffer(Isolate* isolate, | 795 static void SetupArrayBuffer(Isolate* isolate, |
779 Handle<JSArrayBuffer> array_buffer, | 796 Handle<JSArrayBuffer> array_buffer, |
780 bool is_external, | 797 bool is_external, |
781 void* data, | 798 void* data, |
782 size_t allocated_length); | 799 size_t allocated_length); |
783 | 800 |
784 static bool SetupArrayBufferAllocatingData( | 801 static bool SetupArrayBufferAllocatingData( |
785 Isolate* isolate, | 802 Isolate* isolate, |
786 Handle<JSArrayBuffer> array_buffer, | 803 Handle<JSArrayBuffer> array_buffer, |
787 size_t allocated_length); | 804 size_t allocated_length, |
| 805 bool initialize = true); |
788 | 806 |
789 static void FreeArrayBuffer( | 807 static void FreeArrayBuffer( |
790 Isolate* isolate, | 808 Isolate* isolate, |
791 JSArrayBuffer* phantom_array_buffer); | 809 JSArrayBuffer* phantom_array_buffer); |
792 | 810 |
793 // Helper functions used stubs. | 811 // Helper functions used stubs. |
794 static void PerformGC(Object* result); | 812 static void PerformGC(Object* result); |
795 | 813 |
796 // Used in runtime.cc and hydrogen's VisitArrayLiteral. | 814 // Used in runtime.cc and hydrogen's VisitArrayLiteral. |
797 static Handle<Object> CreateArrayLiteralBoilerplate( | 815 static Handle<Object> CreateArrayLiteralBoilerplate( |
798 Isolate* isolate, | 816 Isolate* isolate, |
799 Handle<FixedArray> literals, | 817 Handle<FixedArray> literals, |
800 Handle<FixedArray> elements); | 818 Handle<FixedArray> elements); |
801 }; | 819 }; |
802 | 820 |
803 | 821 |
804 //--------------------------------------------------------------------------- | 822 //--------------------------------------------------------------------------- |
805 // Constants used by interface to runtime functions. | 823 // Constants used by interface to runtime functions. |
806 | 824 |
807 class DeclareGlobalsEvalFlag: public BitField<bool, 0, 1> {}; | 825 class DeclareGlobalsEvalFlag: public BitField<bool, 0, 1> {}; |
808 class DeclareGlobalsNativeFlag: public BitField<bool, 1, 1> {}; | 826 class DeclareGlobalsNativeFlag: public BitField<bool, 1, 1> {}; |
809 class DeclareGlobalsLanguageMode: public BitField<LanguageMode, 2, 2> {}; | 827 class DeclareGlobalsLanguageMode: public BitField<LanguageMode, 2, 2> {}; |
810 | 828 |
811 } } // namespace v8::internal | 829 } } // namespace v8::internal |
812 | 830 |
813 #endif // V8_RUNTIME_H_ | 831 #endif // V8_RUNTIME_H_ |
OLD | NEW |