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 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 " i = 10; s1 = 'abcd'; k = 20; s2 = 'B'; s3 = 'C';" | 191 " i = 10; s1 = 'abcd'; k = 20; s2 = 'B'; s3 = 'C';" |
192 " func(i, k);" | 192 " func(i, k);" |
193 " return i + k; }" | 193 " return i + k; }" |
194 " static int moo() {" | 194 " static int moo() {" |
195 " var i = A.foo();" | 195 " var i = A.foo();" |
196 " Expect.equals(30, i);" | 196 " Expect.equals(30, i);" |
197 " }\n" | 197 " }\n" |
198 "}\n"; | 198 "}\n"; |
199 // First setup the script and compile the script. | 199 // First setup the script and compile the script. |
200 TestCase::LoadTestScript(kScriptChars, native_resolver); | 200 TestCase::LoadTestScript(kScriptChars, native_resolver); |
201 EXPECT(ClassFinalizer::FinalizePendingClasses()); | 201 EXPECT(ClassFinalizer::FinalizeAllClasses()); |
202 const String& name = String::Handle(String::New(TestCase::url())); | 202 const String& name = String::Handle(String::New(TestCase::url())); |
203 const Library& lib = Library::Handle(Library::LookupLibrary(name)); | 203 const Library& lib = Library::Handle(Library::LookupLibrary(name)); |
204 EXPECT(!lib.IsNull()); | 204 EXPECT(!lib.IsNull()); |
205 Class& cls = Class::Handle( | 205 Class& cls = Class::Handle( |
206 lib.LookupClass(String::Handle(Symbols::New("A")))); | 206 lib.LookupClass(String::Handle(Symbols::New("A")))); |
207 EXPECT(!cls.IsNull()); | 207 EXPECT(!cls.IsNull()); |
208 | 208 |
209 // Now compile the two functions 'A.foo' and 'A.moo' | 209 // Now compile the two functions 'A.foo' and 'A.moo' |
210 String& function_moo_name = String::Handle(String::New("moo")); | 210 String& function_moo_name = String::Handle(String::New("moo")); |
211 Function& function_moo = | 211 Function& function_moo = |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 GrowableArray<const Object*> arguments; | 255 GrowableArray<const Object*> arguments; |
256 const Array& kNoArgumentNames = Array::Handle(); | 256 const Array& kNoArgumentNames = Array::Handle(); |
257 Object& result = Object::Handle(); | 257 Object& result = Object::Handle(); |
258 result = DartEntry::InvokeStatic(function_foo, arguments, kNoArgumentNames); | 258 result = DartEntry::InvokeStatic(function_foo, arguments, kNoArgumentNames); |
259 EXPECT(!result.IsError()); | 259 EXPECT(!result.IsError()); |
260 } | 260 } |
261 | 261 |
262 } // namespace dart | 262 } // namespace dart |
263 | 263 |
264 #endif // defined TARGET_ARCH_IA32 || defined(TARGET_ARCH_X64) | 264 #endif // defined TARGET_ARCH_IA32 || defined(TARGET_ARCH_X64) |
OLD | NEW |