| 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 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 "class A {\n" | 276 "class A {\n" |
| 277 " static bar() { return 42; }\n" | 277 " static bar() { return 42; }\n" |
| 278 " static fly() { return 5; }\n" | 278 " static fly() { return 5; }\n" |
| 279 "}\n"; | 279 "}\n"; |
| 280 | 280 |
| 281 String& url = String::Handle(String::New("dart-test:CompileScript")); | 281 String& url = String::Handle(String::New("dart-test:CompileScript")); |
| 282 String& source = String::Handle(String::New(kScriptChars)); | 282 String& source = String::Handle(String::New(kScriptChars)); |
| 283 Script& script = Script::Handle(Script::New(url, source, RawScript::kSource)); | 283 Script& script = Script::Handle(Script::New(url, source, RawScript::kSource)); |
| 284 Library& lib = MakeTestLibrary("TestLib"); | 284 Library& lib = MakeTestLibrary("TestLib"); |
| 285 EXPECT(CompilerTest::TestCompileScript(lib, script)); | 285 EXPECT(CompilerTest::TestCompileScript(lib, script)); |
| 286 EXPECT(ClassFinalizer::FinalizePendingClasses()); |
| 286 Class& cls = Class::Handle(LookupClass(lib, "A")); | 287 Class& cls = Class::Handle(LookupClass(lib, "A")); |
| 287 EXPECT(!cls.IsNull()); | 288 EXPECT(!cls.IsNull()); |
| 288 | 289 |
| 289 // 'bar' will not be compiled. | 290 // 'bar' will not be compiled. |
| 290 String& function_bar_name = String::Handle(String::New("bar")); | 291 String& function_bar_name = String::Handle(String::New("bar")); |
| 291 Function& function_bar = | 292 Function& function_bar = |
| 292 Function::ZoneHandle(cls.LookupStaticFunction(function_bar_name)); | 293 Function::ZoneHandle(cls.LookupStaticFunction(function_bar_name)); |
| 293 EXPECT(!function_bar.IsNull()); | 294 EXPECT(!function_bar.IsNull()); |
| 294 EXPECT(!function_bar.HasCode()); | 295 EXPECT(!function_bar.HasCode()); |
| 295 | 296 |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 488 const Library& app_lib = Library::Handle( | 489 const Library& app_lib = Library::Handle( |
| 489 Isolate::Current()->object_store()->registered_libraries()); | 490 Isolate::Current()->object_store()->registered_libraries()); |
| 490 const Class& cls = Class::Handle( | 491 const Class& cls = Class::Handle( |
| 491 app_lib.LookupClass(String::Handle(String::NewSymbol("A")))); | 492 app_lib.LookupClass(String::Handle(String::NewSymbol("A")))); |
| 492 EXPECT_EQ(cls.raw(), result.clazz()); | 493 EXPECT_EQ(cls.raw(), result.clazz()); |
| 493 } | 494 } |
| 494 | 495 |
| 495 } // namespace dart | 496 } // namespace dart |
| 496 | 497 |
| 497 #endif // defined TARGET_ARCH_IA32 || defined(TARGET_ARCH_X64) | 498 #endif // defined TARGET_ARCH_IA32 || defined(TARGET_ARCH_X64) |
| OLD | NEW |