Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 | 4 |
| 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM. |
| 6 #if defined(TARGET_ARCH_ARM) | 6 #if defined(TARGET_ARCH_ARM) |
| 7 | 7 |
| 8 #include "vm/code_patcher.h" | 8 #include "vm/code_patcher.h" |
| 9 | 9 |
| 10 #include "vm/instructions.h" | 10 #include "vm/instructions.h" |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 32 void CodePatcher::PatchInstanceCallAt(uword return_address, | 32 void CodePatcher::PatchInstanceCallAt(uword return_address, |
| 33 const Code& code, | 33 const Code& code, |
| 34 uword new_target) { | 34 uword new_target) { |
| 35 ASSERT(code.ContainsInstructionAt(return_address)); | 35 ASSERT(code.ContainsInstructionAt(return_address)); |
| 36 CallPattern call(return_address, code); | 36 CallPattern call(return_address, code); |
| 37 call.SetTargetAddress(new_target); | 37 call.SetTargetAddress(new_target); |
| 38 } | 38 } |
| 39 | 39 |
| 40 | 40 |
| 41 void CodePatcher::InsertCallAt(uword start, uword target) { | 41 void CodePatcher::InsertCallAt(uword start, uword target) { |
| 42 UNIMPLEMENTED(); | 42 // The inserted call should not overlap the lazy deopt jump code. |
| 43 ASSERT(start + CallPattern::kFixedLengthInBytes <= target); | |
|
srdjan
2013/05/03 17:16:18
Currently there is always a patch jump before the
regis
2013/05/03 18:34:12
Agreed. It will not catch all issues.
| |
| 44 CallPattern::InsertAt(start, target); | |
| 43 } | 45 } |
| 44 | 46 |
| 45 | 47 |
| 46 uword CodePatcher::GetInstanceCallAt(uword return_address, | 48 uword CodePatcher::GetInstanceCallAt(uword return_address, |
| 47 const Code& code, | 49 const Code& code, |
| 48 ICData* ic_data, | 50 ICData* ic_data, |
| 49 Array* arguments_descriptor) { | 51 Array* arguments_descriptor) { |
| 50 ASSERT(code.ContainsInstructionAt(return_address)); | 52 ASSERT(code.ContainsInstructionAt(return_address)); |
| 51 CallPattern call(return_address, code); | 53 CallPattern call(return_address, code); |
| 52 if (ic_data != NULL) { | 54 if (ic_data != NULL) { |
| 53 *ic_data = call.IcData(); | 55 *ic_data = call.IcData(); |
| 54 } | 56 } |
| 55 if (arguments_descriptor != NULL) { | 57 if (arguments_descriptor != NULL) { |
| 56 *arguments_descriptor = call.ArgumentsDescriptor(); | 58 *arguments_descriptor = call.ArgumentsDescriptor(); |
| 57 } | 59 } |
| 58 return call.TargetAddress(); | 60 return call.TargetAddress(); |
| 59 } | 61 } |
| 60 | 62 |
| 61 | 63 |
| 62 intptr_t CodePatcher::InstanceCallSizeInBytes() { | 64 intptr_t CodePatcher::InstanceCallSizeInBytes() { |
| 63 // The instance call instruction sequence has a variable size on ARM. | 65 // The instance call instruction sequence has a variable size on ARM. |
| 64 UNREACHABLE(); | 66 UNREACHABLE(); |
| 65 return 0; | 67 return 0; |
| 66 } | 68 } |
| 67 | 69 |
| 68 } // namespace dart | 70 } // namespace dart |
| 69 | 71 |
| 70 #endif // defined TARGET_ARCH_ARM | 72 #endif // defined TARGET_ARCH_ARM |
| OLD | NEW |