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 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 " i = 10; s1 = 'abcd'; k = 20; s2 = 'B'; s3 = 'C';" | 212 " i = 10; s1 = 'abcd'; k = 20; s2 = 'B'; s3 = 'C';" |
213 " func(i, k);" | 213 " func(i, k);" |
214 " return i + k; }" | 214 " return i + k; }" |
215 " static int moo() {" | 215 " static int moo() {" |
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::FinalizeTypeHierarchy()); |
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 Class& cls = Class::Handle( | 226 Class& cls = Class::Handle( |
227 lib.LookupClass(String::Handle(Symbols::New("A")))); | 227 lib.LookupClass(String::Handle(Symbols::New("A")))); |
228 EXPECT(!cls.IsNull()); | 228 EXPECT(!cls.IsNull()); |
229 | 229 |
230 // Now compile the two functions 'A.foo' and 'A.moo' | 230 // Now compile the two functions 'A.foo' and 'A.moo' |
231 String& function_moo_name = String::Handle(String::New("moo")); | 231 String& function_moo_name = String::Handle(String::New("moo")); |
232 Function& function_moo = | 232 Function& function_moo = |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 | 273 |
274 // 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 |
275 // 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' |
276 // to be traversed and the appropriate objects visited. | 276 // to be traversed and the appropriate objects visited. |
277 const Object& result = Object::Handle( | 277 const Object& result = Object::Handle( |
278 DartEntry::InvokeFunction(function_foo, Object::empty_array())); | 278 DartEntry::InvokeFunction(function_foo, Object::empty_array())); |
279 EXPECT(!result.IsError()); | 279 EXPECT(!result.IsError()); |
280 } | 280 } |
281 | 281 |
282 } // namespace dart | 282 } // namespace dart |
OLD | NEW |