| 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/class_finalizer.h" | 10 #include "vm/class_finalizer.h" |
| (...skipping 3392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3403 } | 3403 } |
| 3404 | 3404 |
| 3405 | 3405 |
| 3406 // <Expression> ::= StoreLocal { local: LocalVariable | 3406 // <Expression> ::= StoreLocal { local: LocalVariable |
| 3407 // value: <Expression> } | 3407 // value: <Expression> } |
| 3408 void EffectGraphVisitor::VisitStoreLocalNode(StoreLocalNode* node) { | 3408 void EffectGraphVisitor::VisitStoreLocalNode(StoreLocalNode* node) { |
| 3409 // If the right hand side is an expression that does not contain | 3409 // If the right hand side is an expression that does not contain |
| 3410 // a safe point for the debugger to stop, add an explicit stub | 3410 // a safe point for the debugger to stop, add an explicit stub |
| 3411 // call. | 3411 // call. |
| 3412 if (node->value()->IsLiteralNode() || | 3412 if (node->value()->IsLiteralNode() || |
| 3413 node->value()->IsLoadLocalNode()) { | 3413 node->value()->IsLoadLocalNode() || |
| 3414 node->value()->IsClosureNode()) { |
| 3414 AddInstruction(new(I) DebugStepCheckInstr( | 3415 AddInstruction(new(I) DebugStepCheckInstr( |
| 3415 node->token_pos(), RawPcDescriptors::kRuntimeCall)); | 3416 node->token_pos(), RawPcDescriptors::kRuntimeCall)); |
| 3416 } | 3417 } |
| 3417 | 3418 |
| 3418 ValueGraphVisitor for_value(owner()); | 3419 ValueGraphVisitor for_value(owner()); |
| 3419 node->value()->Visit(&for_value); | 3420 node->value()->Visit(&for_value); |
| 3420 Append(for_value); | 3421 Append(for_value); |
| 3421 Value* store_value = for_value.value(); | 3422 Value* store_value = for_value.value(); |
| 3422 if (FLAG_enable_type_checks) { | 3423 if (FLAG_enable_type_checks) { |
| 3423 store_value = BuildAssignableValue(node->value()->token_pos(), | 3424 store_value = BuildAssignableValue(node->value()->token_pos(), |
| (...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4186 ASSERT(!func.IsNull()); | 4187 ASSERT(!func.IsNull()); |
| 4187 return new(I) StaticCallInstr(token_pos, | 4188 return new(I) StaticCallInstr(token_pos, |
| 4188 func, | 4189 func, |
| 4189 Object::null_array(), // No names. | 4190 Object::null_array(), // No names. |
| 4190 arguments, | 4191 arguments, |
| 4191 owner()->ic_data_array()); | 4192 owner()->ic_data_array()); |
| 4192 } | 4193 } |
| 4193 | 4194 |
| 4194 | 4195 |
| 4195 void EffectGraphVisitor::BuildThrowNode(ThrowNode* node) { | 4196 void EffectGraphVisitor::BuildThrowNode(ThrowNode* node) { |
| 4197 if (node->exception()->IsLiteralNode() || |
| 4198 node->exception()->IsLoadLocalNode() || |
| 4199 node->exception()->IsClosureNode()) { |
| 4200 AddInstruction(new(I) DebugStepCheckInstr( |
| 4201 node->token_pos(), RawPcDescriptors::kRuntimeCall)); |
| 4202 } |
| 4196 ValueGraphVisitor for_exception(owner()); | 4203 ValueGraphVisitor for_exception(owner()); |
| 4197 node->exception()->Visit(&for_exception); | 4204 node->exception()->Visit(&for_exception); |
| 4198 Append(for_exception); | 4205 Append(for_exception); |
| 4199 PushArgument(for_exception.value()); | 4206 PushArgument(for_exception.value()); |
| 4200 Instruction* instr = NULL; | 4207 Instruction* instr = NULL; |
| 4201 if (node->stacktrace() == NULL) { | 4208 if (node->stacktrace() == NULL) { |
| 4202 instr = new(I) ThrowInstr(node->token_pos()); | 4209 instr = new(I) ThrowInstr(node->token_pos()); |
| 4203 } else { | 4210 } else { |
| 4204 ValueGraphVisitor for_stack_trace(owner()); | 4211 ValueGraphVisitor for_stack_trace(owner()); |
| 4205 node->stacktrace()->Visit(&for_stack_trace); | 4212 node->stacktrace()->Visit(&for_stack_trace); |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4307 Report::MessageF(Report::kBailout, | 4314 Report::MessageF(Report::kBailout, |
| 4308 Script::Handle(function.script()), | 4315 Script::Handle(function.script()), |
| 4309 function.token_pos(), | 4316 function.token_pos(), |
| 4310 "FlowGraphBuilder Bailout: %s %s", | 4317 "FlowGraphBuilder Bailout: %s %s", |
| 4311 String::Handle(function.name()).ToCString(), | 4318 String::Handle(function.name()).ToCString(), |
| 4312 reason); | 4319 reason); |
| 4313 UNREACHABLE(); | 4320 UNREACHABLE(); |
| 4314 } | 4321 } |
| 4315 | 4322 |
| 4316 } // namespace dart | 4323 } // namespace dart |
| OLD | NEW |