| 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/globals.h" // Needed here to get TARGET_ARCH_XXX. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_XXX. |
| 6 | 6 |
| 7 #include "vm/flow_graph_compiler.h" | 7 #include "vm/flow_graph_compiler.h" |
| 8 | 8 |
| 9 #include "vm/dart_entry.h" | 9 #include "vm/dart_entry.h" |
| 10 #include "vm/debugger.h" | 10 #include "vm/debugger.h" |
| (...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 426 } | 426 } |
| 427 | 427 |
| 428 | 428 |
| 429 // Returns 'true' if code generation for this function is complete, i.e., | 429 // Returns 'true' if code generation for this function is complete, i.e., |
| 430 // no fall-through to regular code is needed. | 430 // no fall-through to regular code is needed. |
| 431 bool FlowGraphCompiler::TryIntrinsify() { | 431 bool FlowGraphCompiler::TryIntrinsify() { |
| 432 if (!CanOptimize()) return false; | 432 if (!CanOptimize()) return false; |
| 433 // Intrinsification skips arguments checks, therefore disable if in checked | 433 // Intrinsification skips arguments checks, therefore disable if in checked |
| 434 // mode. | 434 // mode. |
| 435 if (FLAG_intrinsify && !FLAG_enable_type_checks) { | 435 if (FLAG_intrinsify && !FLAG_enable_type_checks) { |
| 436 if ((parsed_function().function().kind() == RawFunction::kImplicitGetter)) { | 436 if (parsed_function().function().kind() == RawFunction::kImplicitGetter) { |
| 437 // An implicit getter must have a specific AST structure. | 437 // An implicit getter must have a specific AST structure. |
| 438 const SequenceNode& sequence_node = *parsed_function().node_sequence(); | 438 const SequenceNode& sequence_node = *parsed_function().node_sequence(); |
| 439 ASSERT(sequence_node.length() == 1); | 439 ASSERT(sequence_node.length() == 1); |
| 440 ASSERT(sequence_node.NodeAt(0)->IsReturnNode()); | 440 ASSERT(sequence_node.NodeAt(0)->IsReturnNode()); |
| 441 const ReturnNode& return_node = *sequence_node.NodeAt(0)->AsReturnNode(); | 441 const ReturnNode& return_node = *sequence_node.NodeAt(0)->AsReturnNode(); |
| 442 ASSERT(return_node.value()->IsLoadInstanceFieldNode()); | 442 ASSERT(return_node.value()->IsLoadInstanceFieldNode()); |
| 443 const LoadInstanceFieldNode& load_node = | 443 const LoadInstanceFieldNode& load_node = |
| 444 *return_node.value()->AsLoadInstanceFieldNode(); | 444 *return_node.value()->AsLoadInstanceFieldNode(); |
| 445 GenerateInlinedGetter(load_node.field().Offset()); | 445 GenerateInlinedGetter(load_node.field().Offset()); |
| 446 return true; | 446 return true; |
| 447 } | 447 } |
| 448 if ((parsed_function().function().kind() == RawFunction::kImplicitSetter)) { | 448 if (parsed_function().function().kind() == RawFunction::kImplicitSetter) { |
| 449 // An implicit setter must have a specific AST structure. | 449 // An implicit setter must have a specific AST structure. |
| 450 // Sequence node has one store node and one return NULL node. | 450 // Sequence node has one store node and one return NULL node. |
| 451 const SequenceNode& sequence_node = *parsed_function().node_sequence(); | 451 const SequenceNode& sequence_node = *parsed_function().node_sequence(); |
| 452 ASSERT(sequence_node.length() == 2); | 452 ASSERT(sequence_node.length() == 2); |
| 453 ASSERT(sequence_node.NodeAt(0)->IsStoreInstanceFieldNode()); | 453 ASSERT(sequence_node.NodeAt(0)->IsStoreInstanceFieldNode()); |
| 454 ASSERT(sequence_node.NodeAt(1)->IsReturnNode()); | 454 ASSERT(sequence_node.NodeAt(1)->IsReturnNode()); |
| 455 const StoreInstanceFieldNode& store_node = | 455 const StoreInstanceFieldNode& store_node = |
| 456 *sequence_node.NodeAt(0)->AsStoreInstanceFieldNode(); | 456 *sequence_node.NodeAt(0)->AsStoreInstanceFieldNode(); |
| 457 GenerateInlinedSetter(store_node.field().Offset()); | 457 GenerateInlinedSetter(store_node.field().Offset()); |
| 458 return true; | 458 return true; |
| (...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 950 ASSERT(Utils::IsInt(31, disp)); | 950 ASSERT(Utils::IsInt(31, disp)); |
| 951 return FieldAddress(array, disp); | 951 return FieldAddress(array, disp); |
| 952 } | 952 } |
| 953 default: | 953 default: |
| 954 UNIMPLEMENTED(); | 954 UNIMPLEMENTED(); |
| 955 return FieldAddress(SPREG, 0); | 955 return FieldAddress(SPREG, 0); |
| 956 } | 956 } |
| 957 } | 957 } |
| 958 | 958 |
| 959 } // namespace dart | 959 } // namespace dart |
| OLD | NEW |