| 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/code_descriptors.h" | 10 #include "vm/code_descriptors.h" |
| (...skipping 3094 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3105 | 3105 |
| 3106 | 3106 |
| 3107 // StoreInstanceFieldNode does not return result. | 3107 // StoreInstanceFieldNode does not return result. |
| 3108 void ValueGraphVisitor::VisitStoreInstanceFieldNode( | 3108 void ValueGraphVisitor::VisitStoreInstanceFieldNode( |
| 3109 StoreInstanceFieldNode* node) { | 3109 StoreInstanceFieldNode* node) { |
| 3110 UNIMPLEMENTED(); | 3110 UNIMPLEMENTED(); |
| 3111 } | 3111 } |
| 3112 | 3112 |
| 3113 | 3113 |
| 3114 void EffectGraphVisitor::VisitLoadStaticFieldNode(LoadStaticFieldNode* node) { | 3114 void EffectGraphVisitor::VisitLoadStaticFieldNode(LoadStaticFieldNode* node) { |
| 3115 if (node->field().is_const()) { |
| 3116 ASSERT(node->field().value() != Object::sentinel().raw()); |
| 3117 ASSERT(node->field().value() != Object::transition_sentinel().raw()); |
| 3118 Definition* result = |
| 3119 new ConstantInstr(Instance::ZoneHandle(node->field().value())); |
| 3120 return ReturnDefinition(result); |
| 3121 } |
| 3115 Value* field_value = Bind(new ConstantInstr(node->field())); | 3122 Value* field_value = Bind(new ConstantInstr(node->field())); |
| 3116 LoadStaticFieldInstr* load = new LoadStaticFieldInstr(field_value); | 3123 LoadStaticFieldInstr* load = new LoadStaticFieldInstr(field_value); |
| 3117 ReturnDefinition(load); | 3124 ReturnDefinition(load); |
| 3118 } | 3125 } |
| 3119 | 3126 |
| 3120 | 3127 |
| 3121 Definition* EffectGraphVisitor::BuildStoreStaticField( | 3128 Definition* EffectGraphVisitor::BuildStoreStaticField( |
| 3122 StoreStaticFieldNode* node, bool result_is_needed) { | 3129 StoreStaticFieldNode* node, bool result_is_needed) { |
| 3123 ValueGraphVisitor for_value(owner(), temp_index()); | 3130 ValueGraphVisitor for_value(owner(), temp_index()); |
| 3124 node->value()->Visit(&for_value); | 3131 node->value()->Visit(&for_value); |
| (...skipping 715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3840 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; | 3847 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; |
| 3841 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); | 3848 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); |
| 3842 OS::SNPrint(chars, len, kFormat, function_name, reason); | 3849 OS::SNPrint(chars, len, kFormat, function_name, reason); |
| 3843 const Error& error = Error::Handle( | 3850 const Error& error = Error::Handle( |
| 3844 LanguageError::New(String::Handle(String::New(chars)))); | 3851 LanguageError::New(String::Handle(String::New(chars)))); |
| 3845 Isolate::Current()->long_jump_base()->Jump(1, error); | 3852 Isolate::Current()->long_jump_base()->Jump(1, error); |
| 3846 } | 3853 } |
| 3847 | 3854 |
| 3848 | 3855 |
| 3849 } // namespace dart | 3856 } // namespace dart |
| OLD | NEW |