| 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/thread.h" |
| 16 #include "vm/unit_test.h" | 17 #include "vm/unit_test.h" |
| 17 | 18 |
| 18 namespace dart { | 19 namespace dart { |
| 19 | 20 |
| 20 static const intptr_t kPos = Scanner::kNoSourcePos; | 21 static const intptr_t kPos = Scanner::kNoSourcePos; |
| 21 | 22 |
| 22 | 23 |
| 23 CODEGEN_TEST_GENERATE(StackmapCodegen, test) { | 24 CODEGEN_TEST_GENERATE(StackmapCodegen, test) { |
| 24 ParsedFunction* parsed_function = | 25 ParsedFunction* parsed_function = |
| 25 new ParsedFunction(Isolate::Current(), test->function()); | 26 new ParsedFunction(Thread::Current(), test->function()); |
| 26 LiteralNode* l = new LiteralNode(kPos, Smi::ZoneHandle(Smi::New(1))); | 27 LiteralNode* l = new LiteralNode(kPos, Smi::ZoneHandle(Smi::New(1))); |
| 27 test->node_sequence()->Add(new ReturnNode(kPos, l)); | 28 test->node_sequence()->Add(new ReturnNode(kPos, l)); |
| 28 l = new LiteralNode(kPos, Smi::ZoneHandle(Smi::New(2))); | 29 l = new LiteralNode(kPos, Smi::ZoneHandle(Smi::New(2))); |
| 29 test->node_sequence()->Add(new ReturnNode(kPos, l)); | 30 test->node_sequence()->Add(new ReturnNode(kPos, l)); |
| 30 l = new LiteralNode(kPos, Smi::ZoneHandle(Smi::New(3))); | 31 l = new LiteralNode(kPos, Smi::ZoneHandle(Smi::New(3))); |
| 31 test->node_sequence()->Add(new ReturnNode(kPos, l)); | 32 test->node_sequence()->Add(new ReturnNode(kPos, l)); |
| 32 parsed_function->SetNodeSequence(test->node_sequence()); | 33 parsed_function->SetNodeSequence(test->node_sequence()); |
| 33 parsed_function->set_instantiator(NULL); | 34 parsed_function->set_instantiator(NULL); |
| 34 parsed_function->set_default_parameter_values(Object::null_array()); | 35 parsed_function->set_default_parameter_values(Object::null_array()); |
| 35 parsed_function->EnsureExpressionTemp(); | 36 parsed_function->EnsureExpressionTemp(); |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 | 265 |
| 265 // Now invoke 'A.moo' and it will trigger a GC when the native function | 266 // Now invoke 'A.moo' and it will trigger a GC when the native function |
| 266 // is called, this should then cause the stack map of function 'A.foo' | 267 // is called, this should then cause the stack map of function 'A.foo' |
| 267 // to be traversed and the appropriate objects visited. | 268 // to be traversed and the appropriate objects visited. |
| 268 const Object& result = Object::Handle( | 269 const Object& result = Object::Handle( |
| 269 DartEntry::InvokeFunction(function_foo, Object::empty_array())); | 270 DartEntry::InvokeFunction(function_foo, Object::empty_array())); |
| 270 EXPECT(!result.IsError()); | 271 EXPECT(!result.IsError()); |
| 271 } | 272 } |
| 272 | 273 |
| 273 } // namespace dart | 274 } // namespace dart |
| OLD | NEW |