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

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

Issue 2359393003: AOT: Enable optimizing native functions. Removes some initialization of unused split slots. (Closed)
Patch Set: Created 4 years, 3 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 | « no previous file | 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) 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 5959 matching lines...) Expand 10 before | Expand all | Expand 10 after
5970 void Function::SetNumOptionalParameters(intptr_t num_optional_parameters, 5970 void Function::SetNumOptionalParameters(intptr_t num_optional_parameters,
5971 bool are_optional_positional) const { 5971 bool are_optional_positional) const {
5972 ASSERT(num_optional_parameters >= 0); 5972 ASSERT(num_optional_parameters >= 0);
5973 set_num_optional_parameters(are_optional_positional ? 5973 set_num_optional_parameters(are_optional_positional ?
5974 num_optional_parameters : 5974 num_optional_parameters :
5975 -num_optional_parameters); 5975 -num_optional_parameters);
5976 } 5976 }
5977 5977
5978 5978
5979 bool Function::IsOptimizable() const { 5979 bool Function::IsOptimizable() const {
5980 if (FLAG_precompiled_mode) {
5981 return true;
5982 }
5980 if (is_native()) { 5983 if (is_native()) {
5981 // Native methods don't need to be optimized. 5984 // Native methods don't need to be optimized.
5982 return false; 5985 return false;
5983 } 5986 }
5984 if (FLAG_precompiled_mode) {
5985 return true;
5986 }
5987 const intptr_t function_length = end_token_pos().Pos() - token_pos().Pos(); 5987 const intptr_t function_length = end_token_pos().Pos() - token_pos().Pos();
5988 if (is_optimizable() && (script() != Script::null()) && 5988 if (is_optimizable() && (script() != Script::null()) &&
5989 (function_length < FLAG_huge_method_cutoff_in_tokens)) { 5989 (function_length < FLAG_huge_method_cutoff_in_tokens)) {
5990 // Additional check needed for implicit getters. 5990 // Additional check needed for implicit getters.
5991 return (unoptimized_code() == Object::null()) || 5991 return (unoptimized_code() == Object::null()) ||
5992 (Code::Handle(unoptimized_code()).Size() < 5992 (Code::Handle(unoptimized_code()).Size() <
5993 FLAG_huge_method_cutoff_in_code_size); 5993 FLAG_huge_method_cutoff_in_code_size);
5994 } 5994 }
5995 return false; 5995 return false;
5996 } 5996 }
(...skipping 16964 matching lines...) Expand 10 before | Expand all | Expand 10 after
22961 return UserTag::null(); 22961 return UserTag::null();
22962 } 22962 }
22963 22963
22964 22964
22965 const char* UserTag::ToCString() const { 22965 const char* UserTag::ToCString() const {
22966 const String& tag_label = String::Handle(label()); 22966 const String& tag_label = String::Handle(label());
22967 return tag_label.ToCString(); 22967 return tag_label.ToCString();
22968 } 22968 }
22969 22969
22970 } // namespace dart 22970 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698