OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 // This files contains runtime support implemented in JavaScript. | 5 // This files contains runtime support implemented in JavaScript. |
6 | 6 |
7 // CAUTION: Some of the functions specified in this file are called | 7 // CAUTION: Some of the functions specified in this file are called |
8 // directly from compiled code. These are the functions with names in | 8 // directly from compiled code. These are the functions with names in |
9 // ALL CAPS. The compiled code passes the first argument in 'this'. | 9 // ALL CAPS. The compiled code passes the first argument in 'this'. |
10 | 10 |
(...skipping 819 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
830 $sameValue = SameValue; | 830 $sameValue = SameValue; |
831 $sameValueZero = SameValueZero; | 831 $sameValueZero = SameValueZero; |
832 $toInteger = ToInteger; | 832 $toInteger = ToInteger; |
833 $toLength = ToLength; | 833 $toLength = ToLength; |
834 $toName = ToName; | 834 $toName = ToName; |
835 $toNumber = ToNumber; | 835 $toNumber = ToNumber; |
836 $toPositiveInteger = ToPositiveInteger; | 836 $toPositiveInteger = ToPositiveInteger; |
837 $toPrimitive = ToPrimitive; | 837 $toPrimitive = ToPrimitive; |
838 $toString = ToString; | 838 $toString = ToString; |
839 | 839 |
840 %InstallJSBuiltins({ | 840 %InstallToContext([ |
841 EQUALS, | 841 "add_builtin", ADD, |
842 COMPARE, | 842 "add_strong_builtin", ADD_STRONG, |
843 COMPARE_STRONG, | 843 "apply_prepare_builtin", APPLY_PREPARE, |
844 ADD, | 844 "bit_and_builtin", BIT_AND, |
845 ADD_STRONG, | 845 "bit_and_strong_builtin", BIT_AND_STRONG, |
846 STRING_ADD_LEFT, | 846 "bit_or_builtin", BIT_OR, |
847 STRING_ADD_RIGHT, | 847 "bit_or_strong_builtin", BIT_OR_STRONG, |
848 SUB, | 848 "bit_xor_builtin", BIT_XOR, |
849 SUB_STRONG, | 849 "bit_xor_strong_builtin", BIT_XOR_STRONG, |
850 MUL, | 850 "call_function_proxy_as_constructor_builtin", CALL_FUNCTION_PROXY_AS_CONSTRUCT
OR, |
851 MUL_STRONG, | 851 "call_function_proxy_builtin", CALL_FUNCTION_PROXY, |
852 DIV, | 852 "call_non_function_as_constructor_builtin", CALL_NON_FUNCTION_AS_CONSTRUCTOR, |
853 DIV_STRONG, | 853 "call_non_function_builtin", CALL_NON_FUNCTION, |
854 MOD, | 854 "compare_builtin", COMPARE, |
855 MOD_STRONG, | 855 "compare_strong_builtin", COMPARE_STRONG, |
856 BIT_OR, | 856 "concat_iterable_to_array_builtin", CONCAT_ITERABLE_TO_ARRAY, |
857 BIT_OR_STRONG, | 857 "div_builtin", DIV, |
858 BIT_AND, | 858 "div_strong_builtin", DIV_STRONG, |
859 BIT_AND_STRONG, | 859 "equals_builtin", EQUALS, |
860 BIT_XOR, | 860 "in_builtin", IN, |
861 BIT_XOR_STRONG, | 861 "mod_builtin", MOD, |
862 SHL, | 862 "mod_strong_builtin", MOD_STRONG, |
863 SHL_STRONG, | 863 "mul_builtin", MUL, |
864 SAR, | 864 "mul_strong_builtin", MUL_STRONG, |
865 SAR_STRONG, | 865 "reflect_apply_prepare_builtin", REFLECT_APPLY_PREPARE, |
866 SHR, | 866 "reflect_construct_prepare_builtin", REFLECT_CONSTRUCT_PREPARE, |
867 SHR_STRONG, | 867 "sar_builtin", SAR, |
868 IN, | 868 "sar_strong_builtin", SAR_STRONG, |
869 CALL_NON_FUNCTION, | 869 "shl_builtin", SHL, |
870 CALL_NON_FUNCTION_AS_CONSTRUCTOR, | 870 "shl_strong_builtin", SHL_STRONG, |
871 CALL_FUNCTION_PROXY, | 871 "shr_builtin", SHR, |
872 CALL_FUNCTION_PROXY_AS_CONSTRUCTOR, | 872 "shr_strong_builtin", SHR_STRONG, |
873 CONCAT_ITERABLE_TO_ARRAY, | 873 "stack_overflow_builtin", STACK_OVERFLOW, |
874 APPLY_PREPARE, | 874 "string_add_left_builtin", STRING_ADD_LEFT, |
875 REFLECT_APPLY_PREPARE, | 875 "string_add_right_builtin", STRING_ADD_RIGHT, |
876 REFLECT_CONSTRUCT_PREPARE, | 876 "sub_builtin", SUB, |
877 STACK_OVERFLOW, | 877 "sub_strong_builtin", SUB_STRONG, |
878 TO_NUMBER, | 878 "to_name_builtin", TO_NAME, |
879 TO_STRING, | 879 "to_number_builtin", TO_NUMBER, |
880 TO_NAME, | 880 "to_string_builtin", TO_STRING, |
881 }); | 881 ]); |
882 | 882 |
883 %InstallToContext([ | 883 %InstallToContext([ |
884 "concat_iterable_to_array", ConcatIterableToArray, | 884 "concat_iterable_to_array", ConcatIterableToArray, |
885 "non_number_to_number", NonNumberToNumber, | 885 "non_number_to_number", NonNumberToNumber, |
886 "non_string_to_string", NonStringToString, | 886 "non_string_to_string", NonStringToString, |
887 "to_integer_fun", ToInteger, | 887 "to_integer_fun", ToInteger, |
888 "to_length_fun", ToLength, | 888 "to_length_fun", ToLength, |
889 "to_name", ToName, | 889 "to_name", ToName, |
890 "to_number_fun", ToNumber, | 890 "to_number_fun", ToNumber, |
891 "to_primitive", ToPrimitive, | 891 "to_primitive", ToPrimitive, |
892 "to_string_fun", ToString, | 892 "to_string_fun", ToString, |
893 ]); | 893 ]); |
894 | 894 |
895 utils.Export(function(to) { | 895 utils.Export(function(to) { |
896 to.ToBoolean = ToBoolean; | 896 to.ToBoolean = ToBoolean; |
897 to.ToLength = ToLength; | 897 to.ToLength = ToLength; |
898 to.ToName = ToName; | 898 to.ToName = ToName; |
899 to.ToNumber = ToNumber; | 899 to.ToNumber = ToNumber; |
900 to.ToPrimitive = ToPrimitive; | 900 to.ToPrimitive = ToPrimitive; |
901 to.ToString = ToString; | 901 to.ToString = ToString; |
902 }); | 902 }); |
903 | 903 |
904 }) | 904 }) |
OLD | NEW |