| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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/kernel_binary_flowgraph.h" | 5 #include "vm/kernel_binary_flowgraph.h" |
| 6 | 6 |
| 7 #include "vm/compiler.h" | 7 #include "vm/compiler.h" |
| 8 #include "vm/longjump.h" | 8 #include "vm/longjump.h" |
| 9 #include "vm/object_store.h" | 9 #include "vm/object_store.h" |
| 10 | 10 |
| (...skipping 3310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3321 ASSERT(check_pos.IsDebugPause()); | 3321 ASSERT(check_pos.IsDebugPause()); |
| 3322 } | 3322 } |
| 3323 | 3323 |
| 3324 // TODO(29737): This sequence should be generated in order. | 3324 // TODO(29737): This sequence should be generated in order. |
| 3325 body = DebugStepCheck(check_pos) + body; | 3325 body = DebugStepCheck(check_pos) + body; |
| 3326 flow_graph_builder_->context_depth_ = current_context_depth; | 3326 flow_graph_builder_->context_depth_ = current_context_depth; |
| 3327 } | 3327 } |
| 3328 | 3328 |
| 3329 normal_entry->LinkTo(body.entry); | 3329 normal_entry->LinkTo(body.entry); |
| 3330 | 3330 |
| 3331 GraphEntryInstr* graph_entry = flow_graph_builder_->graph_entry_; |
| 3331 // When compiling for OSR, use a depth first search to prune instructions | 3332 // When compiling for OSR, use a depth first search to prune instructions |
| 3332 // unreachable from the OSR entry. Catch entries are always considered | 3333 // unreachable from the OSR entry. Catch entries are always considered |
| 3333 // reachable, even if they become unreachable after OSR. | 3334 // reachable, even if they become unreachable after OSR. |
| 3334 if (flow_graph_builder_->osr_id_ != Compiler::kNoOSRDeoptId) { | 3335 if (flow_graph_builder_->osr_id_ != Compiler::kNoOSRDeoptId) { |
| 3335 BitVector* block_marks = | 3336 graph_entry->PruneUnreachableForOSR(Z, flow_graph_builder_->next_block_id_); |
| 3336 new (Z) BitVector(Z, flow_graph_builder_->next_block_id_); | |
| 3337 bool found = flow_graph_builder_->graph_entry_->PruneUnreachable( | |
| 3338 flow_graph_builder_->graph_entry_, NULL, flow_graph_builder_->osr_id_, | |
| 3339 block_marks); | |
| 3340 ASSERT(found); | |
| 3341 } | 3337 } |
| 3342 return new (Z) | 3338 return new (Z) FlowGraph(*parsed_function(), graph_entry, |
| 3343 FlowGraph(*parsed_function(), flow_graph_builder_->graph_entry_, | 3339 flow_graph_builder_->next_block_id_ - 1); |
| 3344 flow_graph_builder_->next_block_id_ - 1); | |
| 3345 } | 3340 } |
| 3346 | 3341 |
| 3347 Fragment StreamingFlowGraphBuilder::BuildGetMainClosure() { | 3342 Fragment StreamingFlowGraphBuilder::BuildGetMainClosure() { |
| 3348 // _getMainClosure in dart:_builtin. Compile that one specially here. | 3343 // _getMainClosure in dart:_builtin. Compile that one specially here. |
| 3349 const dart::Library& builtin = | 3344 const dart::Library& builtin = |
| 3350 dart::Library::Handle(Z, I->object_store()->builtin_library()); | 3345 dart::Library::Handle(Z, I->object_store()->builtin_library()); |
| 3351 const Object& main = | 3346 const Object& main = |
| 3352 Object::Handle(Z, builtin.LookupObjectAllowPrivate(dart::String::Handle( | 3347 Object::Handle(Z, builtin.LookupObjectAllowPrivate(dart::String::Handle( |
| 3353 Z, dart::String::New("main")))); | 3348 Z, dart::String::New("main")))); |
| 3354 if (main.IsField()) { | 3349 if (main.IsField()) { |
| (...skipping 3587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6942 metadata_values.SetAt(i, value); | 6937 metadata_values.SetAt(i, value); |
| 6943 } | 6938 } |
| 6944 | 6939 |
| 6945 return metadata_values.raw(); | 6940 return metadata_values.raw(); |
| 6946 } | 6941 } |
| 6947 | 6942 |
| 6948 } // namespace kernel | 6943 } // namespace kernel |
| 6949 } // namespace dart | 6944 } // namespace dart |
| 6950 | 6945 |
| 6951 #endif // !defined(DART_PRECOMPILED_RUNTIME) | 6946 #endif // !defined(DART_PRECOMPILED_RUNTIME) |
| OLD | NEW |