OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart 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 file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 // Class for patching compiled code. | 4 // Class for patching compiled code. |
5 | 5 |
6 #ifndef VM_CODE_PATCHER_H_ | 6 #ifndef VM_CODE_PATCHER_H_ |
7 #define VM_CODE_PATCHER_H_ | 7 #define VM_CODE_PATCHER_H_ |
8 | 8 |
9 #include "vm/allocation.h" | 9 #include "vm/allocation.h" |
10 | 10 |
11 namespace dart { | 11 namespace dart { |
12 | 12 |
13 // Forward declaration. | 13 // Forward declaration. |
14 class Array; | 14 class Array; |
15 class Code; | 15 class Code; |
16 class ExternalLabel; | 16 class ExternalLabel; |
17 class Function; | 17 class Function; |
18 class ICData; | 18 class ICData; |
19 class RawArray; | 19 class RawArray; |
20 class RawFunction; | 20 class RawFunction; |
21 class RawICData; | 21 class RawICData; |
| 22 class RawObject; |
22 class String; | 23 class String; |
23 | 24 |
24 class CodePatcher : public AllStatic { | 25 class CodePatcher : public AllStatic { |
25 public: | 26 public: |
26 // Dart static calls have a distinct, machine-dependent code pattern. | 27 // Dart static calls have a distinct, machine-dependent code pattern. |
27 | 28 |
28 // Patch static call before return_address in given code to the new target. | 29 // Patch static call before return_address in given code to the new target. |
29 static void PatchStaticCallAt(uword return_address, | 30 static void PatchStaticCallAt(uword return_address, |
30 const Code& code, | 31 const Code& code, |
31 uword new_target_address); | 32 uword new_target_address); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 ICData* ic_data); | 64 ICData* ic_data); |
64 | 65 |
65 // Return the arguments descriptor array of the closure call | 66 // Return the arguments descriptor array of the closure call |
66 // before the given return address. | 67 // before the given return address. |
67 static RawArray* GetClosureArgDescAt(uword return_address, | 68 static RawArray* GetClosureArgDescAt(uword return_address, |
68 const Code& code); | 69 const Code& code); |
69 | 70 |
70 static intptr_t InstanceCallSizeInBytes(); | 71 static intptr_t InstanceCallSizeInBytes(); |
71 | 72 |
72 static void InsertCallAt(uword start, uword target); | 73 static void InsertCallAt(uword start, uword target); |
| 74 |
| 75 static RawObject* GetEdgeCounterAt(uword pc, const Code& code); |
73 }; | 76 }; |
74 | 77 |
75 } // namespace dart | 78 } // namespace dart |
76 | 79 |
77 #endif // VM_CODE_PATCHER_H_ | 80 #endif // VM_CODE_PATCHER_H_ |
OLD | NEW |