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 1053 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1064 isolate->object_store()->clear_sticky_error(); | 1064 isolate->object_store()->clear_sticky_error(); |
1065 return error.raw(); | 1065 return error.raw(); |
1066 } | 1066 } |
1067 UNREACHABLE(); | 1067 UNREACHABLE(); |
1068 return Error::null(); | 1068 return Error::null(); |
1069 } | 1069 } |
1070 | 1070 |
1071 | 1071 |
1072 RawError* Compiler::CompileFunction(Thread* thread, | 1072 RawError* Compiler::CompileFunction(Thread* thread, |
1073 const Function& function) { | 1073 const Function& function) { |
1074 VMTagScope tagScope(thread->isolate(), VMTag::kCompileUnoptimizedTagId); | 1074 Isolate* isolate = thread->isolate(); |
| 1075 VMTagScope tagScope(isolate, VMTag::kCompileUnoptimizedTagId); |
| 1076 TimelineDurationScope tds(isolate, |
| 1077 isolate->GetCompilerStream(), |
| 1078 "CompileFunction"); |
| 1079 if (tds.enabled()) { |
| 1080 tds.SetNumArguments(1); |
| 1081 tds.CopyArgument( |
| 1082 0, |
| 1083 "function", |
| 1084 const_cast<char*>(function.QualifiedUserVisibleNameCString())); |
| 1085 } |
1075 CompilationPipeline* pipeline = | 1086 CompilationPipeline* pipeline = |
1076 CompilationPipeline::New(thread->zone(), function); | 1087 CompilationPipeline::New(thread->zone(), function); |
1077 | 1088 |
1078 const bool optimized = | 1089 const bool optimized = |
1079 Compiler::always_optimize() && function.IsOptimizable(); | 1090 Compiler::always_optimize() && function.IsOptimizable(); |
1080 | 1091 |
1081 return CompileFunctionHelper(pipeline, function, optimized, | 1092 return CompileFunctionHelper(pipeline, function, optimized, |
1082 Isolate::kNoDeoptId); | 1093 Isolate::kNoDeoptId); |
1083 } | 1094 } |
1084 | 1095 |
(...skipping 24 matching lines...) Expand all Loading... |
1109 if (FLAG_trace_compiler) { | 1120 if (FLAG_trace_compiler) { |
1110 ISL_Print("Ensure unoptimized code for %s\n", function.ToCString()); | 1121 ISL_Print("Ensure unoptimized code for %s\n", function.ToCString()); |
1111 } | 1122 } |
1112 return Error::null(); | 1123 return Error::null(); |
1113 } | 1124 } |
1114 | 1125 |
1115 | 1126 |
1116 RawError* Compiler::CompileOptimizedFunction(Thread* thread, | 1127 RawError* Compiler::CompileOptimizedFunction(Thread* thread, |
1117 const Function& function, | 1128 const Function& function, |
1118 intptr_t osr_id) { | 1129 intptr_t osr_id) { |
1119 VMTagScope tagScope(thread->isolate(), VMTag::kCompileOptimizedTagId); | 1130 Isolate* isolate = thread->isolate(); |
| 1131 VMTagScope tagScope(isolate, VMTag::kCompileOptimizedTagId); |
| 1132 TimelineDurationScope tds(isolate, |
| 1133 isolate->GetCompilerStream(), |
| 1134 "CompileOptimizedFunction"); |
| 1135 if (tds.enabled()) { |
| 1136 tds.SetNumArguments(1); |
| 1137 tds.CopyArgument( |
| 1138 0, |
| 1139 "function", |
| 1140 const_cast<char*>(function.QualifiedUserVisibleNameCString())); |
| 1141 } |
1120 CompilationPipeline* pipeline = | 1142 CompilationPipeline* pipeline = |
1121 CompilationPipeline::New(thread->zone(), function); | 1143 CompilationPipeline::New(thread->zone(), function); |
1122 return CompileFunctionHelper(pipeline, function, true, osr_id); | 1144 return CompileFunctionHelper(pipeline, function, true, osr_id); |
1123 } | 1145 } |
1124 | 1146 |
1125 | 1147 |
1126 // This is only used from unit tests. | 1148 // This is only used from unit tests. |
1127 RawError* Compiler::CompileParsedFunction( | 1149 RawError* Compiler::CompileParsedFunction( |
1128 ParsedFunction* parsed_function) { | 1150 ParsedFunction* parsed_function) { |
1129 LongJumpScope jump; | 1151 LongJumpScope jump; |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1329 const Object& result = | 1351 const Object& result = |
1330 PassiveObject::Handle(isolate->object_store()->sticky_error()); | 1352 PassiveObject::Handle(isolate->object_store()->sticky_error()); |
1331 isolate->object_store()->clear_sticky_error(); | 1353 isolate->object_store()->clear_sticky_error(); |
1332 return result.raw(); | 1354 return result.raw(); |
1333 } | 1355 } |
1334 UNREACHABLE(); | 1356 UNREACHABLE(); |
1335 return Object::null(); | 1357 return Object::null(); |
1336 } | 1358 } |
1337 | 1359 |
1338 } // namespace dart | 1360 } // namespace dart |
OLD | NEW |