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

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

Issue 2246083003: AOT: Optimize even large functions. Ensures all calls are optimized static calls, switchable calls … (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: . Created 4 years, 4 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.h ('k') | runtime/vm/precompiler.cc » ('j') | 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) 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/object.h" 5 #include "vm/object.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/assembler.h" 9 #include "vm/assembler.h"
10 #include "vm/become.h" 10 #include "vm/become.h"
(...skipping 5887 matching lines...) Expand 10 before | Expand all | Expand 10 after
5898 num_optional_parameters : 5898 num_optional_parameters :
5899 -num_optional_parameters); 5899 -num_optional_parameters);
5900 } 5900 }
5901 5901
5902 5902
5903 bool Function::IsOptimizable() const { 5903 bool Function::IsOptimizable() const {
5904 if (is_native()) { 5904 if (is_native()) {
5905 // Native methods don't need to be optimized. 5905 // Native methods don't need to be optimized.
5906 return false; 5906 return false;
5907 } 5907 }
5908 if (FLAG_precompiled_mode) {
5909 return true;
5910 }
5908 const intptr_t function_length = end_token_pos().Pos() - token_pos().Pos(); 5911 const intptr_t function_length = end_token_pos().Pos() - token_pos().Pos();
5909 if (is_optimizable() && (script() != Script::null()) && 5912 if (is_optimizable() && (script() != Script::null()) &&
5910 (function_length < FLAG_huge_method_cutoff_in_tokens)) { 5913 (function_length < FLAG_huge_method_cutoff_in_tokens)) {
5911 // Additional check needed for implicit getters. 5914 // Additional check needed for implicit getters.
5912 return (unoptimized_code() == Object::null()) || 5915 return (unoptimized_code() == Object::null()) ||
5913 (Code::Handle(unoptimized_code()).Size() < 5916 (Code::Handle(unoptimized_code()).Size() <
5914 FLAG_huge_method_cutoff_in_code_size); 5917 FLAG_huge_method_cutoff_in_code_size);
5915 } 5918 }
5916 return false; 5919 return false;
5917 } 5920 }
(...skipping 6565 matching lines...) Expand 10 before | Expand all | Expand 10 after
12483 GrowableArray<DeoptInstr*> unpacked; 12486 GrowableArray<DeoptInstr*> unpacked;
12484 Unpack(deopt_table, packed, &unpacked); 12487 Unpack(deopt_table, packed, &unpacked);
12485 ASSERT(unpacked.length() == original.length()); 12488 ASSERT(unpacked.length() == original.length());
12486 for (intptr_t i = 0; i < unpacked.length(); ++i) { 12489 for (intptr_t i = 0; i < unpacked.length(); ++i) {
12487 ASSERT(unpacked[i]->Equals(*original[i])); 12490 ASSERT(unpacked[i]->Equals(*original[i]));
12488 } 12491 }
12489 return true; 12492 return true;
12490 } 12493 }
12491 12494
12492 12495
12496 void ICData::ResetSwitchable(Zone* zone) const {
12497 ASSERT(NumArgsTested() == 1);
12498 set_ic_data_array(Array::Handle(zone, CachedEmptyICDataArray(1)));
12499 }
12500
12501
12493 const char* ICData::ToCString() const { 12502 const char* ICData::ToCString() const {
12494 const String& name = String::Handle(target_name()); 12503 const String& name = String::Handle(target_name());
12495 const intptr_t num_args = NumArgsTested(); 12504 const intptr_t num_args = NumArgsTested();
12496 const intptr_t num_checks = NumberOfChecks(); 12505 const intptr_t num_checks = NumberOfChecks();
12497 return OS::SCreate(Thread::Current()->zone(), 12506 return OS::SCreate(Thread::Current()->zone(),
12498 "ICData target:'%s' num-args: %" Pd " num-checks: %" Pd "", 12507 "ICData target:'%s' num-args: %" Pd " num-checks: %" Pd "",
12499 name.ToCString(), num_args, num_checks); 12508 name.ToCString(), num_args, num_checks);
12500 } 12509 }
12501 12510
12502 12511
(...skipping 10211 matching lines...) Expand 10 before | Expand all | Expand 10 after
22714 return UserTag::null(); 22723 return UserTag::null();
22715 } 22724 }
22716 22725
22717 22726
22718 const char* UserTag::ToCString() const { 22727 const char* UserTag::ToCString() const {
22719 const String& tag_label = String::Handle(label()); 22728 const String& tag_label = String::Handle(label());
22720 return tag_label.ToCString(); 22729 return tag_label.ToCString();
22721 } 22730 }
22722 22731
22723 } // namespace dart 22732 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/precompiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698