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 13 matching lines...) Expand all Loading... |
24 CODEGEN_TEST_GENERATE(StackMapCodegen, test) { | 24 CODEGEN_TEST_GENERATE(StackMapCodegen, test) { |
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); | |
35 parsed_function->EnsureExpressionTemp(); | 34 parsed_function->EnsureExpressionTemp(); |
36 test->node_sequence()->scope()->AddVariable( | 35 test->node_sequence()->scope()->AddVariable( |
37 parsed_function->expression_temp_var()); | 36 parsed_function->expression_temp_var()); |
38 test->node_sequence()->scope()->AddVariable( | 37 test->node_sequence()->scope()->AddVariable( |
39 parsed_function->current_context_var()); | 38 parsed_function->current_context_var()); |
40 parsed_function->AllocateVariables(); | 39 parsed_function->AllocateVariables(); |
41 bool retval; | 40 bool retval; |
42 Isolate* isolate = Isolate::Current(); | 41 Isolate* isolate = Isolate::Current(); |
43 EXPECT(isolate != NULL); | 42 EXPECT(isolate != NULL); |
44 LongJumpScope jump; | 43 LongJumpScope jump; |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 if (token_positions[i] != it.TokenPos().value()) { | 312 if (token_positions[i] != it.TokenPos().value()) { |
314 OS::Print("[%" Pd "]: Expected: %" Pd " != %" Pd "\n", i, | 313 OS::Print("[%" Pd "]: Expected: %" Pd " != %" Pd "\n", i, |
315 token_positions[i], it.TokenPos().value()); | 314 token_positions[i], it.TokenPos().value()); |
316 } | 315 } |
317 EXPECT(token_positions[i] == it.TokenPos().value()); | 316 EXPECT(token_positions[i] == it.TokenPos().value()); |
318 i++; | 317 i++; |
319 } | 318 } |
320 } | 319 } |
321 | 320 |
322 } // namespace dart | 321 } // namespace dart |
OLD | NEW |