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/instructions.h" | 8 #include "vm/instructions.h" |
| 9 #include "vm/object.h" | 9 #include "vm/object.h" |
| 10 | 10 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 60 uword CallPattern::TargetAddress() const { | 60 uword CallPattern::TargetAddress() const { |
| 61 const Object& target_address = Object::Handle(object_pool_.At(pool_index_)); | 61 const Object& target_address = Object::Handle(object_pool_.At(pool_index_)); |
| 62 ASSERT(target_address.IsSmi()); | 62 ASSERT(target_address.IsSmi()); |
| 63 return Smi::Cast(target_address).Value() << kSmiTagShift; | 63 return Smi::Cast(target_address).Value() << kSmiTagShift; |
| 64 } | 64 } |
| 65 | 65 |
| 66 | 66 |
| 67 void CallPattern::SetTargetAddress(uword target_address) const { | 67 void CallPattern::SetTargetAddress(uword target_address) const { |
| 68 ASSERT(Utils::IsAligned(target_address, 4)); | 68 ASSERT(Utils::IsAligned(target_address, 4)); |
| 69 // The address is stored in the object array as a RawSmi. | 69 // The address is stored in the object array as a RawSmi. |
| 70 const Smi& smi = Smi::Handle(Smi::New(target_address >> kSmiTagShift)); | 70 const intptr_t signed_target_address = static_cast<intptr_t>(target_address); |
|
srdjan
2013/03/01 17:46:28
I'd like to discuss this code in person.
regis
2013/03/04 17:52:18
As explained in person, the signed shift right is
| |
| 71 const Smi& smi = Smi::Handle(Smi::New(signed_target_address >> kSmiTagShift)); | |
| 71 object_pool_.SetAt(pool_index_, smi); | 72 object_pool_.SetAt(pool_index_, smi); |
| 72 } | 73 } |
| 73 | 74 |
| 74 | 75 |
| 75 bool JumpPattern::IsValid() const { | 76 bool JumpPattern::IsValid() const { |
| 76 UNIMPLEMENTED(); | 77 UNIMPLEMENTED(); |
| 77 return false; | 78 return false; |
| 78 } | 79 } |
| 79 | 80 |
| 80 | 81 |
| 81 uword JumpPattern::TargetAddress() const { | 82 uword JumpPattern::TargetAddress() const { |
| 82 UNIMPLEMENTED(); | 83 UNIMPLEMENTED(); |
| 83 return 0; | 84 return 0; |
| 84 } | 85 } |
| 85 | 86 |
| 86 | 87 |
| 87 void JumpPattern::SetTargetAddress(uword target) const { | 88 void JumpPattern::SetTargetAddress(uword target) const { |
| 88 UNIMPLEMENTED(); | 89 UNIMPLEMENTED(); |
| 89 } | 90 } |
| 90 | 91 |
| 91 } // namespace dart | 92 } // namespace dart |
| 92 | 93 |
| 93 #endif // defined TARGET_ARCH_ARM | 94 #endif // defined TARGET_ARCH_ARM |
| 94 | 95 |
| OLD | NEW |