Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(176)

Side by Side Diff: runtime/vm/code_patcher.h

Issue 8687037: Very first steps for a debugger (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/code_generator.cc ('k') | runtime/vm/code_patcher_arm.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 RawArray; 18 class RawArray;
19 class String; 19 class String;
20 20
21 class CodePatcher : public AllStatic { 21 class CodePatcher : public AllStatic {
22 public: 22 public:
23 // Dart static calls have a distinct, machine-dependent code pattern. 23 // Dart static calls have a distinct, machine-dependent code pattern.
24 24
25 // Patch static call to the new target. 25 // Patch static call to the new target.
26 static void PatchStaticCallAt(uword addr, uword new_target_address); 26 static void PatchStaticCallAt(uword addr, uword new_target_address);
27 27
28 // Patch instance call to the new target.
29 static void PatchInstanceCallAt(uword addr, uword new_target_address);
30
28 // Patch entry point with a jump as specified in the code's patch region. 31 // Patch entry point with a jump as specified in the code's patch region.
29 static void PatchEntry(const Code& code); 32 static void PatchEntry(const Code& code);
30 33
31 // Restore entry point with original code (i.e., before patching). 34 // Restore entry point with original code (i.e., before patching).
32 static void RestoreEntry(const Code& code); 35 static void RestoreEntry(const Code& code);
33 36
34 // Returns true if the code can be patched with a jump at beginnning (checks 37 // Returns true if the code can be patched with a jump at beginnning (checks
35 // that there are no conflicts with object pointers). 38 // that there are no conflicts with object pointers).
36 static bool CodeIsPatchable(const Code& code); 39 static bool CodeIsPatchable(const Code& code);
37 40
(...skipping 17 matching lines...) Expand all
55 58
56 static void SetInstanceCallIcDataAt(uword return_address, 59 static void SetInstanceCallIcDataAt(uword return_address,
57 const Array& ic_data); 60 const Array& ic_data);
58 61
59 static intptr_t InstanceCallSizeInBytes(); 62 static intptr_t InstanceCallSizeInBytes();
60 }; 63 };
61 64
62 } // namespace dart 65 } // namespace dart
63 66
64 #endif // VM_CODE_PATCHER_H_ 67 #endif // VM_CODE_PATCHER_H_
OLDNEW
« no previous file with comments | « runtime/vm/code_generator.cc ('k') | runtime/vm/code_patcher_arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698