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

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

Issue 70183010: Fixes a couple problems with GC of unoptimized code. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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
OLDNEW
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 "vm/compiler.h" 5 #include "vm/compiler.h"
6 6
7 #include "vm/assembler.h" 7 #include "vm/assembler.h"
8 8
9 #include "vm/ast_printer.h" 9 #include "vm/ast_printer.h"
10 #include "vm/block_scheduler.h" 10 #include "vm/block_scheduler.h"
(...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after
709 709
710 710
711 static RawError* CompileFunctionHelper(const Function& function, 711 static RawError* CompileFunctionHelper(const Function& function,
712 bool optimized, 712 bool optimized,
713 intptr_t osr_id) { 713 intptr_t osr_id) {
714 Isolate* isolate = Isolate::Current(); 714 Isolate* isolate = Isolate::Current();
715 StackZone zone(isolate); 715 StackZone zone(isolate);
716 LongJump* base = isolate->long_jump_base(); 716 LongJump* base = isolate->long_jump_base();
717 LongJump jump; 717 LongJump jump;
718 isolate->set_long_jump_base(&jump); 718 isolate->set_long_jump_base(&jump);
719 // Make sure unoptimized code is not collected while we are compiling.
720 const Code& unoptimized_code = Code::ZoneHandle(function.unoptimized_code());
719 // Skips parsing if we need to only install unoptimized code. 721 // Skips parsing if we need to only install unoptimized code.
720 if (!optimized && !Code::Handle(function.unoptimized_code()).IsNull()) { 722 if (!optimized && !unoptimized_code.IsNull()) {
721 InstallUnoptimizedCode(function); 723 InstallUnoptimizedCode(function);
722 isolate->set_long_jump_base(base); 724 isolate->set_long_jump_base(base);
723 return Error::null(); 725 return Error::null();
724 } 726 }
725 if (setjmp(*jump.Set()) == 0) { 727 if (setjmp(*jump.Set()) == 0) {
726 TIMERSCOPE(time_compilation); 728 TIMERSCOPE(time_compilation);
727 Timer per_compile_timer(FLAG_trace_compiler, "Compilation time"); 729 Timer per_compile_timer(FLAG_trace_compiler, "Compilation time");
728 per_compile_timer.Start(); 730 per_compile_timer.Start();
729 ParsedFunction* parsed_function = 731 ParsedFunction* parsed_function =
730 new ParsedFunction(Function::ZoneHandle(function.raw())); 732 new ParsedFunction(Function::ZoneHandle(function.raw()));
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
928 Object::Handle(isolate->object_store()->sticky_error()); 930 Object::Handle(isolate->object_store()->sticky_error());
929 isolate->object_store()->clear_sticky_error(); 931 isolate->object_store()->clear_sticky_error();
930 isolate->set_long_jump_base(base); 932 isolate->set_long_jump_base(base);
931 return result.raw(); 933 return result.raw();
932 } 934 }
933 UNREACHABLE(); 935 UNREACHABLE();
934 return Object::null(); 936 return Object::null();
935 } 937 }
936 938
937 } // namespace dart 939 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698