| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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/assembler.h" | 5 #include "vm/assembler.h" |
| 6 | 6 |
| 7 #include "platform/utils.h" | 7 #include "platform/utils.h" |
| 8 #include "vm/cpu.h" | 8 #include "vm/cpu.h" |
| 9 #include "vm/heap.h" | 9 #include "vm/heap.h" |
| 10 #include "vm/memory_region.h" | 10 #include "vm/memory_region.h" |
| 11 #include "vm/os.h" | 11 #include "vm/os.h" |
| 12 #include "vm/zone.h" | 12 #include "vm/zone.h" |
| 13 | 13 |
| 14 namespace dart { | 14 namespace dart { |
| 15 | 15 |
| 16 DECLARE_FLAG(bool, disassemble); |
| 17 DECLARE_FLAG(bool, disassemble_optimized); |
| 18 |
| 19 DEFINE_FLAG(bool, check_code_pointer, false, |
| 20 "Verify instructions offset in code object." |
| 21 "NOTE: This breaks the profiler."); |
| 16 DEFINE_FLAG(bool, code_comments, false, | 22 DEFINE_FLAG(bool, code_comments, false, |
| 17 "Include comments into code and disassembly"); | 23 "Include comments into code and disassembly"); |
| 18 #if defined(TARGET_ARCH_ARM) || defined(TARGET_ARCH_MIPS) | 24 #if defined(TARGET_ARCH_ARM) || defined(TARGET_ARCH_MIPS) |
| 19 DEFINE_FLAG(bool, use_far_branches, false, | 25 DEFINE_FLAG(bool, use_far_branches, false, |
| 20 "Enable far branches for ARM and MIPS"); | 26 "Enable far branches for ARM and MIPS"); |
| 21 #endif | 27 #endif |
| 22 | 28 |
| 23 DECLARE_FLAG(bool, disassemble); | |
| 24 DECLARE_FLAG(bool, disassemble_optimized); | |
| 25 | |
| 26 static uword NewContents(intptr_t capacity) { | 29 static uword NewContents(intptr_t capacity) { |
| 27 Zone* zone = Thread::Current()->zone(); | 30 Zone* zone = Thread::Current()->zone(); |
| 28 uword result = zone->AllocUnsafe(capacity); | 31 uword result = zone->AllocUnsafe(capacity); |
| 29 #if defined(DEBUG) | 32 #if defined(DEBUG) |
| 30 // Initialize the buffer with kBreakPointInstruction to force a break | 33 // Initialize the buffer with kBreakPointInstruction to force a break |
| 31 // point if we ever execute an uninitialized part of the code buffer. | 34 // point if we ever execute an uninitialized part of the code buffer. |
| 32 Assembler::InitializeMemoryWithBreakpoints(result, capacity); | 35 Assembler::InitializeMemoryWithBreakpoints(result, capacity); |
| 33 #endif | 36 #endif |
| 34 return result; | 37 return result; |
| 35 } | 38 } |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 result.SetObjectAt(i, *object_pool_[i].obj_); | 317 result.SetObjectAt(i, *object_pool_[i].obj_); |
| 315 } else { | 318 } else { |
| 316 result.SetRawValueAt(i, object_pool_[i].raw_value_); | 319 result.SetRawValueAt(i, object_pool_[i].raw_value_); |
| 317 } | 320 } |
| 318 } | 321 } |
| 319 return result.raw(); | 322 return result.raw(); |
| 320 } | 323 } |
| 321 | 324 |
| 322 | 325 |
| 323 } // namespace dart | 326 } // namespace dart |
| OLD | NEW |