| 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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 bool ArgumentsDescriptor::MatchesNameAt(intptr_t index, | 169 bool ArgumentsDescriptor::MatchesNameAt(intptr_t index, |
| 170 const String& other) const { | 170 const String& other) const { |
| 171 const intptr_t offset = kFirstNamedEntryIndex + | 171 const intptr_t offset = kFirstNamedEntryIndex + |
| 172 (index * kNamedEntrySize) + | 172 (index * kNamedEntrySize) + |
| 173 kNameOffset; | 173 kNameOffset; |
| 174 return array_.At(offset) == other.raw(); | 174 return array_.At(offset) == other.raw(); |
| 175 } | 175 } |
| 176 | 176 |
| 177 | 177 |
| 178 intptr_t ArgumentsDescriptor::count_offset() { | 178 intptr_t ArgumentsDescriptor::count_offset() { |
| 179 return Array::data_offset() + (kCountIndex * kWordSize); | 179 return Array::element_offset(kCountIndex); |
| 180 } | 180 } |
| 181 | 181 |
| 182 | 182 |
| 183 intptr_t ArgumentsDescriptor::positional_count_offset() { | 183 intptr_t ArgumentsDescriptor::positional_count_offset() { |
| 184 return Array::data_offset() + (kPositionalCountIndex * kWordSize); | 184 return Array::element_offset(kPositionalCountIndex); |
| 185 } | 185 } |
| 186 | 186 |
| 187 | 187 |
| 188 intptr_t ArgumentsDescriptor::first_named_entry_offset() { | 188 intptr_t ArgumentsDescriptor::first_named_entry_offset() { |
| 189 return Array::data_offset() + (kFirstNamedEntryIndex * kWordSize); | 189 return Array::element_offset(kFirstNamedEntryIndex); |
| 190 } | 190 } |
| 191 | 191 |
| 192 | 192 |
| 193 RawArray* ArgumentsDescriptor::New(intptr_t num_arguments, | 193 RawArray* ArgumentsDescriptor::New(intptr_t num_arguments, |
| 194 const Array& optional_arguments_names) { | 194 const Array& optional_arguments_names) { |
| 195 const intptr_t num_named_args = | 195 const intptr_t num_named_args = |
| 196 optional_arguments_names.IsNull() ? 0 : optional_arguments_names.Length(); | 196 optional_arguments_names.IsNull() ? 0 : optional_arguments_names.Length(); |
| 197 if (num_named_args == 0) { | 197 if (num_named_args == 0) { |
| 198 return ArgumentsDescriptor::New(num_arguments); | 198 return ArgumentsDescriptor::New(num_arguments); |
| 199 } | 199 } |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 475 String::Handle(Field::GetterName(Symbols::_id())))); | 475 String::Handle(Field::GetterName(Symbols::_id())))); |
| 476 const Function& func = Function::Handle(cls.LookupDynamicFunction(func_name)); | 476 const Function& func = Function::Handle(cls.LookupDynamicFunction(func_name)); |
| 477 ASSERT(!func.IsNull()); | 477 ASSERT(!func.IsNull()); |
| 478 const Array& args = Array::Handle(Array::New(1)); | 478 const Array& args = Array::Handle(Array::New(1)); |
| 479 args.SetAt(0, port); | 479 args.SetAt(0, port); |
| 480 return DartEntry::InvokeFunction(func, args); | 480 return DartEntry::InvokeFunction(func, args); |
| 481 } | 481 } |
| 482 | 482 |
| 483 | 483 |
| 484 } // namespace dart | 484 } // namespace dart |
| OLD | NEW |