| 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 | 7 |
| 8 #include "vm/ast.h" | 8 #include "vm/ast.h" |
| 9 #include "vm/assembler.h" | 9 #include "vm/assembler.h" |
| 10 #include "vm/code_descriptors.h" | 10 #include "vm/code_descriptors.h" |
| 11 #include "vm/compiler.h" | 11 #include "vm/compiler.h" |
| 12 #include "vm/dart_entry.h" | 12 #include "vm/dart_entry.h" |
| 13 #include "vm/native_entry.h" | 13 #include "vm/native_entry.h" |
| 14 #include "vm/parser.h" | 14 #include "vm/parser.h" |
| 15 #include "vm/symbols.h" | 15 #include "vm/symbols.h" |
| 16 #include "vm/unit_test.h" | 16 #include "vm/unit_test.h" |
| 17 | 17 |
| 18 namespace dart { | 18 namespace dart { |
| 19 | 19 |
| 20 #if defined(TARGET_ARCH_IA32) || \ | |
| 21 defined(TARGET_ARCH_X64) || \ | |
| 22 defined(TARGET_ARCH_ARM) | |
| 23 | |
| 24 static const intptr_t kPos = Scanner::kDummyTokenIndex; | 20 static const intptr_t kPos = Scanner::kDummyTokenIndex; |
| 25 | 21 |
| 26 | 22 |
| 27 CODEGEN_TEST_GENERATE(StackmapCodegen, test) { | 23 CODEGEN_TEST_GENERATE(StackmapCodegen, test) { |
| 28 Assembler assembler; | 24 Assembler assembler; |
| 29 const String& function_name = String::ZoneHandle(Symbols::New("test")); | 25 const String& function_name = String::ZoneHandle(Symbols::New("test")); |
| 30 Class& cls = Class::ZoneHandle(); | 26 Class& cls = Class::ZoneHandle(); |
| 31 const Script& script = Script::Handle(); | 27 const Script& script = Script::Handle(); |
| 32 cls = Class::New(function_name, script, Scanner::kDummyTokenIndex); | 28 cls = Class::New(function_name, script, Scanner::kDummyTokenIndex); |
| 33 const Function& function = Function::ZoneHandle( | 29 const Function& function = Function::ZoneHandle( |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 code.set_stackmaps(stack_maps); | 274 code.set_stackmaps(stack_maps); |
| 279 | 275 |
| 280 // Now invoke 'A.moo' and it will trigger a GC when the native function | 276 // Now invoke 'A.moo' and it will trigger a GC when the native function |
| 281 // is called, this should then cause the stack map of function 'A.foo' | 277 // is called, this should then cause the stack map of function 'A.foo' |
| 282 // to be traversed and the appropriate objects visited. | 278 // to be traversed and the appropriate objects visited. |
| 283 const Object& result = Object::Handle( | 279 const Object& result = Object::Handle( |
| 284 DartEntry::InvokeFunction(function_foo, Object::empty_array())); | 280 DartEntry::InvokeFunction(function_foo, Object::empty_array())); |
| 285 EXPECT(!result.IsError()); | 281 EXPECT(!result.IsError()); |
| 286 } | 282 } |
| 287 | 283 |
| 288 #endif // TARGET_ARCH_IA32 || TARGET_ARCH_X64 || TARGET_ARCH_ARM | |
| 289 | |
| 290 } // namespace dart | 284 } // namespace dart |
| 291 | 285 |
| OLD | NEW |