Chromium Code Reviews| 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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 112 ASSERT(context.isolate() == Isolate::Current()); | 112 ASSERT(context.isolate() == Isolate::Current()); |
| 113 const Code& code = Code::Handle(function.CurrentCode()); | 113 const Code& code = Code::Handle(function.CurrentCode()); |
| 114 ASSERT(!code.IsNull()); | 114 ASSERT(!code.IsNull()); |
| 115 const Array& arg_descriptor = | 115 const Array& arg_descriptor = |
| 116 Array::Handle(ArgumentsDescriptor::New(num_arguments, | 116 Array::Handle(ArgumentsDescriptor::New(num_arguments, |
| 117 optional_arguments_names)); | 117 optional_arguments_names)); |
| 118 return entrypoint(code.EntryPoint(), arg_descriptor, args.data(), context); | 118 return entrypoint(code.EntryPoint(), arg_descriptor, args.data(), context); |
| 119 } | 119 } |
| 120 | 120 |
| 121 | 121 |
| 122 ArgumentsDescriptor::ArgumentsDescriptor(RawObject* array) | 122 ArgumentsDescriptor::ArgumentsDescriptor(const Array& array) |
| 123 : array_(Array::CheckedHandle(array)) { | 123 : array_(array) { |
| 124 } | 124 } |
| 125 | 125 |
| 126 | 126 |
| 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 RawObject* ArgumentsDescriptor::NameAt(intptr_t index) const { | 137 RawString* ArgumentsDescriptor::NameAt(intptr_t index) const { |
| 138 return array_.At(kFirstNamedEntryIndex + | 138 String& result = String::Handle(); |
| 139 (index * kNamedEntrySize) + | 139 result ^= array_.At(kFirstNamedEntryIndex + |
| 140 kNameOffset); | 140 (index * kNamedEntrySize) + |
| 141 kNameOffset); | |
|
siva
2012/12/05 19:18:48
const String& result = String::CheckedHandle(array
srdjan
2012/12/05 19:30:07
Discussed, ignoring.
| |
| 142 return result.raw(); | |
| 141 } | 143 } |
| 142 | 144 |
| 143 | 145 |
| 144 intptr_t ArgumentsDescriptor::count_offset() { | 146 intptr_t ArgumentsDescriptor::count_offset() { |
| 145 return Array::data_offset() + (kCountIndex * kWordSize); | 147 return Array::data_offset() + (kCountIndex * kWordSize); |
| 146 } | 148 } |
| 147 | 149 |
| 148 | 150 |
| 149 intptr_t ArgumentsDescriptor::positional_count_offset() { | 151 intptr_t ArgumentsDescriptor::positional_count_offset() { |
| 150 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... | |
| 359 const String& func_name = String::Handle(Field::GetterName(field_name)); | 361 const String& func_name = String::Handle(Field::GetterName(field_name)); |
| 360 const Function& func = Function::Handle(cls.LookupDynamicFunction(func_name)); | 362 const Function& func = Function::Handle(cls.LookupDynamicFunction(func_name)); |
| 361 ASSERT(!func.IsNull()); | 363 ASSERT(!func.IsNull()); |
| 362 GrowableArray<const Object*> arguments; | 364 GrowableArray<const Object*> arguments; |
| 363 const Array& kNoArgumentNames = Array::Handle(); | 365 const Array& kNoArgumentNames = Array::Handle(); |
| 364 return DartEntry::InvokeDynamic(port, func, arguments, kNoArgumentNames); | 366 return DartEntry::InvokeDynamic(port, func, arguments, kNoArgumentNames); |
| 365 } | 367 } |
| 366 | 368 |
| 367 | 369 |
| 368 } // namespace dart | 370 } // namespace dart |
| OLD | NEW |