Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(604)

Side by Side Diff: runtime/vm/dart_entry.cc

Issue 18209024: Correct handling of named optional parameters with noSuchMethod invocations. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/dart_entry.h ('k') | runtime/vm/flow_graph_compiler_arm.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/debugger.h" 9 #include "vm/debugger.h"
10 #include "vm/object_store.h" 10 #include "vm/object_store.h"
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 intptr_t ArgumentsDescriptor::Count() const { 160 intptr_t ArgumentsDescriptor::Count() const {
161 return Smi::CheckedHandle(array_.At(kCountIndex)).Value(); 161 return Smi::CheckedHandle(array_.At(kCountIndex)).Value();
162 } 162 }
163 163
164 164
165 intptr_t ArgumentsDescriptor::PositionalCount() const { 165 intptr_t ArgumentsDescriptor::PositionalCount() const {
166 return Smi::CheckedHandle(array_.At(kPositionalCountIndex)).Value(); 166 return Smi::CheckedHandle(array_.At(kPositionalCountIndex)).Value();
167 } 167 }
168 168
169 169
170 RawString* ArgumentsDescriptor::NameAt(intptr_t index) const {
171 const intptr_t offset = kFirstNamedEntryIndex +
172 (index * kNamedEntrySize) +
173 kNameOffset;
174 String& result = String::Handle();
175 result ^= array_.At(offset);
176 return result.raw();
177 }
178
179
170 bool ArgumentsDescriptor::MatchesNameAt(intptr_t index, 180 bool ArgumentsDescriptor::MatchesNameAt(intptr_t index,
171 const String& other) const { 181 const String& other) const {
172 const intptr_t offset = kFirstNamedEntryIndex + 182 const intptr_t offset = kFirstNamedEntryIndex +
173 (index * kNamedEntrySize) + 183 (index * kNamedEntrySize) +
174 kNameOffset; 184 kNameOffset;
175 return array_.At(offset) == other.raw(); 185 return array_.At(offset) == other.raw();
srdjan 2013/07/10 23:29:04 Reuse NameAt here
Florian Schneider 2013/07/11 09:21:23 Done.
176 } 186 }
177 187
178 188
179 intptr_t ArgumentsDescriptor::count_offset() { 189 intptr_t ArgumentsDescriptor::count_offset() {
180 return Array::element_offset(kCountIndex); 190 return Array::element_offset(kCountIndex);
181 } 191 }
182 192
183 193
184 intptr_t ArgumentsDescriptor::positional_count_offset() { 194 intptr_t ArgumentsDescriptor::positional_count_offset() {
185 return Array::element_offset(kPositionalCountIndex); 195 return Array::element_offset(kPositionalCountIndex);
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
484 String::Handle(Field::GetterName(Symbols::_id())))); 494 String::Handle(Field::GetterName(Symbols::_id()))));
485 const Function& func = Function::Handle(cls.LookupDynamicFunction(func_name)); 495 const Function& func = Function::Handle(cls.LookupDynamicFunction(func_name));
486 ASSERT(!func.IsNull()); 496 ASSERT(!func.IsNull());
487 const Array& args = Array::Handle(Array::New(1)); 497 const Array& args = Array::Handle(Array::New(1));
488 args.SetAt(0, port); 498 args.SetAt(0, port);
489 return DartEntry::InvokeFunction(func, args); 499 return DartEntry::InvokeFunction(func, args);
490 } 500 }
491 501
492 502
493 } // namespace dart 503 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/dart_entry.h ('k') | runtime/vm/flow_graph_compiler_arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698