| 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" |
| 11 #include "vm/object.h" | 11 #include "vm/object.h" |
| 12 | 12 |
| 13 namespace dart { | 13 namespace dart { |
| 14 | 14 |
| 15 RawArray* CodePatcher::GetClosureArgDescAt(uword return_address, | 15 RawArray* CodePatcher::GetClosureArgDescAt(uword return_address, |
| 16 const Code& code) { | 16 const Code& code) { |
| 17 ASSERT(code.ContainsInstructionAt(return_address)); | 17 ASSERT(code.ContainsInstructionAt(return_address)); |
| 18 CallPattern call(return_address, code); | 18 CallPattern call(return_address, code); |
| 19 return call.ArgumentsDescriptor(); | 19 return call.ClosureArgumentsDescriptor(); |
| 20 } | 20 } |
| 21 | 21 |
| 22 | 22 |
| 23 uword CodePatcher::GetStaticCallTargetAt(uword return_address, | 23 uword CodePatcher::GetStaticCallTargetAt(uword return_address, |
| 24 const Code& code) { | 24 const Code& code) { |
| 25 ASSERT(code.ContainsInstructionAt(return_address)); | 25 ASSERT(code.ContainsInstructionAt(return_address)); |
| 26 CallPattern call(return_address, code); | 26 CallPattern call(return_address, code); |
| 27 return call.TargetAddress(); | 27 return call.TargetAddress(); |
| 28 } | 28 } |
| 29 | 29 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 48 | 48 |
| 49 void CodePatcher::InsertCallAt(uword start, uword target) { | 49 void CodePatcher::InsertCallAt(uword start, uword target) { |
| 50 // The inserted call should not overlap the lazy deopt jump code. | 50 // The inserted call should not overlap the lazy deopt jump code. |
| 51 ASSERT(start + CallPattern::kFixedLengthInBytes <= target); | 51 ASSERT(start + CallPattern::kFixedLengthInBytes <= target); |
| 52 CallPattern::InsertAt(start, target); | 52 CallPattern::InsertAt(start, target); |
| 53 } | 53 } |
| 54 | 54 |
| 55 | 55 |
| 56 uword CodePatcher::GetInstanceCallAt(uword return_address, | 56 uword CodePatcher::GetInstanceCallAt(uword return_address, |
| 57 const Code& code, | 57 const Code& code, |
| 58 ICData* ic_data, | 58 ICData* ic_data) { |
| 59 Array* arguments_descriptor) { | |
| 60 ASSERT(code.ContainsInstructionAt(return_address)); | 59 ASSERT(code.ContainsInstructionAt(return_address)); |
| 61 CallPattern call(return_address, code); | 60 CallPattern call(return_address, code); |
| 62 if (ic_data != NULL) { | 61 if (ic_data != NULL) { |
| 63 *ic_data = call.IcData(); | 62 *ic_data = call.IcData(); |
| 64 } | 63 } |
| 65 if (arguments_descriptor != NULL) { | |
| 66 *arguments_descriptor = call.ArgumentsDescriptor(); | |
| 67 } | |
| 68 return call.TargetAddress(); | 64 return call.TargetAddress(); |
| 69 } | 65 } |
| 70 | 66 |
| 71 | 67 |
| 72 intptr_t CodePatcher::InstanceCallSizeInBytes() { | 68 intptr_t CodePatcher::InstanceCallSizeInBytes() { |
| 73 // The instance call instruction sequence has a variable size on ARM. | 69 // The instance call instruction sequence has a variable size on ARM. |
| 74 UNREACHABLE(); | 70 UNREACHABLE(); |
| 75 return 0; | 71 return 0; |
| 76 } | 72 } |
| 77 | 73 |
| 78 } // namespace dart | 74 } // namespace dart |
| 79 | 75 |
| 80 #endif // defined TARGET_ARCH_ARM | 76 #endif // defined TARGET_ARCH_ARM |
| OLD | NEW |