| 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 1581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1592 node->function_name(), Token::kILLEGAL, arguments, | 1592 node->function_name(), Token::kILLEGAL, arguments, |
| 1593 node->arguments()->names(), 1); | 1593 node->arguments()->names(), 1); |
| 1594 ReturnDefinition(call); | 1594 ReturnDefinition(call); |
| 1595 } | 1595 } |
| 1596 | 1596 |
| 1597 | 1597 |
| 1598 // <Expression> ::= StaticCall { function: Function | 1598 // <Expression> ::= StaticCall { function: Function |
| 1599 // arguments: <ArgumentList> } | 1599 // arguments: <ArgumentList> } |
| 1600 void EffectGraphVisitor::VisitStaticCallNode(StaticCallNode* node) { | 1600 void EffectGraphVisitor::VisitStaticCallNode(StaticCallNode* node) { |
| 1601 if (node->function().name() == Symbols::Identical()) { | 1601 if (node->function().name() == Symbols::Identical()) { |
| 1602 // Attempt to replace identical with strcit equal early on. | 1602 // Attempt to replace top level defined 'identical' from the core |
| 1603 // library with strict equal early on. |
| 1603 // TODO(hausner): Evaluate if this can happen at AST building time. | 1604 // TODO(hausner): Evaluate if this can happen at AST building time. |
| 1604 const Class& cls = Class::Handle(node->function().Owner()); | 1605 const Class& cls = Class::Handle(node->function().Owner()); |
| 1605 if (cls.IsTopLevel()) { | 1606 if (cls.IsTopLevel()) { |
| 1606 const Library& core_lib = Library::Handle(Library::CoreLibrary()); | 1607 const Library& core_lib = Library::Handle(Library::CoreLibrary()); |
| 1607 if (cls.library() == core_lib.raw()) { | 1608 if (cls.library() == core_lib.raw()) { |
| 1608 ASSERT(node->arguments()->length() == 2); | 1609 ASSERT(node->arguments()->length() == 2); |
| 1609 ValueGraphVisitor for_left_value(owner(), temp_index(), loop_depth()); | 1610 ValueGraphVisitor for_left_value(owner(), temp_index(), loop_depth()); |
| 1610 node->arguments()->NodeAt(0)->Visit(&for_left_value); | 1611 node->arguments()->NodeAt(0)->Visit(&for_left_value); |
| 1611 Append(for_left_value); | 1612 Append(for_left_value); |
| 1612 ValueGraphVisitor for_right_value(owner(), temp_index(), loop_depth()); | 1613 ValueGraphVisitor for_right_value(owner(), temp_index(), loop_depth()); |
| (...skipping 1346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2959 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; | 2960 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; |
| 2960 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); | 2961 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); |
| 2961 OS::SNPrint(chars, len, kFormat, function_name, reason); | 2962 OS::SNPrint(chars, len, kFormat, function_name, reason); |
| 2962 const Error& error = Error::Handle( | 2963 const Error& error = Error::Handle( |
| 2963 LanguageError::New(String::Handle(String::New(chars)))); | 2964 LanguageError::New(String::Handle(String::New(chars)))); |
| 2964 Isolate::Current()->long_jump_base()->Jump(1, error); | 2965 Isolate::Current()->long_jump_base()->Jump(1, error); |
| 2965 } | 2966 } |
| 2966 | 2967 |
| 2967 | 2968 |
| 2968 } // namespace dart | 2969 } // namespace dart |
| OLD | NEW |