| OLD | NEW |
| 1 // Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dartino 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.md file. | 3 // BSD-style license that can be found in the LICENSE.md file. |
| 4 | 4 |
| 5 #ifdef FLETCH_ENABLE_LIVE_CODING | 5 #ifdef DARTINO_ENABLE_LIVE_CODING |
| 6 | 6 |
| 7 #include "src/vm/program_folder.h" | 7 #include "src/vm/program_folder.h" |
| 8 | 8 |
| 9 #include "src/shared/bytecodes.h" | 9 #include "src/shared/bytecodes.h" |
| 10 #include "src/shared/flags.h" | 10 #include "src/shared/flags.h" |
| 11 #include "src/shared/names.h" | 11 #include "src/shared/names.h" |
| 12 #include "src/shared/selectors.h" | 12 #include "src/shared/selectors.h" |
| 13 | 13 |
| 14 #include "src/vm/hash_map.h" | 14 #include "src/vm/hash_map.h" |
| 15 #include "src/vm/heap.h" | 15 #include "src/vm/heap.h" |
| 16 #include "src/vm/program.h" | 16 #include "src/vm/program.h" |
| 17 #include "src/vm/selector_row.h" | 17 #include "src/vm/selector_row.h" |
| 18 #include "src/vm/vector.h" | 18 #include "src/vm/vector.h" |
| 19 | 19 |
| 20 namespace fletch { | 20 namespace dartino { |
| 21 | 21 |
| 22 typedef HashMap<intptr_t, SelectorRow*> SelectorRowMap; | 22 typedef HashMap<intptr_t, SelectorRow*> SelectorRowMap; |
| 23 typedef HashMap<intptr_t, int> SelectorOffsetMap; | 23 typedef HashMap<intptr_t, int> SelectorOffsetMap; |
| 24 | 24 |
| 25 class ProgramRewriter { | 25 class ProgramRewriter { |
| 26 public: | 26 public: |
| 27 ~ProgramRewriter() { | 27 ~ProgramRewriter() { |
| 28 SelectorRowMap::ConstIterator it = selector_rows_.Begin(); | 28 SelectorRowMap::ConstIterator it = selector_rows_.Begin(); |
| 29 SelectorRowMap::ConstIterator end = selector_rows_.End(); | 29 SelectorRowMap::ConstIterator end = selector_rows_.End(); |
| 30 for (; it != end; ++it) delete it->second; | 30 for (; it != end; ++it) delete it->second; |
| (...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 411 if (program->is_optimized()) { | 411 if (program->is_optimized()) { |
| 412 if (unfold) { | 412 if (unfold) { |
| 413 program_folder.Unfold(); | 413 program_folder.Unfold(); |
| 414 } | 414 } |
| 415 } else if (!unfold) { | 415 } else if (!unfold) { |
| 416 program_folder.Fold(); | 416 program_folder.Fold(); |
| 417 } | 417 } |
| 418 ASSERT(program->is_optimized() == !unfold); | 418 ASSERT(program->is_optimized() == !unfold); |
| 419 } | 419 } |
| 420 | 420 |
| 421 } // namespace fletch | 421 } // namespace dartino |
| 422 | 422 |
| 423 #endif // FLETCH_ENABLE_LIVE_CODING | 423 #endif // DARTINO_ENABLE_LIVE_CODING |
| OLD | NEW |