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 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
461 F(HasExternalUint8ClampedElements, 1, 1) \ | 461 F(HasExternalUint8ClampedElements, 1, 1) \ |
462 F(HasExternalArrayElements, 1, 1) \ | 462 F(HasExternalArrayElements, 1, 1) \ |
463 F(HasExternalInt8Elements, 1, 1) \ | 463 F(HasExternalInt8Elements, 1, 1) \ |
464 F(HasExternalUint8Elements, 1, 1) \ | 464 F(HasExternalUint8Elements, 1, 1) \ |
465 F(HasExternalInt16Elements, 1, 1) \ | 465 F(HasExternalInt16Elements, 1, 1) \ |
466 F(HasExternalUint16Elements, 1, 1) \ | 466 F(HasExternalUint16Elements, 1, 1) \ |
467 F(HasExternalInt32Elements, 1, 1) \ | 467 F(HasExternalInt32Elements, 1, 1) \ |
468 F(HasExternalUint32Elements, 1, 1) \ | 468 F(HasExternalUint32Elements, 1, 1) \ |
469 F(HasExternalFloat32Elements, 1, 1) \ | 469 F(HasExternalFloat32Elements, 1, 1) \ |
470 F(HasExternalFloat64Elements, 1, 1) \ | 470 F(HasExternalFloat64Elements, 1, 1) \ |
| 471 F(HasFixedUint8ClampedElements, 1, 1) \ |
| 472 F(HasFixedInt8Elements, 1, 1) \ |
| 473 F(HasFixedUint8Elements, 1, 1) \ |
| 474 F(HasFixedInt16Elements, 1, 1) \ |
| 475 F(HasFixedUint16Elements, 1, 1) \ |
| 476 F(HasFixedInt32Elements, 1, 1) \ |
| 477 F(HasFixedUint32Elements, 1, 1) \ |
| 478 F(HasFixedFloat32Elements, 1, 1) \ |
| 479 F(HasFixedFloat64Elements, 1, 1) \ |
471 F(HasFastProperties, 1, 1) \ | 480 F(HasFastProperties, 1, 1) \ |
472 F(TransitionElementsKind, 2, 1) \ | 481 F(TransitionElementsKind, 2, 1) \ |
473 F(HaveSameMap, 2, 1) \ | 482 F(HaveSameMap, 2, 1) \ |
474 F(IsAccessCheckNeeded, 1, 1) | 483 F(IsAccessCheckNeeded, 1, 1) |
475 | 484 |
476 | 485 |
477 #ifdef ENABLE_DEBUGGER_SUPPORT | 486 #ifdef ENABLE_DEBUGGER_SUPPORT |
478 #define RUNTIME_FUNCTION_LIST_DEBUGGER_SUPPORT(F) \ | 487 #define RUNTIME_FUNCTION_LIST_DEBUGGER_SUPPORT(F) \ |
479 /* Debugger support*/ \ | 488 /* Debugger support*/ \ |
480 F(DebugBreak, 0, 1) \ | 489 F(DebugBreak, 0, 1) \ |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
669 // INLINE_OPTIMIZED_FUNCTION_LIST defines all inlined functions accessed | 678 // INLINE_OPTIMIZED_FUNCTION_LIST defines all inlined functions accessed |
670 // with a native call of the form %_name from within JS code that also have | 679 // with a native call of the form %_name from within JS code that also have |
671 // a corresponding runtime function, that is called from non-optimized code. | 680 // a corresponding runtime function, that is called from non-optimized code. |
672 // Entries have the form F(name, number of arguments, number of return values). | 681 // Entries have the form F(name, number of arguments, number of return values). |
673 #define INLINE_OPTIMIZED_FUNCTION_LIST(F) \ | 682 #define INLINE_OPTIMIZED_FUNCTION_LIST(F) \ |
674 F(DoubleHi, 1, 1) \ | 683 F(DoubleHi, 1, 1) \ |
675 F(DoubleLo, 1, 1) \ | 684 F(DoubleLo, 1, 1) \ |
676 F(ConstructDouble, 2, 1) \ | 685 F(ConstructDouble, 2, 1) \ |
677 F(TypedArrayInitialize, 5, 1) \ | 686 F(TypedArrayInitialize, 5, 1) \ |
678 F(DataViewInitialize, 4, 1) \ | 687 F(DataViewInitialize, 4, 1) \ |
679 F(MaxSmi, 0, 1) | 688 F(MaxSmi, 0, 1) \ |
| 689 F(TypedArrayMaxSizeInHeap, 0, 1) |
680 | 690 |
681 | 691 |
682 //--------------------------------------------------------------------------- | 692 //--------------------------------------------------------------------------- |
683 // Runtime provides access to all C++ runtime functions. | 693 // Runtime provides access to all C++ runtime functions. |
684 | 694 |
685 class RuntimeState { | 695 class RuntimeState { |
686 public: | 696 public: |
687 StaticResource<ConsStringIteratorOp>* string_iterator() { | 697 StaticResource<ConsStringIteratorOp>* string_iterator() { |
688 return &string_iterator_; | 698 return &string_iterator_; |
689 } | 699 } |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
861 ARRAY_ID_UINT16 = 3, | 871 ARRAY_ID_UINT16 = 3, |
862 ARRAY_ID_INT16 = 4, | 872 ARRAY_ID_INT16 = 4, |
863 ARRAY_ID_UINT32 = 5, | 873 ARRAY_ID_UINT32 = 5, |
864 ARRAY_ID_INT32 = 6, | 874 ARRAY_ID_INT32 = 6, |
865 ARRAY_ID_FLOAT32 = 7, | 875 ARRAY_ID_FLOAT32 = 7, |
866 ARRAY_ID_FLOAT64 = 8, | 876 ARRAY_ID_FLOAT64 = 8, |
867 ARRAY_ID_UINT8_CLAMPED = 9 | 877 ARRAY_ID_UINT8_CLAMPED = 9 |
868 }; | 878 }; |
869 | 879 |
870 static void ArrayIdToTypeAndSize(int array_id, | 880 static void ArrayIdToTypeAndSize(int array_id, |
871 ExternalArrayType *type, size_t *element_size); | 881 ExternalArrayType *type, |
| 882 ElementsKind* external_elements_kind, |
| 883 ElementsKind* fixed_elements_kind, |
| 884 size_t *element_size); |
872 | 885 |
873 // Helper functions used stubs. | 886 // Helper functions used stubs. |
874 static void PerformGC(Object* result, Isolate* isolate); | 887 static void PerformGC(Object* result, Isolate* isolate); |
875 | 888 |
876 // Used in runtime.cc and hydrogen's VisitArrayLiteral. | 889 // Used in runtime.cc and hydrogen's VisitArrayLiteral. |
877 static Handle<Object> CreateArrayLiteralBoilerplate( | 890 static Handle<Object> CreateArrayLiteralBoilerplate( |
878 Isolate* isolate, | 891 Isolate* isolate, |
879 Handle<FixedArray> literals, | 892 Handle<FixedArray> literals, |
880 Handle<FixedArray> elements); | 893 Handle<FixedArray> elements); |
881 }; | 894 }; |
882 | 895 |
883 | 896 |
884 //--------------------------------------------------------------------------- | 897 //--------------------------------------------------------------------------- |
885 // Constants used by interface to runtime functions. | 898 // Constants used by interface to runtime functions. |
886 | 899 |
887 class AllocateDoubleAlignFlag: public BitField<bool, 0, 1> {}; | 900 class AllocateDoubleAlignFlag: public BitField<bool, 0, 1> {}; |
888 class AllocateTargetSpace: public BitField<AllocationSpace, 1, 3> {}; | 901 class AllocateTargetSpace: public BitField<AllocationSpace, 1, 3> {}; |
889 | 902 |
890 class DeclareGlobalsEvalFlag: public BitField<bool, 0, 1> {}; | 903 class DeclareGlobalsEvalFlag: public BitField<bool, 0, 1> {}; |
891 class DeclareGlobalsNativeFlag: public BitField<bool, 1, 1> {}; | 904 class DeclareGlobalsNativeFlag: public BitField<bool, 1, 1> {}; |
892 class DeclareGlobalsStrictMode: public BitField<StrictMode, 2, 1> {}; | 905 class DeclareGlobalsStrictMode: public BitField<StrictMode, 2, 1> {}; |
893 | 906 |
894 } } // namespace v8::internal | 907 } } // namespace v8::internal |
895 | 908 |
896 #endif // V8_RUNTIME_H_ | 909 #endif // V8_RUNTIME_H_ |
OLD | NEW |