OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 <map> | 5 #include <map> |
6 #include <set> | 6 #include <set> |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "vm/kernel_to_il.h" | 9 #include "vm/kernel_to_il.h" |
10 | 10 |
(...skipping 4478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4489 fragment_ = instructions; | 4489 fragment_ = instructions; |
4490 } | 4490 } |
4491 | 4491 |
4492 | 4492 |
4493 void FlowGraphBuilder::VisitStaticGet(StaticGet* node) { | 4493 void FlowGraphBuilder::VisitStaticGet(StaticGet* node) { |
4494 Member* target = node->target(); | 4494 Member* target = node->target(); |
4495 if (target->IsField()) { | 4495 if (target->IsField()) { |
4496 Field* kernel_field = Field::Cast(target); | 4496 Field* kernel_field = Field::Cast(target); |
4497 const dart::Field& field = | 4497 const dart::Field& field = |
4498 dart::Field::ZoneHandle(Z, H.LookupFieldByKernelField(kernel_field)); | 4498 dart::Field::ZoneHandle(Z, H.LookupFieldByKernelField(kernel_field)); |
4499 if (kernel_field->IsConst()) { | 4499 if (field.is_const()) { |
4500 fragment_ = Constant(constant_evaluator_.EvaluateExpression(node)); | 4500 fragment_ = Constant(constant_evaluator_.EvaluateExpression(node)); |
4501 } else { | 4501 } else { |
4502 const dart::Class& owner = dart::Class::Handle(Z, field.Owner()); | 4502 const dart::Class& owner = dart::Class::Handle(Z, field.Owner()); |
4503 const dart::String& getter_name = H.DartGetterName(kernel_field->name()); | 4503 const dart::String& getter_name = H.DartGetterName(kernel_field->name()); |
4504 const Function& getter = | 4504 const Function& getter = |
4505 Function::ZoneHandle(Z, owner.LookupStaticFunction(getter_name)); | 4505 Function::ZoneHandle(Z, owner.LookupStaticFunction(getter_name)); |
4506 if (getter.IsNull() || !field.has_initializer()) { | 4506 if (getter.IsNull() || !field.has_initializer()) { |
4507 Fragment instructions = Constant(field); | 4507 Fragment instructions = Constant(field); |
4508 fragment_ = instructions + LoadStaticField(); | 4508 fragment_ = instructions + LoadStaticField(); |
4509 } else { | 4509 } else { |
(...skipping 1770 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6280 thread->clear_sticky_error(); | 6280 thread->clear_sticky_error(); |
6281 return error.raw(); | 6281 return error.raw(); |
6282 } | 6282 } |
6283 } | 6283 } |
6284 | 6284 |
6285 | 6285 |
6286 } // namespace kernel | 6286 } // namespace kernel |
6287 } // namespace dart | 6287 } // namespace dart |
6288 | 6288 |
6289 #endif // !defined(DART_PRECOMPILED_RUNTIME) | 6289 #endif // !defined(DART_PRECOMPILED_RUNTIME) |
OLD | NEW |