OLD | NEW |
1 // Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE.md file. | 3 // BSD-style license that can be found in the LICENSE.md file. |
4 | 4 |
5 #ifndef SRC_VM_PROGRAM_RELOCATOR_H_ | 5 #ifndef SRC_VM_PROGRAM_RELOCATOR_H_ |
6 #define SRC_VM_PROGRAM_RELOCATOR_H_ | 6 #define SRC_VM_PROGRAM_RELOCATOR_H_ |
7 | 7 |
8 #include "src/vm/intrinsics.h" | 8 #include "src/vm/intrinsics.h" |
9 #include "src/vm/program.h" | 9 #include "src/vm/program.h" |
10 | 10 |
11 namespace fletch { | 11 namespace dartino { |
12 | 12 |
13 class ProgramHeapRelocator { | 13 class ProgramHeapRelocator { |
14 public: | 14 public: |
15 ProgramHeapRelocator(Program* program, uint8* target, uword baseaddress, | 15 ProgramHeapRelocator(Program* program, uint8* target, uword baseaddress, |
16 IntrinsicsTable* table = IntrinsicsTable::GetDefault()) | 16 IntrinsicsTable* table = IntrinsicsTable::GetDefault()) |
17 : program_(program), | 17 : program_(program), |
18 target_(target), | 18 target_(target), |
19 baseaddress_(baseaddress), | 19 baseaddress_(baseaddress), |
20 table_(table) {} | 20 table_(table) {} |
21 | 21 |
22 int Relocate(); | 22 int Relocate(); |
23 | 23 |
24 private: | 24 private: |
25 Program* program_; | 25 Program* program_; |
26 uint8* target_; | 26 uint8* target_; |
27 uword baseaddress_; | 27 uword baseaddress_; |
28 IntrinsicsTable* table_; | 28 IntrinsicsTable* table_; |
29 }; | 29 }; |
30 | 30 |
31 } // namespace fletch | 31 } // namespace dartino |
32 | 32 |
33 #endif // SRC_VM_PROGRAM_RELOCATOR_H_ | 33 #endif // SRC_VM_PROGRAM_RELOCATOR_H_ |
OLD | NEW |