OLD | NEW |
1 // Copyright (c) 1994-2006 Sun Microsystems Inc. | 1 // Copyright (c) 1994-2006 Sun Microsystems Inc. |
2 // All Rights Reserved. | 2 // All Rights Reserved. |
3 // | 3 // |
4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
6 // met: | 6 // met: |
7 // | 7 // |
8 // - Redistributions of source code must retain the above copyright notice, | 8 // - Redistributions of source code must retain the above copyright notice, |
9 // this list of conditions and the following disclaimer. | 9 // this list of conditions and the following disclaimer. |
10 // | 10 // |
(...skipping 924 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
935 case CODE_AGE_SEQUENCE: | 935 case CODE_AGE_SEQUENCE: |
936 DCHECK(Code::IsYoungSequence(isolate, pc_) || code_age_stub()->IsCode()); | 936 DCHECK(Code::IsYoungSequence(isolate, pc_) || code_age_stub()->IsCode()); |
937 break; | 937 break; |
938 } | 938 } |
939 } | 939 } |
940 #endif // VERIFY_HEAP | 940 #endif // VERIFY_HEAP |
941 | 941 |
942 | 942 |
943 // Implementation of ExternalReference | 943 // Implementation of ExternalReference |
944 | 944 |
| 945 static ExternalReference::Type BuiltinCallTypeForResultSize(int result_size) { |
| 946 switch (result_size) { |
| 947 case 1: |
| 948 return ExternalReference::BUILTIN_CALL; |
| 949 case 2: |
| 950 return ExternalReference::BUILTIN_CALL_PAIR; |
| 951 case 3: |
| 952 return ExternalReference::BUILTIN_CALL_TRIPLE; |
| 953 } |
| 954 UNREACHABLE(); |
| 955 return ExternalReference::BUILTIN_CALL; |
| 956 } |
| 957 |
| 958 |
945 void ExternalReference::SetUp() { | 959 void ExternalReference::SetUp() { |
946 double_constants.min_int = kMinInt; | 960 double_constants.min_int = kMinInt; |
947 double_constants.one_half = 0.5; | 961 double_constants.one_half = 0.5; |
948 double_constants.minus_one_half = -0.5; | 962 double_constants.minus_one_half = -0.5; |
949 double_constants.the_hole_nan = bit_cast<double>(kHoleNanInt64); | 963 double_constants.the_hole_nan = bit_cast<double>(kHoleNanInt64); |
950 double_constants.negative_infinity = -V8_INFINITY; | 964 double_constants.negative_infinity = -V8_INFINITY; |
951 double_constants.uint32_bias = | 965 double_constants.uint32_bias = |
952 static_cast<double>(static_cast<uint32_t>(0xFFFFFFFF)) + 1; | 966 static_cast<double>(static_cast<uint32_t>(0xFFFFFFFF)) + 1; |
953 | 967 |
954 math_exp_data_mutex = new base::Mutex(); | 968 math_exp_data_mutex = new base::Mutex(); |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1022 ExternalReference::ExternalReference(Builtins::Name name, Isolate* isolate) | 1036 ExternalReference::ExternalReference(Builtins::Name name, Isolate* isolate) |
1023 : address_(isolate->builtins()->builtin_address(name)) {} | 1037 : address_(isolate->builtins()->builtin_address(name)) {} |
1024 | 1038 |
1025 | 1039 |
1026 ExternalReference::ExternalReference(Runtime::FunctionId id, Isolate* isolate) | 1040 ExternalReference::ExternalReference(Runtime::FunctionId id, Isolate* isolate) |
1027 : ExternalReference(Runtime::FunctionForId(id), isolate) {} | 1041 : ExternalReference(Runtime::FunctionForId(id), isolate) {} |
1028 | 1042 |
1029 | 1043 |
1030 ExternalReference::ExternalReference(const Runtime::Function* f, | 1044 ExternalReference::ExternalReference(const Runtime::Function* f, |
1031 Isolate* isolate) | 1045 Isolate* isolate) |
1032 : address_(Redirect(isolate, f->entry, f->result_size == 3 | 1046 : address_(Redirect(isolate, f->entry, |
1033 ? BUILTIN_CALL_TRIPLE | 1047 BuiltinCallTypeForResultSize(f->result_size))) {} |
1034 : BUILTIN_CALL)) {} | |
1035 | 1048 |
1036 | 1049 |
1037 ExternalReference ExternalReference::isolate_address(Isolate* isolate) { | 1050 ExternalReference ExternalReference::isolate_address(Isolate* isolate) { |
1038 return ExternalReference(isolate); | 1051 return ExternalReference(isolate); |
1039 } | 1052 } |
1040 | 1053 |
1041 | 1054 |
1042 ExternalReference::ExternalReference(StatsCounter* counter) | 1055 ExternalReference::ExternalReference(StatsCounter* counter) |
1043 : address_(reinterpret_cast<Address>(counter->GetInternalPointer())) {} | 1056 : address_(reinterpret_cast<Address>(counter->GetInternalPointer())) {} |
1044 | 1057 |
(...skipping 807 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1852 | 1865 |
1853 | 1866 |
1854 void Assembler::DataAlign(int m) { | 1867 void Assembler::DataAlign(int m) { |
1855 DCHECK(m >= 2 && base::bits::IsPowerOfTwo32(m)); | 1868 DCHECK(m >= 2 && base::bits::IsPowerOfTwo32(m)); |
1856 while ((pc_offset() & (m - 1)) != 0) { | 1869 while ((pc_offset() & (m - 1)) != 0) { |
1857 db(0); | 1870 db(0); |
1858 } | 1871 } |
1859 } | 1872 } |
1860 } // namespace internal | 1873 } // namespace internal |
1861 } // namespace v8 | 1874 } // namespace v8 |
OLD | NEW |