Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(64)

Side by Side Diff: runtime/vm/parser_test.cc

Issue 11228022: Cache parsed functions when inlining. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: virtual Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/parser.h ('k') | runtime/vm/scopes.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « runtime/vm/parser.h ('k') | runtime/vm/scopes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698