Chromium Code Reviews| 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 "vm/compiler.h" | 5 #include "vm/compiler.h" |
| 6 | 6 |
| 7 #include "vm/assembler.h" | 7 #include "vm/assembler.h" |
| 8 #include "vm/ast_printer.h" | 8 #include "vm/ast_printer.h" |
| 9 #include "vm/code_generator.h" | 9 #include "vm/code_generator.h" |
| 10 #include "vm/code_patcher.h" | 10 #include "vm/code_patcher.h" |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 130 static RawError* CompileFunctionHelper(const Function& function, | 130 static RawError* CompileFunctionHelper(const Function& function, |
| 131 bool optimized) { | 131 bool optimized) { |
| 132 Isolate* isolate = Isolate::Current(); | 132 Isolate* isolate = Isolate::Current(); |
| 133 Error& error = Error::Handle(); | 133 Error& error = Error::Handle(); |
| 134 LongJump* base = isolate->long_jump_base(); | 134 LongJump* base = isolate->long_jump_base(); |
| 135 LongJump jump; | 135 LongJump jump; |
| 136 isolate->set_long_jump_base(&jump); | 136 isolate->set_long_jump_base(&jump); |
| 137 // Skips parsing if we need to only install unoptimized code. | 137 // Skips parsing if we need to only install unoptimized code. |
| 138 if (!optimized && !Code::Handle(function.unoptimized_code()).IsNull()) { | 138 if (!optimized && !Code::Handle(function.unoptimized_code()).IsNull()) { |
| 139 InstallUnoptimizedCode(function); | 139 InstallUnoptimizedCode(function); |
| 140 isolate->set_long_jump_base(base); | |
|
srdjan
2012/04/18 15:43:47
Thanks for fixing this, and sorry about introducin
| |
| 140 return Error::null(); | 141 return Error::null(); |
| 141 } | 142 } |
| 142 if (setjmp(*jump.Set()) == 0) { | 143 if (setjmp(*jump.Set()) == 0) { |
| 143 TIMERSCOPE(time_compilation); | 144 TIMERSCOPE(time_compilation); |
| 144 ParsedFunction parsed_function(function); | 145 ParsedFunction parsed_function(function); |
| 145 const char* function_fullname = function.ToFullyQualifiedCString(); | 146 const char* function_fullname = function.ToFullyQualifiedCString(); |
| 146 if (FLAG_trace_compiler) { | 147 if (FLAG_trace_compiler) { |
| 147 OS::Print("Compiling %sfunction: '%s' @ token %d\n", | 148 OS::Print("Compiling %sfunction: '%s' @ token %d\n", |
| 148 (optimized ? "optimized " : ""), | 149 (optimized ? "optimized " : ""), |
| 149 function_fullname, | 150 function_fullname, |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 391 } else { | 392 } else { |
| 392 result = isolate->object_store()->sticky_error(); | 393 result = isolate->object_store()->sticky_error(); |
| 393 isolate->object_store()->clear_sticky_error(); | 394 isolate->object_store()->clear_sticky_error(); |
| 394 } | 395 } |
| 395 isolate->set_long_jump_base(base); | 396 isolate->set_long_jump_base(base); |
| 396 return result.raw(); | 397 return result.raw(); |
| 397 } | 398 } |
| 398 | 399 |
| 399 | 400 |
| 400 } // namespace dart | 401 } // namespace dart |
| OLD | NEW |