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

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

Issue 1753053003: When a catch is unreachable, use the canonical empty array instead of null as its type array. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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
« no previous file with comments | « runtime/vm/object.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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/precompiler.h" 5 #include "vm/precompiler.h"
6 6
7 #include "vm/aot_optimizer.h" 7 #include "vm/aot_optimizer.h"
8 #include "vm/assembler.h" 8 #include "vm/assembler.h"
9 #include "vm/ast_printer.h" 9 #include "vm/ast_printer.h"
10 #include "vm/branch_optimizer.h" 10 #include "vm/branch_optimizer.h"
(...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after
574 Code& code = Code::Handle(Z, function.CurrentCode()); 574 Code& code = Code::Handle(Z, function.CurrentCode());
575 if (code.IsNull()) { 575 if (code.IsNull()) {
576 ASSERT(function.kind() == RawFunction::kSignatureFunction); 576 ASSERT(function.kind() == RawFunction::kSignatureFunction);
577 } else { 577 } else {
578 const ExceptionHandlers& handlers = 578 const ExceptionHandlers& handlers =
579 ExceptionHandlers::Handle(Z, code.exception_handlers()); 579 ExceptionHandlers::Handle(Z, code.exception_handlers());
580 if (!handlers.IsNull()) { 580 if (!handlers.IsNull()) {
581 Array& types = Array::Handle(Z); 581 Array& types = Array::Handle(Z);
582 for (intptr_t i = 0; i < handlers.num_entries(); i++) { 582 for (intptr_t i = 0; i < handlers.num_entries(); i++) {
583 types = handlers.GetHandledTypes(i); 583 types = handlers.GetHandledTypes(i);
584 if (!types.IsNull()) { 584 for (intptr_t j = 0; j < types.Length(); j++) {
585 for (intptr_t j = 0; j < types.Length(); j++) { 585 type ^= types.At(j);
586 type ^= types.At(j); 586 AddType(type);
587 AddType(type);
588 }
589 } 587 }
590 } 588 }
591 } 589 }
592 } 590 }
593 // A function can always be inlined and have only a nested local function 591 // A function can always be inlined and have only a nested local function
594 // remain. 592 // remain.
595 const Function& parent = Function::Handle(Z, function.parent_function()); 593 const Function& parent = Function::Handle(Z, function.parent_function());
596 if (!parent.IsNull()) { 594 if (!parent.IsNull()) {
597 AddTypesOf(parent); 595 AddTypesOf(parent);
598 } 596 }
(...skipping 1938 matching lines...) Expand 10 before | Expand all | Expand 10 after
2537 CompilationPipeline::New(thread->zone(), function); 2535 CompilationPipeline::New(thread->zone(), function);
2538 2536
2539 ASSERT(FLAG_precompiled_mode); 2537 ASSERT(FLAG_precompiled_mode);
2540 const bool optimized = function.IsOptimizable(); // False for natives. 2538 const bool optimized = function.IsOptimizable(); // False for natives.
2541 return PrecompileFunctionHelper(pipeline, function, optimized); 2539 return PrecompileFunctionHelper(pipeline, function, optimized);
2542 } 2540 }
2543 2541
2544 #endif // DART_PRECOMPILER 2542 #endif // DART_PRECOMPILER
2545 2543
2546 } // namespace dart 2544 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/object.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698