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

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

Issue 2379733002: Recognize and optimize a.runtimeType == b.runtimeType pattern. (Closed)
Patch Set: Done Created 4 years, 2 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 816 matching lines...) Expand 10 before | Expand all | Expand 10 after
827 827
828 // Use propagated class-ids to create more inlining opportunities. 828 // Use propagated class-ids to create more inlining opportunities.
829 optimizer.ApplyClassIds(); 829 optimizer.ApplyClassIds();
830 DEBUG_ASSERT(flow_graph->VerifyUseLists()); 830 DEBUG_ASSERT(flow_graph->VerifyUseLists());
831 831
832 FlowGraphInliner inliner(flow_graph, 832 FlowGraphInliner inliner(flow_graph,
833 &inline_id_to_function, 833 &inline_id_to_function,
834 &inline_id_to_token_pos, 834 &inline_id_to_token_pos,
835 &caller_inline_id, 835 &caller_inline_id,
836 use_speculative_inlining, 836 use_speculative_inlining,
837 NULL); 837 /*inlining_black_list=*/ NULL,
838 /*precompiler=*/ NULL);
838 inliner.Inline(); 839 inliner.Inline();
839 // Use lists are maintained and validated by the inliner. 840 // Use lists are maintained and validated by the inliner.
840 DEBUG_ASSERT(flow_graph->VerifyUseLists()); 841 DEBUG_ASSERT(flow_graph->VerifyUseLists());
841 } 842 }
842 843
843 // Propagate types and eliminate more type tests. 844 // Propagate types and eliminate more type tests.
844 FlowGraphTypePropagator::Propagate(flow_graph); 845 FlowGraphTypePropagator::Propagate(flow_graph);
845 DEBUG_ASSERT(flow_graph->VerifyUseLists()); 846 DEBUG_ASSERT(flow_graph->VerifyUseLists());
846 847
847 { 848 {
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after
1435 } 1436 }
1436 UNREACHABLE(); 1437 UNREACHABLE();
1437 return Error::null(); 1438 return Error::null();
1438 } 1439 }
1439 1440
1440 1441
1441 RawError* Compiler::CompileFunction(Thread* thread, 1442 RawError* Compiler::CompileFunction(Thread* thread,
1442 const Function& function) { 1443 const Function& function) {
1443 #ifdef DART_PRECOMPILER 1444 #ifdef DART_PRECOMPILER
1444 if (FLAG_precompiled_mode) { 1445 if (FLAG_precompiled_mode) {
1445 return Precompiler::CompileFunction(thread, thread->zone(), function); 1446 return Precompiler::CompileFunction(
1447 /* precompiler = */ NULL, thread, thread->zone(), function);
1446 } 1448 }
1447 #endif 1449 #endif
1448 Isolate* isolate = thread->isolate(); 1450 Isolate* isolate = thread->isolate();
1449 NOT_IN_PRODUCT( 1451 NOT_IN_PRODUCT(
1450 VMTagScope tagScope(thread, VMTag::kCompileUnoptimizedTagId); 1452 VMTagScope tagScope(thread, VMTag::kCompileUnoptimizedTagId);
1451 TIMELINE_FUNCTION_COMPILATION_DURATION(thread, "CompileFunction", function); 1453 TIMELINE_FUNCTION_COMPILATION_DURATION(thread, "CompileFunction", function);
1452 ) // !PRODUCT 1454 ) // !PRODUCT
1453 1455
1454 if (!isolate->compilation_allowed()) { 1456 if (!isolate->compilation_allowed()) {
1455 FATAL3("Precompilation missed function %s (%s, %s)\n", 1457 FATAL3("Precompilation missed function %s (%s, %s)\n",
(...skipping 855 matching lines...) Expand 10 before | Expand all | Expand 10 after
2311 2313
2312 2314
2313 bool BackgroundCompiler::IsDisabled() { 2315 bool BackgroundCompiler::IsDisabled() {
2314 UNREACHABLE(); 2316 UNREACHABLE();
2315 return true; 2317 return true;
2316 } 2318 }
2317 2319
2318 #endif // DART_PRECOMPILED_RUNTIME 2320 #endif // DART_PRECOMPILED_RUNTIME
2319 2321
2320 } // namespace dart 2322 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698