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) || \ | |
8 defined(TARGET_ARCH_X64) || \ | |
9 defined(TARGET_ARCH_ARM) | |
10 | |
11 #include "vm/ast.h" | 7 #include "vm/ast.h" |
12 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
13 #include "vm/class_finalizer.h" | 9 #include "vm/class_finalizer.h" |
14 #include "vm/code_generator.h" | 10 #include "vm/code_generator.h" |
15 #include "vm/compiler.h" | 11 #include "vm/compiler.h" |
16 #include "vm/dart_entry.h" | 12 #include "vm/dart_entry.h" |
17 #include "vm/native_entry.h" | 13 #include "vm/native_entry.h" |
18 #include "vm/native_entry_test.h" | 14 #include "vm/native_entry_test.h" |
19 #include "vm/symbols.h" | 15 #include "vm/symbols.h" |
20 #include "vm/unit_test.h" | 16 #include "vm/unit_test.h" |
(...skipping 10 matching lines...) Expand all Loading... |
31 CODEGEN_TEST_RUN(SimpleReturnCodegen, Instance::null()) | 27 CODEGEN_TEST_RUN(SimpleReturnCodegen, Instance::null()) |
32 | 28 |
33 | 29 |
34 CODEGEN_TEST_GENERATE(SmiReturnCodegen, test) { | 30 CODEGEN_TEST_GENERATE(SmiReturnCodegen, test) { |
35 LiteralNode* l = new LiteralNode(kPos, Smi::ZoneHandle(Smi::New(3))); | 31 LiteralNode* l = new LiteralNode(kPos, Smi::ZoneHandle(Smi::New(3))); |
36 test->node_sequence()->Add(new ReturnNode(kPos, l)); | 32 test->node_sequence()->Add(new ReturnNode(kPos, l)); |
37 } | 33 } |
38 CODEGEN_TEST_RUN(SmiReturnCodegen, Smi::New(3)) | 34 CODEGEN_TEST_RUN(SmiReturnCodegen, Smi::New(3)) |
39 | 35 |
40 | 36 |
| 37 #if defined(TARGET_ARCH_IA32) || \ |
| 38 defined(TARGET_ARCH_X64) || \ |
| 39 defined(TARGET_ARCH_ARM) |
| 40 |
| 41 |
41 CODEGEN_TEST2_GENERATE(SimpleStaticCallCodegen, function, test) { | 42 CODEGEN_TEST2_GENERATE(SimpleStaticCallCodegen, function, test) { |
42 // Wrap the SmiReturnCodegen test above as a static function and call it. | 43 // Wrap the SmiReturnCodegen test above as a static function and call it. |
43 ArgumentListNode* no_arguments = new ArgumentListNode(kPos); | 44 ArgumentListNode* no_arguments = new ArgumentListNode(kPos); |
44 test->node_sequence()->Add( | 45 test->node_sequence()->Add( |
45 new ReturnNode(kPos, new StaticCallNode(kPos, function, no_arguments))); | 46 new ReturnNode(kPos, new StaticCallNode(kPos, function, no_arguments))); |
46 } | 47 } |
47 CODEGEN_TEST2_RUN(SimpleStaticCallCodegen, SmiReturnCodegen, Smi::New(3)) | 48 CODEGEN_TEST2_RUN(SimpleStaticCallCodegen, SmiReturnCodegen, Smi::New(3)) |
48 | 49 |
49 | 50 |
50 #if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64) | 51 #if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64) |
(...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
560 Library& app_lib = Library::Handle(); | 561 Library& app_lib = Library::Handle(); |
561 app_lib ^= libs.At(num_libs - 1); | 562 app_lib ^= libs.At(num_libs - 1); |
562 ASSERT(!app_lib.IsNull()); | 563 ASSERT(!app_lib.IsNull()); |
563 const Class& cls = Class::Handle( | 564 const Class& cls = Class::Handle( |
564 app_lib.LookupClass(String::Handle(Symbols::New("A")))); | 565 app_lib.LookupClass(String::Handle(Symbols::New("A")))); |
565 EXPECT_EQ(cls.raw(), result.clazz()); | 566 EXPECT_EQ(cls.raw(), result.clazz()); |
566 } | 567 } |
567 | 568 |
568 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64) | 569 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64) |
569 | 570 |
| 571 #endif // defined(TARGET_ARCH_IA32) || ..._ARCH_X64) || ..._ARCH_ARM) |
| 572 |
570 } // namespace dart | 573 } // namespace dart |
571 | |
572 #endif // defined(TARGET_ARCH_IA32) || ..._ARCH_X64) || ..._ARCH_ARM) | |
OLD | NEW |