| 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 | 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 1052 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1063 isolate->object_store()->clear_sticky_error(); | 1063 isolate->object_store()->clear_sticky_error(); |
| 1064 return error.raw(); | 1064 return error.raw(); |
| 1065 } | 1065 } |
| 1066 UNREACHABLE(); | 1066 UNREACHABLE(); |
| 1067 return Error::null(); | 1067 return Error::null(); |
| 1068 } | 1068 } |
| 1069 | 1069 |
| 1070 | 1070 |
| 1071 RawError* Compiler::CompileFunction(Thread* thread, | 1071 RawError* Compiler::CompileFunction(Thread* thread, |
| 1072 const Function& function) { | 1072 const Function& function) { |
| 1073 VMTagScope tagScope(thread->isolate(), VMTag::kCompileUnoptimizedTagId); | 1073 Isolate* isolate = thread->isolate(); |
| 1074 VMTagScope tagScope(isolate, VMTag::kCompileUnoptimizedTagId); |
| 1075 TIMELINE_FUNCTION_COMPILATION_DURATION(isolate, "Function", function); |
| 1076 |
| 1074 CompilationPipeline* pipeline = | 1077 CompilationPipeline* pipeline = |
| 1075 CompilationPipeline::New(thread->zone(), function); | 1078 CompilationPipeline::New(thread->zone(), function); |
| 1076 | 1079 |
| 1077 const bool optimized = | 1080 const bool optimized = |
| 1078 Compiler::always_optimize() && function.IsOptimizable(); | 1081 Compiler::always_optimize() && function.IsOptimizable(); |
| 1079 | 1082 |
| 1080 return CompileFunctionHelper(pipeline, function, optimized, | 1083 return CompileFunctionHelper(pipeline, function, optimized, |
| 1081 Isolate::kNoDeoptId); | 1084 Isolate::kNoDeoptId); |
| 1082 } | 1085 } |
| 1083 | 1086 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 1108 if (FLAG_trace_compiler) { | 1111 if (FLAG_trace_compiler) { |
| 1109 ISL_Print("Ensure unoptimized code for %s\n", function.ToCString()); | 1112 ISL_Print("Ensure unoptimized code for %s\n", function.ToCString()); |
| 1110 } | 1113 } |
| 1111 return Error::null(); | 1114 return Error::null(); |
| 1112 } | 1115 } |
| 1113 | 1116 |
| 1114 | 1117 |
| 1115 RawError* Compiler::CompileOptimizedFunction(Thread* thread, | 1118 RawError* Compiler::CompileOptimizedFunction(Thread* thread, |
| 1116 const Function& function, | 1119 const Function& function, |
| 1117 intptr_t osr_id) { | 1120 intptr_t osr_id) { |
| 1118 VMTagScope tagScope(thread->isolate(), VMTag::kCompileOptimizedTagId); | 1121 Isolate* isolate = thread->isolate(); |
| 1122 VMTagScope tagScope(isolate, VMTag::kCompileOptimizedTagId); |
| 1123 TIMELINE_FUNCTION_COMPILATION_DURATION(isolate, |
| 1124 "OptimizedFunction", function); |
| 1125 |
| 1119 CompilationPipeline* pipeline = | 1126 CompilationPipeline* pipeline = |
| 1120 CompilationPipeline::New(thread->zone(), function); | 1127 CompilationPipeline::New(thread->zone(), function); |
| 1121 return CompileFunctionHelper(pipeline, function, true, osr_id); | 1128 return CompileFunctionHelper(pipeline, function, true, osr_id); |
| 1122 } | 1129 } |
| 1123 | 1130 |
| 1124 | 1131 |
| 1125 // This is only used from unit tests. | 1132 // This is only used from unit tests. |
| 1126 RawError* Compiler::CompileParsedFunction( | 1133 RawError* Compiler::CompileParsedFunction( |
| 1127 ParsedFunction* parsed_function) { | 1134 ParsedFunction* parsed_function) { |
| 1128 LongJumpScope jump; | 1135 LongJumpScope jump; |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1328 const Object& result = | 1335 const Object& result = |
| 1329 PassiveObject::Handle(isolate->object_store()->sticky_error()); | 1336 PassiveObject::Handle(isolate->object_store()->sticky_error()); |
| 1330 isolate->object_store()->clear_sticky_error(); | 1337 isolate->object_store()->clear_sticky_error(); |
| 1331 return result.raw(); | 1338 return result.raw(); |
| 1332 } | 1339 } |
| 1333 UNREACHABLE(); | 1340 UNREACHABLE(); |
| 1334 return Object::null(); | 1341 return Object::null(); |
| 1335 } | 1342 } |
| 1336 | 1343 |
| 1337 } // namespace dart | 1344 } // namespace dart |
| OLD | NEW |