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 | |
23 // Prevent gcc from using load-double (mips ldc1) on (possibly) | 20 // Prevent gcc from using load-double (mips ldc1) on (possibly) |
24 // non-64-bit aligned address. | 21 // non-64-bit aligned address. |
| 22 // We assume that the address is 32-bit aligned. |
| 23 DCHECK(IsAligned(reinterpret_cast<intptr_t>(p), kInt32Size)); |
25 union conversion { | 24 union conversion { |
26 double d; | 25 double d; |
27 uint32_t u[2]; | 26 uint32_t u[2]; |
28 } c; | 27 } c; |
29 c.u[0] = *reinterpret_cast<uint32_t*>(p); | 28 c.u[0] = Memory::uint32_at(p); |
30 c.u[1] = *reinterpret_cast<uint32_t*>(p + 4); | 29 c.u[1] = Memory::uint32_at(p + 4); |
31 return c.d; | 30 return c.d; |
32 #endif // V8_HOST_CAN_READ_UNALIGNED | |
33 } | 31 } |
34 | 32 |
35 | 33 |
36 class FrameDescription; | 34 class FrameDescription; |
37 class TranslationIterator; | 35 class TranslationIterator; |
38 class DeoptimizedFrameInfo; | 36 class DeoptimizedFrameInfo; |
39 | 37 |
40 template<typename T> | 38 template<typename T> |
41 class HeapNumberMaterializationDescriptor BASE_EMBEDDED { | 39 class HeapNumberMaterializationDescriptor BASE_EMBEDDED { |
42 public: | 40 public: |
(...skipping 925 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
968 Object** parameters_; | 966 Object** parameters_; |
969 Object** expression_stack_; | 967 Object** expression_stack_; |
970 int source_position_; | 968 int source_position_; |
971 | 969 |
972 friend class Deoptimizer; | 970 friend class Deoptimizer; |
973 }; | 971 }; |
974 | 972 |
975 } } // namespace v8::internal | 973 } } // namespace v8::internal |
976 | 974 |
977 #endif // V8_DEOPTIMIZER_H_ | 975 #endif // V8_DEOPTIMIZER_H_ |
OLD | NEW |