OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 30 matching lines...) Expand all Loading... |
41 } | 41 } |
42 | 42 |
43 static uint16_t& uint16_at(Address addr) { | 43 static uint16_t& uint16_at(Address addr) { |
44 return *reinterpret_cast<uint16_t*>(addr); | 44 return *reinterpret_cast<uint16_t*>(addr); |
45 } | 45 } |
46 | 46 |
47 static uint32_t& uint32_at(Address addr) { | 47 static uint32_t& uint32_at(Address addr) { |
48 return *reinterpret_cast<uint32_t*>(addr); | 48 return *reinterpret_cast<uint32_t*>(addr); |
49 } | 49 } |
50 | 50 |
| 51 static int16_t& int16_at(Address addr) { |
| 52 return *reinterpret_cast<int16_t*>(addr); |
| 53 } |
| 54 |
51 static int32_t& int32_at(Address addr) { | 55 static int32_t& int32_at(Address addr) { |
52 return *reinterpret_cast<int32_t*>(addr); | 56 return *reinterpret_cast<int32_t*>(addr); |
53 } | 57 } |
54 | 58 |
55 static uint64_t& uint64_at(Address addr) { | 59 static uint64_t& uint64_at(Address addr) { |
56 return *reinterpret_cast<uint64_t*>(addr); | 60 return *reinterpret_cast<uint64_t*>(addr); |
57 } | 61 } |
58 | 62 |
59 static int& int_at(Address addr) { | 63 static int& int_at(Address addr) { |
60 return *reinterpret_cast<int*>(addr); | 64 return *reinterpret_cast<int*>(addr); |
(...skipping 24 matching lines...) Expand all Loading... |
85 } | 89 } |
86 | 90 |
87 static Handle<Object>& Object_Handle_at(Address addr) { | 91 static Handle<Object>& Object_Handle_at(Address addr) { |
88 return *reinterpret_cast<Handle<Object>*>(addr); | 92 return *reinterpret_cast<Handle<Object>*>(addr); |
89 } | 93 } |
90 }; | 94 }; |
91 | 95 |
92 } } // namespace v8::internal | 96 } } // namespace v8::internal |
93 | 97 |
94 #endif // V8_MEMORY_H_ | 98 #endif // V8_MEMORY_H_ |
OLD | NEW |