OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 | 5 |
6 #include "vm/ast_printer.h" | 6 #include "vm/ast_printer.h" |
7 #include "vm/class_finalizer.h" | 7 #include "vm/class_finalizer.h" |
8 #include "vm/longjump.h" | 8 #include "vm/longjump.h" |
9 #include "vm/object.h" | 9 #include "vm/object.h" |
10 #include "vm/parser.h" | 10 #include "vm/parser.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 Function& function = Function::Handle(cls.LookupStaticFunction(funcname)); | 23 Function& function = Function::Handle(cls.LookupStaticFunction(funcname)); |
24 EXPECT(!function.IsNull()); | 24 EXPECT(!function.IsNull()); |
25 | 25 |
26 bool retval; | 26 bool retval; |
27 Isolate* isolate = Isolate::Current(); | 27 Isolate* isolate = Isolate::Current(); |
28 EXPECT(isolate != NULL); | 28 EXPECT(isolate != NULL); |
29 LongJump* base = isolate->long_jump_base(); | 29 LongJump* base = isolate->long_jump_base(); |
30 LongJump jump; | 30 LongJump jump; |
31 isolate->set_long_jump_base(&jump); | 31 isolate->set_long_jump_base(&jump); |
32 if (setjmp(*jump.Set()) == 0) { | 32 if (setjmp(*jump.Set()) == 0) { |
33 ParsedFunction parsed_function(function); | 33 ParsedFunction* parsed_function = new ParsedFunction(function); |
34 Parser::ParseFunction(&parsed_function); | 34 Parser::ParseFunction(parsed_function); |
35 EXPECT(parsed_function.node_sequence() != NULL); | 35 EXPECT(parsed_function->node_sequence() != NULL); |
36 printf("Class %s function %s:\n", cname, fname); | 36 printf("Class %s function %s:\n", cname, fname); |
37 AstPrinter::PrintFunctionNodes(parsed_function); | 37 AstPrinter::PrintFunctionNodes(*parsed_function); |
38 retval = true; | 38 retval = true; |
39 } else { | 39 } else { |
40 retval = false; | 40 retval = false; |
41 } | 41 } |
42 EXPECT(retval); | 42 EXPECT(retval); |
43 isolate->set_long_jump_base(base); | 43 isolate->set_long_jump_base(base); |
44 } | 44 } |
45 | 45 |
46 | 46 |
47 void CheckField(const Library& lib, | 47 void CheckField(const Library& lib, |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 Parser::ParseCompilationUnit(lib, script); | 160 Parser::ParseCompilationUnit(lib, script); |
161 EXPECT(ClassFinalizer::FinalizePendingClasses()); | 161 EXPECT(ClassFinalizer::FinalizePendingClasses()); |
162 | 162 |
163 DumpFunction(lib, "A", "foo"); | 163 DumpFunction(lib, "A", "foo"); |
164 DumpFunction(lib, "A", "bar"); | 164 DumpFunction(lib, "A", "bar"); |
165 DumpFunction(lib, "A", "baz"); | 165 DumpFunction(lib, "A", "baz"); |
166 DumpFunction(lib, "B", "bam"); | 166 DumpFunction(lib, "B", "bam"); |
167 } | 167 } |
168 | 168 |
169 } // namespace dart | 169 } // namespace dart |
OLD | NEW |