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 "vm/ast_printer.h" | 7 #include "vm/ast_printer.h" |
8 #include "vm/code_descriptors.h" | 8 #include "vm/code_descriptors.h" |
9 #include "vm/dart_entry.h" | 9 #include "vm/dart_entry.h" |
10 #include "vm/flags.h" | 10 #include "vm/flags.h" |
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
540 void EffectGraphVisitor::VisitLiteralNode(LiteralNode* node) { | 540 void EffectGraphVisitor::VisitLiteralNode(LiteralNode* node) { |
541 return; | 541 return; |
542 } | 542 } |
543 | 543 |
544 | 544 |
545 void ValueGraphVisitor::VisitLiteralNode(LiteralNode* node) { | 545 void ValueGraphVisitor::VisitLiteralNode(LiteralNode* node) { |
546 ReturnDefinition(new ConstantInstr(node->literal())); | 546 ReturnDefinition(new ConstantInstr(node->literal())); |
547 } | 547 } |
548 | 548 |
549 | 549 |
550 // Type nodes only occur as the right-hand side of instanceof comparisons, | 550 // Type nodes are used when a type is referenced as a literal. Type nodes |
551 // and they are handled specially in that context. | 551 // can also be used for the right-hand side of instanceof comparisons, |
552 void EffectGraphVisitor::VisitTypeNode(TypeNode* node) { UNREACHABLE(); } | 552 // but they are handled specially in that context, not here. |
| 553 void EffectGraphVisitor::VisitTypeNode(TypeNode* node) { |
| 554 return; |
| 555 } |
| 556 |
| 557 |
| 558 void ValueGraphVisitor::VisitTypeNode(TypeNode* node) { |
| 559 ReturnDefinition(new ConstantInstr(node->type())); |
| 560 } |
553 | 561 |
554 | 562 |
555 // Returns true if the type check can be skipped, for example, if the | 563 // Returns true if the type check can be skipped, for example, if the |
556 // destination type is dynamic or if the compile type of the value is a subtype | 564 // destination type is dynamic or if the compile type of the value is a subtype |
557 // of the destination type. | 565 // of the destination type. |
558 bool EffectGraphVisitor::CanSkipTypeCheck(intptr_t token_pos, | 566 bool EffectGraphVisitor::CanSkipTypeCheck(intptr_t token_pos, |
559 Value* value, | 567 Value* value, |
560 const AbstractType& dst_type, | 568 const AbstractType& dst_type, |
561 const String& dst_name) { | 569 const String& dst_name) { |
562 ASSERT(!dst_type.IsNull()); | 570 ASSERT(!dst_type.IsNull()); |
(...skipping 2447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3010 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; | 3018 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; |
3011 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); | 3019 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); |
3012 OS::SNPrint(chars, len, kFormat, function_name, reason); | 3020 OS::SNPrint(chars, len, kFormat, function_name, reason); |
3013 const Error& error = Error::Handle( | 3021 const Error& error = Error::Handle( |
3014 LanguageError::New(String::Handle(String::New(chars)))); | 3022 LanguageError::New(String::Handle(String::New(chars)))); |
3015 Isolate::Current()->long_jump_base()->Jump(1, error); | 3023 Isolate::Current()->long_jump_base()->Jump(1, error); |
3016 } | 3024 } |
3017 | 3025 |
3018 | 3026 |
3019 } // namespace dart | 3027 } // namespace dart |
OLD | NEW |