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

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

Issue 23484020: Update handling of ambiguous name references (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 3 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
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 "platform/assert.h" 5 #include "platform/assert.h"
6 #include "vm/globals.h" 6 #include "vm/globals.h"
7 7
8 #include "vm/ast.h" 8 #include "vm/ast.h"
9 #include "vm/assembler.h" 9 #include "vm/assembler.h"
10 #include "vm/code_descriptors.h" 10 #include "vm/code_descriptors.h"
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 " var i = A.foo();" 216 " var i = A.foo();"
217 " Expect.equals(30, i);" 217 " Expect.equals(30, i);"
218 " }\n" 218 " }\n"
219 "}\n"; 219 "}\n";
220 // First setup the script and compile the script. 220 // First setup the script and compile the script.
221 TestCase::LoadTestScript(kScriptChars, native_resolver); 221 TestCase::LoadTestScript(kScriptChars, native_resolver);
222 EXPECT(ClassFinalizer::FinalizePendingClasses()); 222 EXPECT(ClassFinalizer::FinalizePendingClasses());
223 const String& name = String::Handle(String::New(TestCase::url())); 223 const String& name = String::Handle(String::New(TestCase::url()));
224 const Library& lib = Library::Handle(Library::LookupLibrary(name)); 224 const Library& lib = Library::Handle(Library::LookupLibrary(name));
225 EXPECT(!lib.IsNull()); 225 EXPECT(!lib.IsNull());
226 String& ambiguity_error_msg = String::Handle();
227 Class& cls = Class::Handle( 226 Class& cls = Class::Handle(
228 lib.LookupClass(String::Handle(Symbols::New("A")), &ambiguity_error_msg)); 227 lib.LookupClass(String::Handle(Symbols::New("A"))));
229 EXPECT(!cls.IsNull()); // No ambiguity error expected. 228 EXPECT(!cls.IsNull()); // No ambiguity error expected.
regis 2013/09/09 21:29:07 The comment is a bit cryptic now.
hausner 2013/09/09 21:52:08 Done.
230 229
231 // Now compile the two functions 'A.foo' and 'A.moo' 230 // Now compile the two functions 'A.foo' and 'A.moo'
232 String& function_moo_name = String::Handle(String::New("moo")); 231 String& function_moo_name = String::Handle(String::New("moo"));
233 Function& function_moo = 232 Function& function_moo =
234 Function::Handle(cls.LookupStaticFunction(function_moo_name)); 233 Function::Handle(cls.LookupStaticFunction(function_moo_name));
235 EXPECT(CompilerTest::TestCompileFunction(function_moo)); 234 EXPECT(CompilerTest::TestCompileFunction(function_moo));
236 EXPECT(function_moo.HasCode()); 235 EXPECT(function_moo.HasCode());
237 236
238 String& function_foo_name = String::Handle(String::New("foo")); 237 String& function_foo_name = String::Handle(String::New("foo"));
239 Function& function_foo = 238 Function& function_foo =
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 273
275 // Now invoke 'A.moo' and it will trigger a GC when the native function 274 // Now invoke 'A.moo' and it will trigger a GC when the native function
276 // is called, this should then cause the stack map of function 'A.foo' 275 // is called, this should then cause the stack map of function 'A.foo'
277 // to be traversed and the appropriate objects visited. 276 // to be traversed and the appropriate objects visited.
278 const Object& result = Object::Handle( 277 const Object& result = Object::Handle(
279 DartEntry::InvokeFunction(function_foo, Object::empty_array())); 278 DartEntry::InvokeFunction(function_foo, Object::empty_array()));
280 EXPECT(!result.IsError()); 279 EXPECT(!result.IsError());
281 } 280 }
282 281
283 } // namespace dart 282 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698