| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 } | 57 } |
| 58 | 58 |
| 59 static int& int_at(Address addr) { | 59 static int& int_at(Address addr) { |
| 60 return *reinterpret_cast<int*>(addr); | 60 return *reinterpret_cast<int*>(addr); |
| 61 } | 61 } |
| 62 | 62 |
| 63 static unsigned& unsigned_at(Address addr) { | 63 static unsigned& unsigned_at(Address addr) { |
| 64 return *reinterpret_cast<unsigned*>(addr); | 64 return *reinterpret_cast<unsigned*>(addr); |
| 65 } | 65 } |
| 66 | 66 |
| 67 static intptr_t& intptr_at(Address addr) { |
| 68 return *reinterpret_cast<intptr_t*>(addr); |
| 69 } |
| 70 |
| 71 static uintptr_t& uintptr_at(Address addr) { |
| 72 return *reinterpret_cast<uintptr_t*>(addr); |
| 73 } |
| 74 |
| 67 static double& double_at(Address addr) { | 75 static double& double_at(Address addr) { |
| 68 return *reinterpret_cast<double*>(addr); | 76 return *reinterpret_cast<double*>(addr); |
| 69 } | 77 } |
| 70 | 78 |
| 71 static Address& Address_at(Address addr) { | 79 static Address& Address_at(Address addr) { |
| 72 return *reinterpret_cast<Address*>(addr); | 80 return *reinterpret_cast<Address*>(addr); |
| 73 } | 81 } |
| 74 | 82 |
| 75 static Object*& Object_at(Address addr) { | 83 static Object*& Object_at(Address addr) { |
| 76 return *reinterpret_cast<Object**>(addr); | 84 return *reinterpret_cast<Object**>(addr); |
| 77 } | 85 } |
| 78 | 86 |
| 79 static Handle<Object>& Object_Handle_at(Address addr) { | 87 static Handle<Object>& Object_Handle_at(Address addr) { |
| 80 return *reinterpret_cast<Handle<Object>*>(addr); | 88 return *reinterpret_cast<Handle<Object>*>(addr); |
| 81 } | 89 } |
| 82 }; | 90 }; |
| 83 | 91 |
| 84 } } // namespace v8::internal | 92 } } // namespace v8::internal |
| 85 | 93 |
| 86 #endif // V8_MEMORY_H_ | 94 #endif // V8_MEMORY_H_ |
| OLD | NEW |