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 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 } | 263 } |
264 CODEGEN_TEST_RUN(DoubleUnaryOpCodegen, Double::New(-12.0)) | 264 CODEGEN_TEST_RUN(DoubleUnaryOpCodegen, Double::New(-12.0)) |
265 | 265 |
266 | 266 |
267 static Library& MakeTestLibrary(const char* url) { | 267 static Library& MakeTestLibrary(const char* url) { |
268 const String& lib_url = String::ZoneHandle(Symbols::New(url)); | 268 const String& lib_url = String::ZoneHandle(Symbols::New(url)); |
269 Library& lib = Library::ZoneHandle(Library::New(lib_url)); | 269 Library& lib = Library::ZoneHandle(Library::New(lib_url)); |
270 lib.Register(); | 270 lib.Register(); |
271 Library& core_lib = Library::Handle(Library::CoreLibrary()); | 271 Library& core_lib = Library::Handle(Library::CoreLibrary()); |
272 ASSERT(!core_lib.IsNull()); | 272 ASSERT(!core_lib.IsNull()); |
273 lib.AddImport(core_lib); | 273 const Namespace& core_ns = Namespace::Handle( |
| 274 Namespace::New(core_lib, Array::Handle(), Array::Handle())); |
| 275 lib.AddImport(core_ns); |
274 return lib; | 276 return lib; |
275 } | 277 } |
276 | 278 |
277 | 279 |
278 static RawClass* LookupClass(const Library& lib, const char* name) { | 280 static RawClass* LookupClass(const Library& lib, const char* name) { |
279 const String& cls_name = String::ZoneHandle(Symbols::New(name)); | 281 const String& cls_name = String::ZoneHandle(Symbols::New(name)); |
280 return lib.LookupClass(cls_name); | 282 return lib.LookupClass(cls_name); |
281 } | 283 } |
282 | 284 |
283 | 285 |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
514 app_lib ^= libs.At(num_libs - 1); | 516 app_lib ^= libs.At(num_libs - 1); |
515 ASSERT(!app_lib.IsNull()); | 517 ASSERT(!app_lib.IsNull()); |
516 const Class& cls = Class::Handle( | 518 const Class& cls = Class::Handle( |
517 app_lib.LookupClass(String::Handle(Symbols::New("A")))); | 519 app_lib.LookupClass(String::Handle(Symbols::New("A")))); |
518 EXPECT_EQ(cls.raw(), result.clazz()); | 520 EXPECT_EQ(cls.raw(), result.clazz()); |
519 } | 521 } |
520 | 522 |
521 } // namespace dart | 523 } // namespace dart |
522 | 524 |
523 #endif // defined TARGET_ARCH_IA32 || defined(TARGET_ARCH_X64) | 525 #endif // defined TARGET_ARCH_IA32 || defined(TARGET_ARCH_X64) |
OLD | NEW |