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/dart_entry.h" | 5 #include "vm/dart_entry.h" |
6 | 6 |
7 #include "vm/code_generator.h" | 7 #include "vm/code_generator.h" |
8 #include "vm/compiler.h" | 8 #include "vm/compiler.h" |
9 #include "vm/object_store.h" | 9 #include "vm/object_store.h" |
10 #include "vm/resolver.h" | 10 #include "vm/resolver.h" |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 intptr_t ArgumentsDescriptor::Count() const { | 127 intptr_t ArgumentsDescriptor::Count() const { |
128 return Smi::CheckedHandle(array_.At(kCountIndex)).Value(); | 128 return Smi::CheckedHandle(array_.At(kCountIndex)).Value(); |
129 } | 129 } |
130 | 130 |
131 | 131 |
132 intptr_t ArgumentsDescriptor::PositionalCount() const { | 132 intptr_t ArgumentsDescriptor::PositionalCount() const { |
133 return Smi::CheckedHandle(array_.At(kPositionalCountIndex)).Value(); | 133 return Smi::CheckedHandle(array_.At(kPositionalCountIndex)).Value(); |
134 } | 134 } |
135 | 135 |
136 | 136 |
137 RawString* ArgumentsDescriptor::NameAt(intptr_t index) const { | 137 bool ArgumentsDescriptor::MatchesNameAt(intptr_t index, |
138 String& result = String::Handle(); | 138 const String& other) const { |
139 result ^= array_.At(kFirstNamedEntryIndex + | 139 const intptr_t offset = kFirstNamedEntryIndex + |
140 (index * kNamedEntrySize) + | 140 (index * kNamedEntrySize) + |
141 kNameOffset); | 141 kNameOffset; |
142 return result.raw(); | 142 return array_.At(offset) == other.raw(); |
143 } | 143 } |
144 | 144 |
145 | 145 |
146 intptr_t ArgumentsDescriptor::count_offset() { | 146 intptr_t ArgumentsDescriptor::count_offset() { |
147 return Array::data_offset() + (kCountIndex * kWordSize); | 147 return Array::data_offset() + (kCountIndex * kWordSize); |
148 } | 148 } |
149 | 149 |
150 | 150 |
151 intptr_t ArgumentsDescriptor::positional_count_offset() { | 151 intptr_t ArgumentsDescriptor::positional_count_offset() { |
152 return Array::data_offset() + (kPositionalCountIndex * kWordSize); | 152 return Array::data_offset() + (kPositionalCountIndex * kWordSize); |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 const String& func_name = String::Handle(Field::GetterName(field_name)); | 361 const String& func_name = String::Handle(Field::GetterName(field_name)); |
362 const Function& func = Function::Handle(cls.LookupDynamicFunction(func_name)); | 362 const Function& func = Function::Handle(cls.LookupDynamicFunction(func_name)); |
363 ASSERT(!func.IsNull()); | 363 ASSERT(!func.IsNull()); |
364 GrowableArray<const Object*> arguments; | 364 GrowableArray<const Object*> arguments; |
365 const Array& kNoArgumentNames = Array::Handle(); | 365 const Array& kNoArgumentNames = Array::Handle(); |
366 return DartEntry::InvokeDynamic(port, func, arguments, kNoArgumentNames); | 366 return DartEntry::InvokeDynamic(port, func, arguments, kNoArgumentNames); |
367 } | 367 } |
368 | 368 |
369 | 369 |
370 } // namespace dart | 370 } // namespace dart |
OLD | NEW |