| 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 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 UnaryOpNode* neg_node = new UnaryOpNode(kPos, Token::kSUB, a); | 261 UnaryOpNode* neg_node = new UnaryOpNode(kPos, Token::kSUB, a); |
| 262 node_seq->Add(new ReturnNode(kPos, neg_node)); | 262 node_seq->Add(new ReturnNode(kPos, neg_node)); |
| 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()); |
| 272 ASSERT(!core_lib.IsNull()); |
| 273 lib.AddImport(core_lib); |
| 271 return lib; | 274 return lib; |
| 272 } | 275 } |
| 273 | 276 |
| 274 | 277 |
| 275 static RawClass* LookupClass(const Library& lib, const char* name) { | 278 static RawClass* LookupClass(const Library& lib, const char* name) { |
| 276 const String& cls_name = String::ZoneHandle(Symbols::New(name)); | 279 const String& cls_name = String::ZoneHandle(Symbols::New(name)); |
| 277 return lib.LookupClass(cls_name); | 280 return lib.LookupClass(cls_name); |
| 278 } | 281 } |
| 279 | 282 |
| 280 | 283 |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 511 app_lib ^= libs.At(num_libs - 1); | 514 app_lib ^= libs.At(num_libs - 1); |
| 512 ASSERT(!app_lib.IsNull()); | 515 ASSERT(!app_lib.IsNull()); |
| 513 const Class& cls = Class::Handle( | 516 const Class& cls = Class::Handle( |
| 514 app_lib.LookupClass(String::Handle(Symbols::New("A")))); | 517 app_lib.LookupClass(String::Handle(Symbols::New("A")))); |
| 515 EXPECT_EQ(cls.raw(), result.clazz()); | 518 EXPECT_EQ(cls.raw(), result.clazz()); |
| 516 } | 519 } |
| 517 | 520 |
| 518 } // namespace dart | 521 } // namespace dart |
| 519 | 522 |
| 520 #endif // defined TARGET_ARCH_IA32 || defined(TARGET_ARCH_X64) | 523 #endif // defined TARGET_ARCH_IA32 || defined(TARGET_ARCH_X64) |
| OLD | NEW |