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