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 #if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64) | 7 #if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64) |
8 | 8 |
9 #include "vm/ast.h" | 9 #include "vm/ast.h" |
10 #include "vm/assembler.h" | 10 #include "vm/assembler.h" |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 " i = 10; s1 = 'abcd'; k = 20; s2 = 'B'; s3 = 'C';" | 162 " i = 10; s1 = 'abcd'; k = 20; s2 = 'B'; s3 = 'C';" |
163 " func(i, k);" | 163 " func(i, k);" |
164 " return i + k; }" | 164 " return i + k; }" |
165 " static int moo() {" | 165 " static int moo() {" |
166 " var i = A.foo();" | 166 " var i = A.foo();" |
167 " Expect.equals(30, i);" | 167 " Expect.equals(30, i);" |
168 " }\n" | 168 " }\n" |
169 "}\n"; | 169 "}\n"; |
170 // First setup the script and compile the script. | 170 // First setup the script and compile the script. |
171 TestCase::LoadTestScript(kScriptChars, native_resolver); | 171 TestCase::LoadTestScript(kScriptChars, native_resolver); |
| 172 EXPECT(ClassFinalizer::FinalizePendingClasses()); |
172 const String& name = String::Handle(String::New(TestCase::url())); | 173 const String& name = String::Handle(String::New(TestCase::url())); |
173 const Library& lib = Library::Handle(Library::LookupLibrary(name)); | 174 const Library& lib = Library::Handle(Library::LookupLibrary(name)); |
174 EXPECT(!lib.IsNull()); | 175 EXPECT(!lib.IsNull()); |
175 Class& cls = Class::Handle( | 176 Class& cls = Class::Handle( |
176 lib.LookupClass(String::Handle(String::NewSymbol("A")))); | 177 lib.LookupClass(String::Handle(String::NewSymbol("A")))); |
177 EXPECT(!cls.IsNull()); | 178 EXPECT(!cls.IsNull()); |
178 | 179 |
179 // Now compile the two functions 'A.foo' and 'A.moo' | 180 // Now compile the two functions 'A.foo' and 'A.moo' |
180 String& function_moo_name = String::Handle(String::New("moo")); | 181 String& function_moo_name = String::Handle(String::New("moo")); |
181 Function& function_moo = | 182 Function& function_moo = |
(...skipping 27 matching lines...) Expand all Loading... |
209 GrowableArray<const Object*> arguments; | 210 GrowableArray<const Object*> arguments; |
210 const Array& kNoArgumentNames = Array::Handle(); | 211 const Array& kNoArgumentNames = Array::Handle(); |
211 Object& result = Object::Handle(); | 212 Object& result = Object::Handle(); |
212 result = DartEntry::InvokeStatic(function_foo, arguments, kNoArgumentNames); | 213 result = DartEntry::InvokeStatic(function_foo, arguments, kNoArgumentNames); |
213 EXPECT(!result.IsError()); | 214 EXPECT(!result.IsError()); |
214 } | 215 } |
215 | 216 |
216 } // namespace dart | 217 } // namespace dart |
217 | 218 |
218 #endif // defined TARGET_ARCH_IA32 || defined(TARGET_ARCH_X64) | 219 #endif // defined TARGET_ARCH_IA32 || defined(TARGET_ARCH_X64) |
OLD | NEW |