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/flow_graph_builder.h" | 5 #include "vm/flow_graph_builder.h" |
6 | 6 |
7 #include "lib/invocation_mirror.h" | 7 #include "lib/invocation_mirror.h" |
8 #include "vm/ast_printer.h" | 8 #include "vm/ast_printer.h" |
9 #include "vm/bit_vector.h" | 9 #include "vm/bit_vector.h" |
10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
(...skipping 3346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3357 void EffectGraphVisitor::VisitStoreLocalNode(StoreLocalNode* node) { | 3357 void EffectGraphVisitor::VisitStoreLocalNode(StoreLocalNode* node) { |
3358 // If the right hand side is an expression that does not contain | 3358 // If the right hand side is an expression that does not contain |
3359 // a safe point for the debugger to stop, add an explicit stub | 3359 // a safe point for the debugger to stop, add an explicit stub |
3360 // call. Exception: don't do this when assigning to or from internal | 3360 // call. Exception: don't do this when assigning to or from internal |
3361 // variables, or for generated code that has no source position. | 3361 // variables, or for generated code that has no source position. |
3362 if (FLAG_support_debugger) { | 3362 if (FLAG_support_debugger) { |
3363 AstNode* rhs = node->value(); | 3363 AstNode* rhs = node->value(); |
3364 if (rhs->IsAssignableNode()) { | 3364 if (rhs->IsAssignableNode()) { |
3365 rhs = rhs->AsAssignableNode()->expr(); | 3365 rhs = rhs->AsAssignableNode()->expr(); |
3366 } | 3366 } |
3367 if ((rhs->IsLiteralNode() || | 3367 if ((rhs->IsLiteralNode() || rhs->IsLoadStaticFieldNode() || |
3368 (rhs->IsLoadLocalNode() && | 3368 (rhs->IsLoadLocalNode() && |
3369 !rhs->AsLoadLocalNode()->local().IsInternal()) || | 3369 !rhs->AsLoadLocalNode()->local().IsInternal()) || |
3370 rhs->IsClosureNode()) && | 3370 rhs->IsClosureNode()) && |
3371 !node->local().IsInternal() && node->token_pos().IsDebugPause()) { | 3371 !node->local().IsInternal() && node->token_pos().IsDebugPause()) { |
3372 AddInstruction(new (Z) DebugStepCheckInstr( | 3372 AddInstruction(new (Z) DebugStepCheckInstr( |
3373 node->token_pos(), RawPcDescriptors::kRuntimeCall)); | 3373 node->token_pos(), RawPcDescriptors::kRuntimeCall)); |
3374 } | 3374 } |
3375 } | 3375 } |
3376 | 3376 |
3377 ValueGraphVisitor for_value(owner()); | 3377 ValueGraphVisitor for_value(owner()); |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3469 TokenPosition token_pos) { | 3469 TokenPosition token_pos) { |
3470 if (FLAG_support_debugger) { | 3470 if (FLAG_support_debugger) { |
3471 // If the right hand side is an expression that does not contain | 3471 // If the right hand side is an expression that does not contain |
3472 // a safe point for the debugger to stop, add an explicit stub | 3472 // a safe point for the debugger to stop, add an explicit stub |
3473 // call. | 3473 // call. |
3474 AstNode* rhs = node->value(); | 3474 AstNode* rhs = node->value(); |
3475 if (rhs->IsAssignableNode()) { | 3475 if (rhs->IsAssignableNode()) { |
3476 rhs = rhs->AsAssignableNode()->expr(); | 3476 rhs = rhs->AsAssignableNode()->expr(); |
3477 } | 3477 } |
3478 if ((rhs->IsLiteralNode() || rhs->IsLoadLocalNode() || | 3478 if ((rhs->IsLiteralNode() || rhs->IsLoadLocalNode() || |
3479 rhs->IsClosureNode()) && | 3479 rhs->IsLoadStaticFieldNode() || rhs->IsClosureNode()) && |
3480 node->token_pos().IsDebugPause()) { | 3480 node->token_pos().IsDebugPause()) { |
3481 AddInstruction(new (Z) DebugStepCheckInstr( | 3481 AddInstruction(new (Z) DebugStepCheckInstr( |
3482 node->token_pos(), RawPcDescriptors::kRuntimeCall)); | 3482 node->token_pos(), RawPcDescriptors::kRuntimeCall)); |
3483 } | 3483 } |
3484 } | 3484 } |
3485 | 3485 |
3486 ValueGraphVisitor for_value(owner()); | 3486 ValueGraphVisitor for_value(owner()); |
3487 node->value()->Visit(&for_value); | 3487 node->value()->Visit(&for_value); |
3488 Append(for_value); | 3488 Append(for_value); |
3489 Value* store_value = NULL; | 3489 Value* store_value = NULL; |
(...skipping 710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4200 return new (Z) StaticCallInstr(token_pos, func, | 4200 return new (Z) StaticCallInstr(token_pos, func, |
4201 Object::null_array(), // No names. | 4201 Object::null_array(), // No names. |
4202 arguments, owner()->ic_data_array()); | 4202 arguments, owner()->ic_data_array()); |
4203 } | 4203 } |
4204 | 4204 |
4205 | 4205 |
4206 void EffectGraphVisitor::BuildThrowNode(ThrowNode* node) { | 4206 void EffectGraphVisitor::BuildThrowNode(ThrowNode* node) { |
4207 if (FLAG_support_debugger) { | 4207 if (FLAG_support_debugger) { |
4208 if (node->exception()->IsLiteralNode() || | 4208 if (node->exception()->IsLiteralNode() || |
4209 node->exception()->IsLoadLocalNode() || | 4209 node->exception()->IsLoadLocalNode() || |
| 4210 node->exception()->IsLoadStaticFieldNode() || |
4210 node->exception()->IsClosureNode()) { | 4211 node->exception()->IsClosureNode()) { |
4211 AddInstruction(new (Z) DebugStepCheckInstr( | 4212 AddInstruction(new (Z) DebugStepCheckInstr( |
4212 node->token_pos(), RawPcDescriptors::kRuntimeCall)); | 4213 node->token_pos(), RawPcDescriptors::kRuntimeCall)); |
4213 } | 4214 } |
4214 } | 4215 } |
4215 ValueGraphVisitor for_exception(owner()); | 4216 ValueGraphVisitor for_exception(owner()); |
4216 node->exception()->Visit(&for_exception); | 4217 node->exception()->Visit(&for_exception); |
4217 Append(for_exception); | 4218 Append(for_exception); |
4218 PushArgument(for_exception.value()); | 4219 PushArgument(for_exception.value()); |
4219 Instruction* instr = NULL; | 4220 Instruction* instr = NULL; |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4333 graph_entry_->PruneUnreachable(graph_entry_, NULL, osr_id_, block_marks); | 4334 graph_entry_->PruneUnreachable(graph_entry_, NULL, osr_id_, block_marks); |
4334 ASSERT(found); | 4335 ASSERT(found); |
4335 } | 4336 } |
4336 | 4337 |
4337 | 4338 |
4338 void FlowGraphBuilder::Bailout(const char* reason) const { | 4339 void FlowGraphBuilder::Bailout(const char* reason) const { |
4339 parsed_function_.Bailout("FlowGraphBuilder", reason); | 4340 parsed_function_.Bailout("FlowGraphBuilder", reason); |
4340 } | 4341 } |
4341 | 4342 |
4342 } // namespace dart | 4343 } // namespace dart |
OLD | NEW |