OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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/resolver.h" | 5 #include "vm/resolver.h" |
6 | 6 |
7 #include "vm/dart_entry.h" | 7 #include "vm/dart_entry.h" |
8 #include "vm/flags.h" | 8 #include "vm/flags.h" |
9 #include "vm/isolate.h" | 9 #include "vm/isolate.h" |
10 #include "vm/object.h" | 10 #include "vm/object.h" |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 function_name.ToCString(), | 109 function_name.ToCString(), |
110 String::Handle(cls.Name()).ToCString()); | 110 String::Handle(cls.Name()).ToCString()); |
111 } | 111 } |
112 | 112 |
113 const bool is_getter = Field::IsGetterName(function_name); | 113 const bool is_getter = Field::IsGetterName(function_name); |
114 String& field_name = String::Handle(); | 114 String& field_name = String::Handle(); |
115 if (is_getter) { | 115 if (is_getter) { |
116 field_name ^= Field::NameFromGetter(function_name); | 116 field_name ^= Field::NameFromGetter(function_name); |
117 | 117 |
118 if (field_name.CharAt(0) == '#') { | 118 if (field_name.CharAt(0) == '#') { |
| 119 if (!FLAG_lazy_dispatchers) { |
| 120 return Function::null(); |
| 121 } |
| 122 |
119 // Resolving a getter "get:#..." is a request to closurize an instance | 123 // Resolving a getter "get:#..." is a request to closurize an instance |
120 // property of the receiver object. It can be of the form: | 124 // property of the receiver object. It can be of the form: |
121 // - get:#id, which closurizes a method or getter id | 125 // - get:#id, which closurizes a method or getter id |
122 // - get:#set:id, which closurizes a setter id | 126 // - get:#set:id, which closurizes a setter id |
123 // - get:#operator, eg. get:#<<, which closurizes an operator method. | 127 // - get:#operator, eg. get:#<<, which closurizes an operator method. |
124 // If the property can be resolved, a method extractor function | 128 // If the property can be resolved, a method extractor function |
125 // "get:#..." is created and injected into the receiver's class. | 129 // "get:#..." is created and injected into the receiver's class. |
126 String& property_name = String::Handle(String::SubString(field_name, 1)); | 130 String& property_name = String::Handle(String::SubString(field_name, 1)); |
127 ASSERT(!Field::IsGetterName(property_name)); | 131 ASSERT(!Field::IsGetterName(property_name)); |
128 | 132 |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 OS::Print("ResolveStaticAllowPrivate error '%s': %s.\n", | 292 OS::Print("ResolveStaticAllowPrivate error '%s': %s.\n", |
289 function_name.ToCString(), | 293 function_name.ToCString(), |
290 error_message.ToCString()); | 294 error_message.ToCString()); |
291 } | 295 } |
292 return Function::null(); | 296 return Function::null(); |
293 } | 297 } |
294 return function.raw(); | 298 return function.raw(); |
295 } | 299 } |
296 | 300 |
297 } // namespace dart | 301 } // namespace dart |
OLD | NEW |