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

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

Issue 11722006: - Mark huge methods are not-optimizable. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 11 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 | Annotate | Revision Log
« 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/bigint_operations.h" 10 #include "vm/bigint_operations.h"
(...skipping 22 matching lines...) Expand all
33 #include "vm/timer.h" 33 #include "vm/timer.h"
34 #include "vm/unicode.h" 34 #include "vm/unicode.h"
35 35
36 namespace dart { 36 namespace dart {
37 37
38 DEFINE_FLAG(bool, show_internal_names, false, 38 DEFINE_FLAG(bool, show_internal_names, false,
39 "Show names of internal classes (e.g. \"OneByteString\") in error messages " 39 "Show names of internal classes (e.g. \"OneByteString\") in error messages "
40 "instead of showing the corresponding interface names (e.g. \"String\")"); 40 "instead of showing the corresponding interface names (e.g. \"String\")");
41 DEFINE_FLAG(bool, trace_disabling_optimized_code, false, 41 DEFINE_FLAG(bool, trace_disabling_optimized_code, false,
42 "Trace disabling optimized code."); 42 "Trace disabling optimized code.");
43 DEFINE_FLAG(int, huge_method_cutoff, 20000,
44 "Huge method cutoff: Disables optimizations for huge methods.");
43 DECLARE_FLAG(bool, trace_compiler); 45 DECLARE_FLAG(bool, trace_compiler);
44 DECLARE_FLAG(bool, eliminate_type_checks); 46 DECLARE_FLAG(bool, eliminate_type_checks);
45 DECLARE_FLAG(bool, enable_type_checks); 47 DECLARE_FLAG(bool, enable_type_checks);
46 48
47 static const char* kGetterPrefix = "get:"; 49 static const char* kGetterPrefix = "get:";
48 static const intptr_t kGetterPrefixLength = strlen(kGetterPrefix); 50 static const intptr_t kGetterPrefixLength = strlen(kGetterPrefix);
49 static const char* kSetterPrefix = "set:"; 51 static const char* kSetterPrefix = "set:";
50 static const intptr_t kSetterPrefixLength = strlen(kSetterPrefix); 52 static const intptr_t kSetterPrefixLength = strlen(kSetterPrefix);
51 53
52 cpp_vtable Object::handle_vtable_ = 0; 54 cpp_vtable Object::handle_vtable_ = 0;
(...skipping 3396 matching lines...) Expand 10 before | Expand all | Expand 10 after
3449 ASSERT(num_optional_parameters >= 0); 3451 ASSERT(num_optional_parameters >= 0);
3450 set_num_optional_parameters(are_optional_positional ? 3452 set_num_optional_parameters(are_optional_positional ?
3451 num_optional_parameters : 3453 num_optional_parameters :
3452 -num_optional_parameters); 3454 -num_optional_parameters);
3453 } 3455 }
3454 3456
3455 3457
3456 bool Function::is_optimizable() const { 3458 bool Function::is_optimizable() const {
3457 return OptimizableBit::decode(raw_ptr()->kind_tag_) && 3459 return OptimizableBit::decode(raw_ptr()->kind_tag_) &&
3458 (script() != Script::null()) && 3460 (script() != Script::null()) &&
3459 !is_native(); 3461 !is_native() &&
3462 ((end_token_pos() - token_pos()) < FLAG_huge_method_cutoff);
3460 } 3463 }
3461 3464
3462 3465
3463 void Function::set_is_optimizable(bool value) const { 3466 void Function::set_is_optimizable(bool value) const {
3464 set_kind_tag(OptimizableBit::update(value, raw_ptr()->kind_tag_)); 3467 set_kind_tag(OptimizableBit::update(value, raw_ptr()->kind_tag_));
3465 } 3468 }
3466 3469
3467 3470
3468 void Function::set_has_finally(bool value) const { 3471 void Function::set_has_finally(bool value) const {
3469 set_kind_tag(HasFinallyBit::update(value, raw_ptr()->kind_tag_)); 3472 set_kind_tag(HasFinallyBit::update(value, raw_ptr()->kind_tag_));
(...skipping 8959 matching lines...) Expand 10 before | Expand all | Expand 10 after
12429 } 12432 }
12430 return result.raw(); 12433 return result.raw();
12431 } 12434 }
12432 12435
12433 12436
12434 const char* WeakProperty::ToCString() const { 12437 const char* WeakProperty::ToCString() const {
12435 return "_WeakProperty"; 12438 return "_WeakProperty";
12436 } 12439 }
12437 12440
12438 } // namespace dart 12441 } // 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