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

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

Issue 11364166: Make sure that ParsedFunction holds onto zone handles. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: 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.cc ('k') | no next file » | 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"
11 #include "vm/symbols.h" 11 #include "vm/symbols.h"
12 #include "vm/unit_test.h" 12 #include "vm/unit_test.h"
13 13
14 namespace dart { 14 namespace dart {
15 15
16 16
17 void DumpFunction(const Library& lib, const char* cname, const char* fname) { 17 void DumpFunction(const Library& lib, const char* cname, const char* fname) {
18 const String& classname = String::Handle(Symbols::New(cname)); 18 const String& classname = String::Handle(Symbols::New(cname));
19 Class& cls = Class::Handle(lib.LookupClass(classname)); 19 Class& cls = Class::Handle(lib.LookupClass(classname));
20 EXPECT(!cls.IsNull()); 20 EXPECT(!cls.IsNull());
21 21
22 String& funcname = String::Handle(String::New(fname)); 22 String& funcname = String::Handle(String::New(fname));
23 Function& function = Function::Handle(cls.LookupStaticFunction(funcname)); 23 Function& function = Function::ZoneHandle(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 = new ParsedFunction(function); 33 ParsedFunction* parsed_function = new ParsedFunction(function);
(...skipping 126 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.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698