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 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 " Expect.equals(30, i);" | 219 " Expect.equals(30, i);" |
220 " }\n" | 220 " }\n" |
221 "}\n"; | 221 "}\n"; |
222 // First setup the script and compile the script. | 222 // First setup the script and compile the script. |
223 TestCase::LoadTestScript(kScriptChars, native_resolver); | 223 TestCase::LoadTestScript(kScriptChars, native_resolver); |
224 EXPECT(ClassFinalizer::FinalizePendingClasses()); | 224 EXPECT(ClassFinalizer::FinalizePendingClasses()); |
225 const String& name = String::Handle(String::New(TestCase::url())); | 225 const String& name = String::Handle(String::New(TestCase::url())); |
226 const Library& lib = Library::Handle(Library::LookupLibrary(name)); | 226 const Library& lib = Library::Handle(Library::LookupLibrary(name)); |
227 EXPECT(!lib.IsNull()); | 227 EXPECT(!lib.IsNull()); |
228 Class& cls = Class::Handle( | 228 Class& cls = Class::Handle( |
229 lib.LookupClass(String::Handle(Symbols::New("A")))); | 229 lib.LookupClass(String::Handle(Symbols::New("A")), NULL)); |
230 EXPECT(!cls.IsNull()); | 230 EXPECT(!cls.IsNull()); |
231 | 231 |
232 // Now compile the two functions 'A.foo' and 'A.moo' | 232 // Now compile the two functions 'A.foo' and 'A.moo' |
233 String& function_moo_name = String::Handle(String::New("moo")); | 233 String& function_moo_name = String::Handle(String::New("moo")); |
234 Function& function_moo = | 234 Function& function_moo = |
235 Function::Handle(cls.LookupStaticFunction(function_moo_name)); | 235 Function::Handle(cls.LookupStaticFunction(function_moo_name)); |
236 EXPECT(CompilerTest::TestCompileFunction(function_moo)); | 236 EXPECT(CompilerTest::TestCompileFunction(function_moo)); |
237 EXPECT(function_moo.HasCode()); | 237 EXPECT(function_moo.HasCode()); |
238 | 238 |
239 String& function_foo_name = String::Handle(String::New("foo")); | 239 String& function_foo_name = String::Handle(String::New("foo")); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 // Now invoke 'A.moo' and it will trigger a GC when the native function | 276 // Now invoke 'A.moo' and it will trigger a GC when the native function |
277 // is called, this should then cause the stack map of function 'A.foo' | 277 // is called, this should then cause the stack map of function 'A.foo' |
278 // to be traversed and the appropriate objects visited. | 278 // to be traversed and the appropriate objects visited. |
279 const Object& result = Object::Handle( | 279 const Object& result = Object::Handle( |
280 DartEntry::InvokeFunction(function_foo, Object::empty_array())); | 280 DartEntry::InvokeFunction(function_foo, Object::empty_array())); |
281 EXPECT(!result.IsError()); | 281 EXPECT(!result.IsError()); |
282 } | 282 } |
283 | 283 |
284 } // namespace dart | 284 } // namespace dart |
285 | 285 |
OLD | NEW |