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) || defined(TARGET_ARCH_X64) | 7 #if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64) |
8 | 8 |
9 #include "vm/ast.h" | 9 #include "vm/ast.h" |
10 #include "vm/assembler.h" | 10 #include "vm/assembler.h" |
11 #include "vm/code_descriptors.h" | 11 #include "vm/code_descriptors.h" |
12 #include "vm/compiler.h" | 12 #include "vm/compiler.h" |
13 #include "vm/dart_entry.h" | 13 #include "vm/dart_entry.h" |
14 #include "vm/native_entry.h" | 14 #include "vm/native_entry.h" |
15 #include "vm/parser.h" | 15 #include "vm/parser.h" |
16 #include "vm/symbols.h" | 16 #include "vm/symbols.h" |
17 #include "vm/unit_test.h" | 17 #include "vm/unit_test.h" |
18 | 18 |
19 namespace dart { | 19 namespace dart { |
20 | 20 |
21 static const intptr_t kPos = Scanner::kDummyTokenIndex; | 21 static const intptr_t kPos = Scanner::kDummyTokenIndex; |
22 | 22 |
23 | 23 |
24 CODEGEN_TEST_GENERATE(StackmapCodegen, test) { | 24 CODEGEN_TEST_GENERATE(StackmapCodegen, test) { |
25 Assembler assembler; | 25 Assembler assembler; |
26 const String& function_name = String::ZoneHandle(Symbols::New("test")); | 26 const String& function_name = String::ZoneHandle(Symbols::New("test")); |
27 const Function& function = Function::Handle( | 27 const Function& function = Function::Handle( |
28 Function::New(function_name, RawFunction::kRegularFunction, | 28 Function::New(function_name, RawFunction::kRegularFunction, |
29 true, false, 0)); | 29 true, false, false, 0)); |
30 function.set_result_type(Type::Handle(Type::DynamicType())); | 30 function.set_result_type(Type::Handle(Type::DynamicType())); |
31 Class& cls = Class::ZoneHandle(); | 31 Class& cls = Class::ZoneHandle(); |
32 const Script& script = Script::Handle(); | 32 const Script& script = Script::Handle(); |
33 cls = Class::New(function_name, script, Scanner::kDummyTokenIndex); | 33 cls = Class::New(function_name, script, Scanner::kDummyTokenIndex); |
34 const Array& functions = Array::Handle(Array::New(1)); | 34 const Array& functions = Array::Handle(Array::New(1)); |
35 functions.SetAt(0, function); | 35 functions.SetAt(0, function); |
36 cls.SetFunctions(functions); | 36 cls.SetFunctions(functions); |
37 Library& lib = Library::Handle(Library::CoreLibrary()); | 37 Library& lib = Library::Handle(Library::CoreLibrary()); |
38 lib.AddClass(cls); | 38 lib.AddClass(cls); |
39 ParsedFunction parsed_function(function); | 39 ParsedFunction parsed_function(function); |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 GrowableArray<const Object*> arguments; | 227 GrowableArray<const Object*> arguments; |
228 const Array& kNoArgumentNames = Array::Handle(); | 228 const Array& kNoArgumentNames = Array::Handle(); |
229 Object& result = Object::Handle(); | 229 Object& result = Object::Handle(); |
230 result = DartEntry::InvokeStatic(function_foo, arguments, kNoArgumentNames); | 230 result = DartEntry::InvokeStatic(function_foo, arguments, kNoArgumentNames); |
231 EXPECT(!result.IsError()); | 231 EXPECT(!result.IsError()); |
232 } | 232 } |
233 | 233 |
234 } // namespace dart | 234 } // namespace dart |
235 | 235 |
236 #endif // defined TARGET_ARCH_IA32 || defined(TARGET_ARCH_X64) | 236 #endif // defined TARGET_ARCH_IA32 || defined(TARGET_ARCH_X64) |
OLD | NEW |