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" |
(...skipping 14 matching lines...) Expand all Loading... |
25 ParsedFunction* parsed_function = | 25 ParsedFunction* parsed_function = |
26 new ParsedFunction(Thread::Current(), test->function()); | 26 new ParsedFunction(Thread::Current(), test->function()); |
27 LiteralNode* l = new LiteralNode(kPos, Smi::ZoneHandle(Smi::New(1))); | 27 LiteralNode* l = new LiteralNode(kPos, Smi::ZoneHandle(Smi::New(1))); |
28 test->node_sequence()->Add(new ReturnNode(kPos, l)); | 28 test->node_sequence()->Add(new ReturnNode(kPos, l)); |
29 l = new LiteralNode(kPos, Smi::ZoneHandle(Smi::New(2))); | 29 l = new LiteralNode(kPos, Smi::ZoneHandle(Smi::New(2))); |
30 test->node_sequence()->Add(new ReturnNode(kPos, l)); | 30 test->node_sequence()->Add(new ReturnNode(kPos, l)); |
31 l = new LiteralNode(kPos, Smi::ZoneHandle(Smi::New(3))); | 31 l = new LiteralNode(kPos, Smi::ZoneHandle(Smi::New(3))); |
32 test->node_sequence()->Add(new ReturnNode(kPos, l)); | 32 test->node_sequence()->Add(new ReturnNode(kPos, l)); |
33 parsed_function->SetNodeSequence(test->node_sequence()); | 33 parsed_function->SetNodeSequence(test->node_sequence()); |
34 parsed_function->set_instantiator(NULL); | 34 parsed_function->set_instantiator(NULL); |
35 parsed_function->set_default_parameter_values(Object::null_array()); | |
36 parsed_function->EnsureExpressionTemp(); | 35 parsed_function->EnsureExpressionTemp(); |
37 test->node_sequence()->scope()->AddVariable( | 36 test->node_sequence()->scope()->AddVariable( |
38 parsed_function->expression_temp_var()); | 37 parsed_function->expression_temp_var()); |
39 test->node_sequence()->scope()->AddVariable( | 38 test->node_sequence()->scope()->AddVariable( |
40 parsed_function->current_context_var()); | 39 parsed_function->current_context_var()); |
41 parsed_function->AllocateVariables(); | 40 parsed_function->AllocateVariables(); |
42 bool retval; | 41 bool retval; |
43 Isolate* isolate = Isolate::Current(); | 42 Isolate* isolate = Isolate::Current(); |
44 EXPECT(isolate != NULL); | 43 EXPECT(isolate != NULL); |
45 LongJumpScope jump; | 44 LongJumpScope jump; |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 | 262 |
264 // Now invoke 'A.moo' and it will trigger a GC when the native function | 263 // Now invoke 'A.moo' and it will trigger a GC when the native function |
265 // is called, this should then cause the stack map of function 'A.foo' | 264 // is called, this should then cause the stack map of function 'A.foo' |
266 // to be traversed and the appropriate objects visited. | 265 // to be traversed and the appropriate objects visited. |
267 const Object& result = Object::Handle( | 266 const Object& result = Object::Handle( |
268 DartEntry::InvokeFunction(function_foo, Object::empty_array())); | 267 DartEntry::InvokeFunction(function_foo, Object::empty_array())); |
269 EXPECT(!result.IsError()); | 268 EXPECT(!result.IsError()); |
270 } | 269 } |
271 | 270 |
272 } // namespace dart | 271 } // namespace dart |
OLD | NEW |