| 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 1968 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1979 ReturnComputation(store); | 1979 ReturnComputation(store); |
| 1980 } | 1980 } |
| 1981 | 1981 |
| 1982 | 1982 |
| 1983 void EffectGraphVisitor::VisitLoadInstanceFieldNode( | 1983 void EffectGraphVisitor::VisitLoadInstanceFieldNode( |
| 1984 LoadInstanceFieldNode* node) { | 1984 LoadInstanceFieldNode* node) { |
| 1985 ValueGraphVisitor for_instance(owner(), temp_index()); | 1985 ValueGraphVisitor for_instance(owner(), temp_index()); |
| 1986 node->instance()->Visit(&for_instance); | 1986 node->instance()->Visit(&for_instance); |
| 1987 Append(for_instance); | 1987 Append(for_instance); |
| 1988 LoadInstanceFieldComp* load = new LoadInstanceFieldComp( | 1988 LoadInstanceFieldComp* load = new LoadInstanceFieldComp( |
| 1989 node->field(), for_instance.value(), NULL); // Can not deoptimize. | 1989 node->field(), for_instance.value()); |
| 1990 ReturnComputation(load); | 1990 ReturnComputation(load); |
| 1991 } | 1991 } |
| 1992 | 1992 |
| 1993 | 1993 |
| 1994 void EffectGraphVisitor::VisitStoreInstanceFieldNode( | 1994 void EffectGraphVisitor::VisitStoreInstanceFieldNode( |
| 1995 StoreInstanceFieldNode* node) { | 1995 StoreInstanceFieldNode* node) { |
| 1996 ValueGraphVisitor for_instance(owner(), temp_index()); | 1996 ValueGraphVisitor for_instance(owner(), temp_index()); |
| 1997 node->instance()->Visit(&for_instance); | 1997 node->instance()->Visit(&for_instance); |
| 1998 Append(for_instance); | 1998 Append(for_instance); |
| 1999 ValueGraphVisitor for_value(owner(), for_instance.temp_index()); | 1999 ValueGraphVisitor for_value(owner(), for_instance.temp_index()); |
| 2000 node->value()->Visit(&for_value); | 2000 node->value()->Visit(&for_value); |
| 2001 Append(for_value); | 2001 Append(for_value); |
| 2002 Value* store_value = for_value.value(); | 2002 Value* store_value = for_value.value(); |
| 2003 if (FLAG_enable_type_checks) { | 2003 if (FLAG_enable_type_checks) { |
| 2004 const AbstractType& type = AbstractType::ZoneHandle(node->field().type()); | 2004 const AbstractType& type = AbstractType::ZoneHandle(node->field().type()); |
| 2005 const String& dst_name = String::ZoneHandle(node->field().name()); | 2005 const String& dst_name = String::ZoneHandle(node->field().name()); |
| 2006 store_value = BuildAssignableValue(node->value()->token_pos(), | 2006 store_value = BuildAssignableValue(node->value()->token_pos(), |
| 2007 store_value, | 2007 store_value, |
| 2008 type, | 2008 type, |
| 2009 dst_name); | 2009 dst_name); |
| 2010 } | 2010 } |
| 2011 StoreInstanceFieldComp* store = new StoreInstanceFieldComp( | 2011 StoreInstanceFieldComp* store = new StoreInstanceFieldComp( |
| 2012 node->field(), for_instance.value(), store_value, NULL); | 2012 node->field(), for_instance.value(), store_value); |
| 2013 ReturnComputation(store); | 2013 ReturnComputation(store); |
| 2014 } | 2014 } |
| 2015 | 2015 |
| 2016 | 2016 |
| 2017 // StoreInstanceFieldNode does not return result. | 2017 // StoreInstanceFieldNode does not return result. |
| 2018 void ValueGraphVisitor::VisitStoreInstanceFieldNode( | 2018 void ValueGraphVisitor::VisitStoreInstanceFieldNode( |
| 2019 StoreInstanceFieldNode* node) { | 2019 StoreInstanceFieldNode* node) { |
| 2020 UNIMPLEMENTED(); | 2020 UNIMPLEMENTED(); |
| 2021 } | 2021 } |
| 2022 | 2022 |
| (...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2426 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; | 2426 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; |
| 2427 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); | 2427 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); |
| 2428 OS::SNPrint(chars, len, kFormat, function_name, reason); | 2428 OS::SNPrint(chars, len, kFormat, function_name, reason); |
| 2429 const Error& error = Error::Handle( | 2429 const Error& error = Error::Handle( |
| 2430 LanguageError::New(String::Handle(String::New(chars)))); | 2430 LanguageError::New(String::Handle(String::New(chars)))); |
| 2431 Isolate::Current()->long_jump_base()->Jump(1, error); | 2431 Isolate::Current()->long_jump_base()->Jump(1, error); |
| 2432 } | 2432 } |
| 2433 | 2433 |
| 2434 | 2434 |
| 2435 } // namespace dart | 2435 } // namespace dart |
| OLD | NEW |