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

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

Issue 1170503004: Initial Timeline Events (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 months 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
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 1046 matching lines...) Expand 10 before | Expand all | Expand 10 after
1057 isolate->object_store()->clear_sticky_error(); 1057 isolate->object_store()->clear_sticky_error();
1058 return error.raw(); 1058 return error.raw();
1059 } 1059 }
1060 UNREACHABLE(); 1060 UNREACHABLE();
1061 return Error::null(); 1061 return Error::null();
1062 } 1062 }
1063 1063
1064 1064
1065 RawError* Compiler::CompileFunction(Thread* thread, 1065 RawError* Compiler::CompileFunction(Thread* thread,
1066 const Function& function) { 1066 const Function& function) {
1067 VMTagScope tagScope(thread->isolate(), VMTag::kCompileUnoptimizedTagId); 1067 Isolate* isolate = thread->isolate();
1068 VMTagScope tagScope(isolate, VMTag::kCompileUnoptimizedTagId);
1069 TimelineDurationScope tds(isolate,
1070 isolate->GetCompilerStream(),
1071 "CompileFunction");
1072 if (tds.enabled()) {
1073 tds.SetNumArguments(1);
1074 tds.CopyArgument(
1075 0,
1076 "function",
1077 const_cast<char*>(function.QualifiedUserVisibleNameCString()));
1078 }
siva 2015/06/12 19:50:34 I think you should really switch this code to a ma
Cutch 2015/06/12 23:18:56 Done.
1068 CompilationPipeline* pipeline = 1079 CompilationPipeline* pipeline =
1069 CompilationPipeline::New(thread->zone(), function); 1080 CompilationPipeline::New(thread->zone(), function);
1070 1081
1071 const bool optimized = 1082 const bool optimized =
1072 Compiler::always_optimize() && function.IsOptimizable(); 1083 Compiler::always_optimize() && function.IsOptimizable();
1073 1084
1074 return CompileFunctionHelper(pipeline, function, optimized, 1085 return CompileFunctionHelper(pipeline, function, optimized,
1075 Isolate::kNoDeoptId); 1086 Isolate::kNoDeoptId);
1076 } 1087 }
1077 1088
(...skipping 24 matching lines...) Expand all
1102 if (FLAG_trace_compiler) { 1113 if (FLAG_trace_compiler) {
1103 ISL_Print("Ensure unoptimized code for %s\n", function.ToCString()); 1114 ISL_Print("Ensure unoptimized code for %s\n", function.ToCString());
1104 } 1115 }
1105 return Error::null(); 1116 return Error::null();
1106 } 1117 }
1107 1118
1108 1119
1109 RawError* Compiler::CompileOptimizedFunction(Thread* thread, 1120 RawError* Compiler::CompileOptimizedFunction(Thread* thread,
1110 const Function& function, 1121 const Function& function,
1111 intptr_t osr_id) { 1122 intptr_t osr_id) {
1112 VMTagScope tagScope(thread->isolate(), VMTag::kCompileOptimizedTagId); 1123 Isolate* isolate = thread->isolate();
1124 VMTagScope tagScope(isolate, VMTag::kCompileOptimizedTagId);
1125 TimelineDurationScope tds(isolate,
1126 isolate->GetCompilerStream(),
1127 "CompileOptimizedFunction");
1128 if (tds.enabled()) {
1129 tds.SetNumArguments(1);
1130 tds.CopyArgument(
1131 0,
1132 "function",
1133 const_cast<char*>(function.QualifiedUserVisibleNameCString()));
1134 }
siva 2015/06/12 19:50:34 TIMELINE_FUNCTION_COMPILATION_DURATION(isolate, "O
Cutch 2015/06/12 23:18:56 Done.
1113 CompilationPipeline* pipeline = 1135 CompilationPipeline* pipeline =
1114 CompilationPipeline::New(thread->zone(), function); 1136 CompilationPipeline::New(thread->zone(), function);
1115 return CompileFunctionHelper(pipeline, function, true, osr_id); 1137 return CompileFunctionHelper(pipeline, function, true, osr_id);
1116 } 1138 }
1117 1139
1118 1140
1119 // This is only used from unit tests. 1141 // This is only used from unit tests.
1120 RawError* Compiler::CompileParsedFunction( 1142 RawError* Compiler::CompileParsedFunction(
1121 ParsedFunction* parsed_function) { 1143 ParsedFunction* parsed_function) {
1122 LongJumpScope jump; 1144 LongJumpScope jump;
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
1322 const Object& result = 1344 const Object& result =
1323 PassiveObject::Handle(isolate->object_store()->sticky_error()); 1345 PassiveObject::Handle(isolate->object_store()->sticky_error());
1324 isolate->object_store()->clear_sticky_error(); 1346 isolate->object_store()->clear_sticky_error();
1325 return result.raw(); 1347 return result.raw();
1326 } 1348 }
1327 UNREACHABLE(); 1349 UNREACHABLE();
1328 return Object::null(); 1350 return Object::null();
1329 } 1351 }
1330 1352
1331 } // namespace dart 1353 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698