OLD | NEW |
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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 "}\n"; | 214 "}\n"; |
215 // First setup the script and compile the script. | 215 // First setup the script and compile the script. |
216 TestCase::LoadTestScript(kScriptChars, native_resolver); | 216 TestCase::LoadTestScript(kScriptChars, native_resolver); |
217 TransitionNativeToVM transition(thread); | 217 TransitionNativeToVM transition(thread); |
218 | 218 |
219 EXPECT(ClassFinalizer::ProcessPendingClasses()); | 219 EXPECT(ClassFinalizer::ProcessPendingClasses()); |
220 const String& name = String::Handle(String::New(TestCase::url())); | 220 const String& name = String::Handle(String::New(TestCase::url())); |
221 const Library& lib = Library::Handle(Library::LookupLibrary(name)); | 221 const Library& lib = Library::Handle(Library::LookupLibrary(name)); |
222 EXPECT(!lib.IsNull()); | 222 EXPECT(!lib.IsNull()); |
223 Class& cls = Class::Handle( | 223 Class& cls = Class::Handle( |
224 lib.LookupClass(String::Handle(Symbols::New("A")))); | 224 lib.LookupClass(String::Handle(Symbols::New(thread, "A")))); |
225 EXPECT(!cls.IsNull()); | 225 EXPECT(!cls.IsNull()); |
226 | 226 |
227 // Now compile the two functions 'A.foo' and 'A.moo' | 227 // Now compile the two functions 'A.foo' and 'A.moo' |
228 String& function_moo_name = String::Handle(String::New("moo")); | 228 String& function_moo_name = String::Handle(String::New("moo")); |
229 Function& function_moo = | 229 Function& function_moo = |
230 Function::Handle(cls.LookupStaticFunction(function_moo_name)); | 230 Function::Handle(cls.LookupStaticFunction(function_moo_name)); |
231 EXPECT(CompilerTest::TestCompileFunction(function_moo)); | 231 EXPECT(CompilerTest::TestCompileFunction(function_moo)); |
232 EXPECT(function_moo.HasCode()); | 232 EXPECT(function_moo.HasCode()); |
233 | 233 |
234 String& function_foo_name = String::Handle(String::New("foo")); | 234 String& function_foo_name = String::Handle(String::New("foo")); |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 if (token_positions[i] != it.TokenPos().value()) { | 364 if (token_positions[i] != it.TokenPos().value()) { |
365 OS::Print("[%" Pd "]: Expected: %" Pd " != %" Pd "\n", | 365 OS::Print("[%" Pd "]: Expected: %" Pd " != %" Pd "\n", |
366 i, token_positions[i], it.TokenPos().value()); | 366 i, token_positions[i], it.TokenPos().value()); |
367 } | 367 } |
368 EXPECT(token_positions[i] == it.TokenPos().value()); | 368 EXPECT(token_positions[i] == it.TokenPos().value()); |
369 i++; | 369 i++; |
370 } | 370 } |
371 } | 371 } |
372 | 372 |
373 } // namespace dart | 373 } // namespace dart |
OLD | NEW |