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/globals.h" | 5 #include "platform/globals.h" |
6 | 6 |
7 #include "platform/assert.h" | 7 #include "platform/assert.h" |
8 #include "vm/globals.h" | 8 #include "vm/globals.h" |
9 #include "vm/ast.h" | 9 #include "vm/ast.h" |
10 #include "vm/assembler.h" | 10 #include "vm/assembler.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 | 38 |
39 CODEGEN_TEST2_GENERATE(SimpleStaticCallCodegen, function, test) { | 39 CODEGEN_TEST2_GENERATE(SimpleStaticCallCodegen, function, test) { |
40 // Wrap the SmiReturnCodegen test above as a static function and call it. | 40 // Wrap the SmiReturnCodegen test above as a static function and call it. |
41 ArgumentListNode* no_arguments = new ArgumentListNode(kPos); | 41 ArgumentListNode* no_arguments = new ArgumentListNode(kPos); |
42 test->node_sequence()->Add( | 42 test->node_sequence()->Add( |
43 new ReturnNode(kPos, new StaticCallNode(kPos, function, no_arguments))); | 43 new ReturnNode(kPos, new StaticCallNode(kPos, function, no_arguments))); |
44 } | 44 } |
45 CODEGEN_TEST2_RUN(SimpleStaticCallCodegen, SmiReturnCodegen, Smi::New(3)) | 45 CODEGEN_TEST2_RUN(SimpleStaticCallCodegen, SmiReturnCodegen, Smi::New(3)) |
46 | 46 |
47 | 47 |
48 // TODO(zra): Remove when tests are ready to enable. | |
49 #if !defined(TARGET_ARCH_ARM64) | |
50 | |
51 // Helper to allocate and return a LocalVariable. | 48 // Helper to allocate and return a LocalVariable. |
52 static LocalVariable* NewTestLocalVariable(const char* name) { | 49 static LocalVariable* NewTestLocalVariable(const char* name) { |
53 const String& variable_name = String::ZoneHandle(Symbols::New(name)); | 50 const String& variable_name = String::ZoneHandle(Symbols::New(name)); |
54 const Type& variable_type = Type::ZoneHandle(Type::DynamicType()); | 51 const Type& variable_type = Type::ZoneHandle(Type::DynamicType()); |
55 return new LocalVariable(kPos, variable_name, variable_type); | 52 return new LocalVariable(kPos, variable_name, variable_type); |
56 } | 53 } |
57 | 54 |
58 | 55 |
59 CODEGEN_TEST_GENERATE(ReturnParameterCodegen, test) { | 56 CODEGEN_TEST_GENERATE(ReturnParameterCodegen, test) { |
60 SequenceNode* node_seq = test->node_sequence(); | 57 SequenceNode* node_seq = test->node_sequence(); |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 arguments->Add(new LiteralNode(kPos, Smi::ZoneHandle(Smi::New(3)))); | 111 arguments->Add(new LiteralNode(kPos, Smi::ZoneHandle(Smi::New(3)))); |
115 arguments->Add(new LiteralNode(kPos, Smi::ZoneHandle(Smi::New(2)))); | 112 arguments->Add(new LiteralNode(kPos, Smi::ZoneHandle(Smi::New(2)))); |
116 node_seq->Add(new ReturnNode(kPos, | 113 node_seq->Add(new ReturnNode(kPos, |
117 new StaticCallNode(kPos, function, arguments))); | 114 new StaticCallNode(kPos, function, arguments))); |
118 } | 115 } |
119 CODEGEN_TEST2_RUN(StaticCallSmiParamSumCodegen, | 116 CODEGEN_TEST2_RUN(StaticCallSmiParamSumCodegen, |
120 SmiParamSumCodegen, | 117 SmiParamSumCodegen, |
121 Smi::New(5)) | 118 Smi::New(5)) |
122 | 119 |
123 | 120 |
| 121 // TODO(zra): Remove when tests are ready to enable. |
| 122 #if !defined(TARGET_ARCH_ARM64) |
| 123 |
124 CODEGEN_TEST_GENERATE(SmiAddCodegen, test) { | 124 CODEGEN_TEST_GENERATE(SmiAddCodegen, test) { |
125 SequenceNode* node_seq = test->node_sequence(); | 125 SequenceNode* node_seq = test->node_sequence(); |
126 LiteralNode* a = new LiteralNode(kPos, Smi::ZoneHandle(Smi::New(3))); | 126 LiteralNode* a = new LiteralNode(kPos, Smi::ZoneHandle(Smi::New(3))); |
127 LiteralNode* b = new LiteralNode(kPos, Smi::ZoneHandle(Smi::New(2))); | 127 LiteralNode* b = new LiteralNode(kPos, Smi::ZoneHandle(Smi::New(2))); |
128 BinaryOpNode* add_node = new BinaryOpNode(kPos, Token::kADD, a, b); | 128 BinaryOpNode* add_node = new BinaryOpNode(kPos, Token::kADD, a, b); |
129 node_seq->Add(new ReturnNode(kPos, add_node)); | 129 node_seq->Add(new ReturnNode(kPos, add_node)); |
130 } | 130 } |
131 CODEGEN_TEST_RUN(SmiAddCodegen, Smi::New(5)) | 131 CODEGEN_TEST_RUN(SmiAddCodegen, Smi::New(5)) |
132 | 132 |
133 | 133 |
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
566 app_lib ^= libs.At(num_libs - 1); | 566 app_lib ^= libs.At(num_libs - 1); |
567 ASSERT(!app_lib.IsNull()); | 567 ASSERT(!app_lib.IsNull()); |
568 const Class& cls = Class::Handle( | 568 const Class& cls = Class::Handle( |
569 app_lib.LookupClass(String::Handle(Symbols::New("A")))); | 569 app_lib.LookupClass(String::Handle(Symbols::New("A")))); |
570 EXPECT_EQ(cls.raw(), result.clazz()); | 570 EXPECT_EQ(cls.raw(), result.clazz()); |
571 } | 571 } |
572 | 572 |
573 #endif // !defined(TARGET_ARCH_ARM64) | 573 #endif // !defined(TARGET_ARCH_ARM64) |
574 | 574 |
575 } // namespace dart | 575 } // namespace dart |
OLD | NEW |