| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 8162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8173 __ xorl(rdx, rbx); | 8173 __ xorl(rdx, rbx); |
| 8174 __ movl(rcx, rdx); | 8174 __ movl(rcx, rdx); |
| 8175 __ movl(rax, rdx); | 8175 __ movl(rax, rdx); |
| 8176 __ movl(rdi, rdx); | 8176 __ movl(rdi, rdx); |
| 8177 __ sarl(rdx, Immediate(8)); | 8177 __ sarl(rdx, Immediate(8)); |
| 8178 __ sarl(rcx, Immediate(16)); | 8178 __ sarl(rcx, Immediate(16)); |
| 8179 __ sarl(rax, Immediate(24)); | 8179 __ sarl(rax, Immediate(24)); |
| 8180 __ xorl(rcx, rdx); | 8180 __ xorl(rcx, rdx); |
| 8181 __ xorl(rax, rdi); | 8181 __ xorl(rax, rdi); |
| 8182 __ xorl(rcx, rax); | 8182 __ xorl(rcx, rax); |
| 8183 ASSERT(IsPowerOf2(TranscendentalCache::kCacheSize)); | 8183 ASSERT(IsPowerOf2(TranscendentalCache::SubCache::kCacheSize)); |
| 8184 __ andl(rcx, Immediate(TranscendentalCache::kCacheSize - 1)); | 8184 __ andl(rcx, Immediate(TranscendentalCache::SubCache::kCacheSize - 1)); |
| 8185 // ST[0] == double value. | 8185 // ST[0] == double value. |
| 8186 // rbx = bits of double value. | 8186 // rbx = bits of double value. |
| 8187 // rcx = TranscendentalCache::hash(double value). | 8187 // rcx = TranscendentalCache::hash(double value). |
| 8188 __ movq(rax, ExternalReference::transcendental_cache_array_address()); | 8188 __ movq(rax, ExternalReference::transcendental_cache_array_address()); |
| 8189 // rax points to cache array. | 8189 // rax points to cache array. |
| 8190 __ movq(rax, Operand(rax, type_ * sizeof(TranscendentalCache::caches_[0]))); | 8190 __ movq(rax, Operand(rax,type_ * sizeof(Isolate::Current()-> |
| 8191 transcendental_cache()->caches_[0]))); |
| 8191 // rax points to the cache for the type type_. | 8192 // rax points to the cache for the type type_. |
| 8192 // If NULL, the cache hasn't been initialized yet, so go through runtime. | 8193 // If NULL, the cache hasn't been initialized yet, so go through runtime. |
| 8193 __ testq(rax, rax); | 8194 __ testq(rax, rax); |
| 8194 __ j(zero, &runtime_call_clear_stack); | 8195 __ j(zero, &runtime_call_clear_stack); |
| 8195 #ifdef DEBUG | 8196 #ifdef DEBUG |
| 8196 // Check that the layout of cache elements match expectations. | 8197 // Check that the layout of cache elements match expectations. |
| 8197 { // NOLINT - doesn't like a single brace on a line. | 8198 { // NOLINT - doesn't like a single brace on a line. |
| 8198 TranscendentalCache::Element test_elem[2]; | 8199 TranscendentalCache::SubCache::Element test_elem[2]; |
| 8199 char* elem_start = reinterpret_cast<char*>(&test_elem[0]); | 8200 char* elem_start = reinterpret_cast<char*>(&test_elem[0]); |
| 8200 char* elem2_start = reinterpret_cast<char*>(&test_elem[1]); | 8201 char* elem2_start = reinterpret_cast<char*>(&test_elem[1]); |
| 8201 char* elem_in0 = reinterpret_cast<char*>(&(test_elem[0].in[0])); | 8202 char* elem_in0 = reinterpret_cast<char*>(&(test_elem[0].in[0])); |
| 8202 char* elem_in1 = reinterpret_cast<char*>(&(test_elem[0].in[1])); | 8203 char* elem_in1 = reinterpret_cast<char*>(&(test_elem[0].in[1])); |
| 8203 char* elem_out = reinterpret_cast<char*>(&(test_elem[0].output)); | 8204 char* elem_out = reinterpret_cast<char*>(&(test_elem[0].output)); |
| 8204 // Two uint_32's and a pointer per element. | 8205 // Two uint_32's and a pointer per element. |
| 8205 CHECK_EQ(16, static_cast<int>(elem2_start - elem_start)); | 8206 CHECK_EQ(16, static_cast<int>(elem2_start - elem_start)); |
| 8206 CHECK_EQ(0, static_cast<int>(elem_in0 - elem_start)); | 8207 CHECK_EQ(0, static_cast<int>(elem_in0 - elem_start)); |
| 8207 CHECK_EQ(kIntSize, static_cast<int>(elem_in1 - elem_start)); | 8208 CHECK_EQ(kIntSize, static_cast<int>(elem_in1 - elem_start)); |
| 8208 CHECK_EQ(2 * kIntSize, static_cast<int>(elem_out - elem_start)); | 8209 CHECK_EQ(2 * kIntSize, static_cast<int>(elem_out - elem_start)); |
| (...skipping 3721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11930 } | 11931 } |
| 11931 | 11932 |
| 11932 #endif | 11933 #endif |
| 11933 | 11934 |
| 11934 | 11935 |
| 11935 #undef __ | 11936 #undef __ |
| 11936 | 11937 |
| 11937 } } // namespace v8::internal | 11938 } } // namespace v8::internal |
| 11938 | 11939 |
| 11939 #endif // V8_TARGET_ARCH_X64 | 11940 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |