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