| 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) || \ | 7 #if defined(TARGET_ARCH_IA32) || \ |
| 8 defined(TARGET_ARCH_X64) || \ | 8 defined(TARGET_ARCH_X64) || \ |
| 9 defined(TARGET_ARCH_ARM) | 9 defined(TARGET_ARCH_ARM) |
| 10 | 10 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 | 24 |
| 25 static const intptr_t kPos = Scanner::kDummyTokenIndex; | 25 static const intptr_t kPos = Scanner::kDummyTokenIndex; |
| 26 | 26 |
| 27 | 27 |
| 28 CODEGEN_TEST_GENERATE(SimpleReturnCodegen, test) { | 28 CODEGEN_TEST_GENERATE(SimpleReturnCodegen, test) { |
| 29 test->node_sequence()->Add(new ReturnNode(kPos)); | 29 test->node_sequence()->Add(new ReturnNode(kPos)); |
| 30 } | 30 } |
| 31 CODEGEN_TEST_RUN(SimpleReturnCodegen, Instance::null()) | 31 CODEGEN_TEST_RUN(SimpleReturnCodegen, Instance::null()) |
| 32 | 32 |
| 33 | 33 |
| 34 #if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64) | |
| 35 | |
| 36 | |
| 37 CODEGEN_TEST_GENERATE(SmiReturnCodegen, test) { | 34 CODEGEN_TEST_GENERATE(SmiReturnCodegen, test) { |
| 38 LiteralNode* l = new LiteralNode(kPos, Smi::ZoneHandle(Smi::New(3))); | 35 LiteralNode* l = new LiteralNode(kPos, Smi::ZoneHandle(Smi::New(3))); |
| 39 test->node_sequence()->Add(new ReturnNode(kPos, l)); | 36 test->node_sequence()->Add(new ReturnNode(kPos, l)); |
| 40 } | 37 } |
| 41 CODEGEN_TEST_RUN(SmiReturnCodegen, Smi::New(3)) | 38 CODEGEN_TEST_RUN(SmiReturnCodegen, Smi::New(3)) |
| 42 | 39 |
| 43 | 40 |
| 44 CODEGEN_TEST2_GENERATE(SimpleStaticCallCodegen, function, test) { | 41 CODEGEN_TEST2_GENERATE(SimpleStaticCallCodegen, function, test) { |
| 45 // Wrap the SmiReturnCodegen test above as a static function and call it. | 42 // Wrap the SmiReturnCodegen test above as a static function and call it. |
| 46 ArgumentListNode* no_arguments = new ArgumentListNode(kPos); | 43 ArgumentListNode* no_arguments = new ArgumentListNode(kPos); |
| 47 test->node_sequence()->Add( | 44 test->node_sequence()->Add( |
| 48 new ReturnNode(kPos, new StaticCallNode(kPos, function, no_arguments))); | 45 new ReturnNode(kPos, new StaticCallNode(kPos, function, no_arguments))); |
| 49 } | 46 } |
| 50 CODEGEN_TEST2_RUN(SimpleStaticCallCodegen, SmiReturnCodegen, Smi::New(3)) | 47 CODEGEN_TEST2_RUN(SimpleStaticCallCodegen, SmiReturnCodegen, Smi::New(3)) |
| 51 | 48 |
| 52 | 49 |
| 50 #if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64) |
| 51 |
| 52 |
| 53 // Helper to allocate and return a LocalVariable. | 53 // Helper to allocate and return a LocalVariable. |
| 54 static LocalVariable* NewTestLocalVariable(const char* name) { | 54 static LocalVariable* NewTestLocalVariable(const char* name) { |
| 55 const String& variable_name = String::ZoneHandle(Symbols::New(name)); | 55 const String& variable_name = String::ZoneHandle(Symbols::New(name)); |
| 56 const Type& variable_type = Type::ZoneHandle(Type::DynamicType()); | 56 const Type& variable_type = Type::ZoneHandle(Type::DynamicType()); |
| 57 return new LocalVariable(kPos, variable_name, variable_type); | 57 return new LocalVariable(kPos, variable_name, variable_type); |
| 58 } | 58 } |
| 59 | 59 |
| 60 | 60 |
| 61 CODEGEN_TEST_GENERATE(ReturnParameterCodegen, test) { | 61 CODEGEN_TEST_GENERATE(ReturnParameterCodegen, test) { |
| 62 SequenceNode* node_seq = test->node_sequence(); | 62 SequenceNode* node_seq = test->node_sequence(); |
| (...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 563 const Class& cls = Class::Handle( | 563 const Class& cls = Class::Handle( |
| 564 app_lib.LookupClass(String::Handle(Symbols::New("A")))); | 564 app_lib.LookupClass(String::Handle(Symbols::New("A")))); |
| 565 EXPECT_EQ(cls.raw(), result.clazz()); | 565 EXPECT_EQ(cls.raw(), result.clazz()); |
| 566 } | 566 } |
| 567 | 567 |
| 568 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64) | 568 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64) |
| 569 | 569 |
| 570 } // namespace dart | 570 } // namespace dart |
| 571 | 571 |
| 572 #endif // defined(TARGET_ARCH_IA32) || ..._ARCH_X64) || ..._ARCH_ARM) | 572 #endif // defined(TARGET_ARCH_IA32) || ..._ARCH_X64) || ..._ARCH_ARM) |
| OLD | NEW |