| 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 25 matching lines...) Expand all Loading... |
| 36 | 36 |
| 37 CODEGEN_TEST2_GENERATE(SimpleStaticCallCodegen, function, test) { | 37 CODEGEN_TEST2_GENERATE(SimpleStaticCallCodegen, function, test) { |
| 38 // 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. |
| 39 ArgumentListNode* no_arguments = new ArgumentListNode(kPos); | 39 ArgumentListNode* no_arguments = new ArgumentListNode(kPos); |
| 40 test->node_sequence()->Add( | 40 test->node_sequence()->Add( |
| 41 new ReturnNode(kPos, new StaticCallNode(kPos, function, no_arguments))); | 41 new ReturnNode(kPos, new StaticCallNode(kPos, function, no_arguments))); |
| 42 } | 42 } |
| 43 CODEGEN_TEST2_RUN(SimpleStaticCallCodegen, SmiReturnCodegen, Smi::New(3)) | 43 CODEGEN_TEST2_RUN(SimpleStaticCallCodegen, SmiReturnCodegen, Smi::New(3)) |
| 44 | 44 |
| 45 | 45 |
| 46 #if defined(TARGET_ARCH_IA32) || \ | |
| 47 defined(TARGET_ARCH_X64) || \ | |
| 48 defined(TARGET_ARCH_ARM) | |
| 49 | |
| 50 | |
| 51 // Helper to allocate and return a LocalVariable. | 46 // Helper to allocate and return a LocalVariable. |
| 52 static LocalVariable* NewTestLocalVariable(const char* name) { | 47 static LocalVariable* NewTestLocalVariable(const char* name) { |
| 53 const String& variable_name = String::ZoneHandle(Symbols::New(name)); | 48 const String& variable_name = String::ZoneHandle(Symbols::New(name)); |
| 54 const Type& variable_type = Type::ZoneHandle(Type::DynamicType()); | 49 const Type& variable_type = Type::ZoneHandle(Type::DynamicType()); |
| 55 return new LocalVariable(kPos, variable_name, variable_type); | 50 return new LocalVariable(kPos, variable_name, variable_type); |
| 56 } | 51 } |
| 57 | 52 |
| 58 | 53 |
| 59 CODEGEN_TEST_GENERATE(ReturnParameterCodegen, test) { | 54 CODEGEN_TEST_GENERATE(ReturnParameterCodegen, test) { |
| 60 SequenceNode* node_seq = test->node_sequence(); | 55 SequenceNode* node_seq = test->node_sequence(); |
| (...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 556 // App lib is the last one that was loaded. | 551 // App lib is the last one that was loaded. |
| 557 intptr_t num_libs = libs.Length(); | 552 intptr_t num_libs = libs.Length(); |
| 558 Library& app_lib = Library::Handle(); | 553 Library& app_lib = Library::Handle(); |
| 559 app_lib ^= libs.At(num_libs - 1); | 554 app_lib ^= libs.At(num_libs - 1); |
| 560 ASSERT(!app_lib.IsNull()); | 555 ASSERT(!app_lib.IsNull()); |
| 561 const Class& cls = Class::Handle( | 556 const Class& cls = Class::Handle( |
| 562 app_lib.LookupClass(String::Handle(Symbols::New("A")))); | 557 app_lib.LookupClass(String::Handle(Symbols::New("A")))); |
| 563 EXPECT_EQ(cls.raw(), result.clazz()); | 558 EXPECT_EQ(cls.raw(), result.clazz()); |
| 564 } | 559 } |
| 565 | 560 |
| 566 #endif // TARGET_ARCH_IA32 || TARGET_ARCH_X64 || TARGET_ARCH_ARM | |
| 567 | |
| 568 } // namespace dart | 561 } // namespace dart |
| OLD | NEW |