OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 #ifndef V8_DEOPTIMIZER_H_ | 5 #ifndef V8_DEOPTIMIZER_H_ |
6 #define V8_DEOPTIMIZER_H_ | 6 #define V8_DEOPTIMIZER_H_ |
7 | 7 |
8 #include "src/v8.h" | 8 #include "src/v8.h" |
9 | 9 |
10 #include "src/allocation.h" | 10 #include "src/allocation.h" |
11 #include "src/macro-assembler.h" | 11 #include "src/macro-assembler.h" |
12 #include "src/zone-inl.h" | 12 #include "src/zone-inl.h" |
13 | 13 |
14 | 14 |
15 namespace v8 { | 15 namespace v8 { |
16 namespace internal { | 16 namespace internal { |
17 | 17 |
18 | 18 |
19 static inline double read_double_value(Address p) { | 19 static inline double read_double_value(Address p) { |
| 20 #ifdef V8_HOST_CAN_READ_UNALIGNED |
| 21 return Memory::double_at(p); |
| 22 #else // V8_HOST_CAN_READ_UNALIGNED |
20 // Prevent gcc from using load-double (mips ldc1) on (possibly) | 23 // Prevent gcc from using load-double (mips ldc1) on (possibly) |
21 // non-64-bit aligned address. | 24 // non-64-bit aligned address. |
22 // We assume that the address is 32-bit aligned. | |
23 DCHECK(IsAligned(reinterpret_cast<intptr_t>(p), kInt32Size)); | |
24 union conversion { | 25 union conversion { |
25 double d; | 26 double d; |
26 uint32_t u[2]; | 27 uint32_t u[2]; |
27 } c; | 28 } c; |
28 c.u[0] = Memory::uint32_at(p); | 29 c.u[0] = *reinterpret_cast<uint32_t*>(p); |
29 c.u[1] = Memory::uint32_at(p + 4); | 30 c.u[1] = *reinterpret_cast<uint32_t*>(p + 4); |
30 return c.d; | 31 return c.d; |
| 32 #endif // V8_HOST_CAN_READ_UNALIGNED |
31 } | 33 } |
32 | 34 |
33 | 35 |
34 class FrameDescription; | 36 class FrameDescription; |
35 class TranslationIterator; | 37 class TranslationIterator; |
36 class DeoptimizedFrameInfo; | 38 class DeoptimizedFrameInfo; |
37 | 39 |
38 template<typename T> | 40 template<typename T> |
39 class HeapNumberMaterializationDescriptor BASE_EMBEDDED { | 41 class HeapNumberMaterializationDescriptor BASE_EMBEDDED { |
40 public: | 42 public: |
(...skipping 925 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
966 Object** parameters_; | 968 Object** parameters_; |
967 Object** expression_stack_; | 969 Object** expression_stack_; |
968 int source_position_; | 970 int source_position_; |
969 | 971 |
970 friend class Deoptimizer; | 972 friend class Deoptimizer; |
971 }; | 973 }; |
972 | 974 |
973 } } // namespace v8::internal | 975 } } // namespace v8::internal |
974 | 976 |
975 #endif // V8_DEOPTIMIZER_H_ | 977 #endif // V8_DEOPTIMIZER_H_ |
OLD | NEW |