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. |
25 union conversion { | 22 union conversion { |
26 double d; | 23 double d; |
27 uint32_t u[2]; | 24 uint32_t u[2]; |
28 } c; | 25 } c; |
29 c.u[0] = *reinterpret_cast<uint32_t*>(p); | 26 c.u[0] = Memory::uint32_at(p); |
Jakob Kummerow
2014/09/12 11:08:44
Since Memory::uint32_at does a reinterpret_cast<ui
Sven Panne
2014/09/12 13:12:08
Even simpler: Just use memcpy...
| |
30 c.u[1] = *reinterpret_cast<uint32_t*>(p + 4); | 27 c.u[1] = Memory::uint32_at(p + 4); |
31 return c.d; | 28 return c.d; |
32 #endif // V8_HOST_CAN_READ_UNALIGNED | |
33 } | 29 } |
34 | 30 |
35 | 31 |
36 class FrameDescription; | 32 class FrameDescription; |
37 class TranslationIterator; | 33 class TranslationIterator; |
38 class DeoptimizedFrameInfo; | 34 class DeoptimizedFrameInfo; |
39 | 35 |
40 template<typename T> | 36 template<typename T> |
41 class HeapNumberMaterializationDescriptor BASE_EMBEDDED { | 37 class HeapNumberMaterializationDescriptor BASE_EMBEDDED { |
42 public: | 38 public: |
(...skipping 925 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
968 Object** parameters_; | 964 Object** parameters_; |
969 Object** expression_stack_; | 965 Object** expression_stack_; |
970 int source_position_; | 966 int source_position_; |
971 | 967 |
972 friend class Deoptimizer; | 968 friend class Deoptimizer; |
973 }; | 969 }; |
974 | 970 |
975 } } // namespace v8::internal | 971 } } // namespace v8::internal |
976 | 972 |
977 #endif // V8_DEOPTIMIZER_H_ | 973 #endif // V8_DEOPTIMIZER_H_ |
OLD | NEW |