| 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 #ifndef VM_ASSEMBLER_ARM_H_ | 5 #ifndef VM_ASSEMBLER_ARM_H_ |
| 6 #define VM_ASSEMBLER_ARM_H_ | 6 #define VM_ASSEMBLER_ARM_H_ |
| 7 | 7 |
| 8 #ifndef VM_ASSEMBLER_H_ | 8 #ifndef VM_ASSEMBLER_H_ |
| 9 #error Do not include assembler_arm.h directly; use assembler.h instead. | 9 #error Do not include assembler_arm.h directly; use assembler.h instead. |
| 10 #endif | 10 #endif |
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 }; | 312 }; |
| 313 | 313 |
| 314 | 314 |
| 315 class Assembler : public ValueObject { | 315 class Assembler : public ValueObject { |
| 316 public: | 316 public: |
| 317 explicit Assembler(bool use_far_branches = false) | 317 explicit Assembler(bool use_far_branches = false) |
| 318 : buffer_(), | 318 : buffer_(), |
| 319 prologue_offset_(-1), | 319 prologue_offset_(-1), |
| 320 use_far_branches_(use_far_branches), | 320 use_far_branches_(use_far_branches), |
| 321 comments_(), | 321 comments_(), |
| 322 allow_constant_pool_(true) { } | 322 constant_pool_allowed_(true) { } |
| 323 | 323 |
| 324 ~Assembler() { } | 324 ~Assembler() { } |
| 325 | 325 |
| 326 void PopRegister(Register r) { Pop(r); } | 326 void PopRegister(Register r) { Pop(r); } |
| 327 | 327 |
| 328 void Bind(Label* label); | 328 void Bind(Label* label); |
| 329 void Jump(Label* label) { b(label); } | 329 void Jump(Label* label) { b(label); } |
| 330 | 330 |
| 331 // Misc. functionality | 331 // Misc. functionality |
| 332 intptr_t CodeSize() const { return buffer_.Size(); } | 332 intptr_t CodeSize() const { return buffer_.Size(); } |
| (...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 958 Register temp2); | 958 Register temp2); |
| 959 | 959 |
| 960 // Emit data (e.g encoded instruction or immediate) in instruction stream. | 960 // Emit data (e.g encoded instruction or immediate) in instruction stream. |
| 961 void Emit(int32_t value); | 961 void Emit(int32_t value); |
| 962 | 962 |
| 963 // On some other platforms, we draw a distinction between safe and unsafe | 963 // On some other platforms, we draw a distinction between safe and unsafe |
| 964 // smis. | 964 // smis. |
| 965 static bool IsSafe(const Object& object) { return true; } | 965 static bool IsSafe(const Object& object) { return true; } |
| 966 static bool IsSafeSmi(const Object& object) { return object.IsSmi(); } | 966 static bool IsSafeSmi(const Object& object) { return object.IsSmi(); } |
| 967 | 967 |
| 968 bool allow_constant_pool() const { | 968 bool constant_pool_allowed() const { |
| 969 return allow_constant_pool_; | 969 return constant_pool_allowed_; |
| 970 } | 970 } |
| 971 void set_allow_constant_pool(bool b) { | 971 void set_constant_pool_allowed(bool b) { |
| 972 allow_constant_pool_ = b; | 972 constant_pool_allowed_ = b; |
| 973 } | 973 } |
| 974 | 974 |
| 975 private: | 975 private: |
| 976 AssemblerBuffer buffer_; // Contains position independent code. | 976 AssemblerBuffer buffer_; // Contains position independent code. |
| 977 ObjectPoolWrapper object_pool_wrapper_; | 977 ObjectPoolWrapper object_pool_wrapper_; |
| 978 | 978 |
| 979 int32_t prologue_offset_; | 979 int32_t prologue_offset_; |
| 980 | 980 |
| 981 bool use_far_branches_; | 981 bool use_far_branches_; |
| 982 | 982 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 998 | 998 |
| 999 private: | 999 private: |
| 1000 intptr_t pc_offset_; | 1000 intptr_t pc_offset_; |
| 1001 const String& comment_; | 1001 const String& comment_; |
| 1002 | 1002 |
| 1003 DISALLOW_COPY_AND_ASSIGN(CodeComment); | 1003 DISALLOW_COPY_AND_ASSIGN(CodeComment); |
| 1004 }; | 1004 }; |
| 1005 | 1005 |
| 1006 GrowableArray<CodeComment*> comments_; | 1006 GrowableArray<CodeComment*> comments_; |
| 1007 | 1007 |
| 1008 bool allow_constant_pool_; | 1008 bool constant_pool_allowed_; |
| 1009 | 1009 |
| 1010 void LoadObjectHelper(Register rd, | 1010 void LoadObjectHelper(Register rd, |
| 1011 const Object& object, | 1011 const Object& object, |
| 1012 Condition cond, | 1012 Condition cond, |
| 1013 bool is_unique); | 1013 bool is_unique); |
| 1014 | 1014 |
| 1015 void EmitType01(Condition cond, | 1015 void EmitType01(Condition cond, |
| 1016 int type, | 1016 int type, |
| 1017 Opcode opcode, | 1017 Opcode opcode, |
| 1018 int set_cc, | 1018 int set_cc, |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1140 Register new_value, | 1140 Register new_value, |
| 1141 FieldContent old_content); | 1141 FieldContent old_content); |
| 1142 | 1142 |
| 1143 DISALLOW_ALLOCATION(); | 1143 DISALLOW_ALLOCATION(); |
| 1144 DISALLOW_COPY_AND_ASSIGN(Assembler); | 1144 DISALLOW_COPY_AND_ASSIGN(Assembler); |
| 1145 }; | 1145 }; |
| 1146 | 1146 |
| 1147 } // namespace dart | 1147 } // namespace dart |
| 1148 | 1148 |
| 1149 #endif // VM_ASSEMBLER_ARM_H_ | 1149 #endif // VM_ASSEMBLER_ARM_H_ |
| OLD | NEW |