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

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

Issue 468793004: VM: Improve performance of method recognizer and unify the it with the intrinsifier. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/symbols.h » ('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/cpu.h" 10 #include "vm/cpu.h"
(...skipping 5462 matching lines...) Expand 10 before | Expand all | Expand 10 after
5473 void Function::set_modifier(RawFunction::AsyncModifier value) const { 5473 void Function::set_modifier(RawFunction::AsyncModifier value) const {
5474 set_kind_tag(ModifierBits::update(value, raw_ptr()->kind_tag_)); 5474 set_kind_tag(ModifierBits::update(value, raw_ptr()->kind_tag_));
5475 } 5475 }
5476 5476
5477 5477
5478 void Function::set_is_intrinsic(bool value) const { 5478 void Function::set_is_intrinsic(bool value) const {
5479 set_kind_tag(IntrinsicBit::update(value, raw_ptr()->kind_tag_)); 5479 set_kind_tag(IntrinsicBit::update(value, raw_ptr()->kind_tag_));
5480 } 5480 }
5481 5481
5482 5482
5483 void Function::set_is_recognized(bool value) const { 5483 void Function::set_recognized_kind(MethodRecognizer::Kind value) const {
5484 set_kind_tag(RecognizedBit::update(value, raw_ptr()->kind_tag_)); 5484 set_kind_tag(RecognizedBits::update(value, raw_ptr()->kind_tag_));
5485 } 5485 }
5486 5486
5487 5487
5488 void Function::set_is_redirecting(bool value) const { 5488 void Function::set_is_redirecting(bool value) const {
5489 set_kind_tag(RedirectingBit::update(value, raw_ptr()->kind_tag_)); 5489 set_kind_tag(RedirectingBit::update(value, raw_ptr()->kind_tag_));
5490 } 5490 }
5491 5491
5492 5492
5493 void Function::set_is_static(bool value) const { 5493 void Function::set_is_static(bool value) const {
5494 set_kind_tag(StaticBit::update(value, raw_ptr()->kind_tag_)); 5494 set_kind_tag(StaticBit::update(value, raw_ptr()->kind_tag_));
(...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after
6102 bool is_external, 6102 bool is_external,
6103 bool is_native, 6103 bool is_native,
6104 const Object& owner, 6104 const Object& owner,
6105 intptr_t token_pos) { 6105 intptr_t token_pos) {
6106 ASSERT(!owner.IsNull()); 6106 ASSERT(!owner.IsNull());
6107 const Function& result = Function::Handle(Function::New()); 6107 const Function& result = Function::Handle(Function::New());
6108 result.set_parameter_types(Object::empty_array()); 6108 result.set_parameter_types(Object::empty_array());
6109 result.set_parameter_names(Object::empty_array()); 6109 result.set_parameter_names(Object::empty_array());
6110 result.set_name(name); 6110 result.set_name(name);
6111 result.set_kind(kind); 6111 result.set_kind(kind);
6112 result.set_recognized_kind(MethodRecognizer::kUnknown);
6112 result.set_modifier(RawFunction::kNoModifier); 6113 result.set_modifier(RawFunction::kNoModifier);
6113 result.set_is_static(is_static); 6114 result.set_is_static(is_static);
6114 result.set_is_const(is_const); 6115 result.set_is_const(is_const);
6115 result.set_is_abstract(is_abstract); 6116 result.set_is_abstract(is_abstract);
6116 result.set_is_external(is_external); 6117 result.set_is_external(is_external);
6117 result.set_is_native(is_native); 6118 result.set_is_native(is_native);
6118 result.set_is_visible(true); // Will be computed later. 6119 result.set_is_visible(true); // Will be computed later.
6119 result.set_is_intrinsic(false); 6120 result.set_is_intrinsic(false);
6120 result.set_is_recognized(false);
6121 result.set_is_redirecting(false); 6121 result.set_is_redirecting(false);
6122 result.set_is_async_closure(false); 6122 result.set_is_async_closure(false);
6123 result.set_always_inline(false);
6124 result.set_is_polymorphic_target(false);
6123 result.set_owner(owner); 6125 result.set_owner(owner);
6124 result.set_token_pos(token_pos); 6126 result.set_token_pos(token_pos);
6125 result.set_end_token_pos(token_pos); 6127 result.set_end_token_pos(token_pos);
6126 result.set_num_fixed_parameters(0); 6128 result.set_num_fixed_parameters(0);
6127 result.set_num_optional_parameters(0); 6129 result.set_num_optional_parameters(0);
6128 result.set_usage_counter(0); 6130 result.set_usage_counter(0);
6129 result.set_deoptimization_counter(0); 6131 result.set_deoptimization_counter(0);
6130 result.set_optimized_instruction_count(0); 6132 result.set_optimized_instruction_count(0);
6131 result.set_optimized_call_site_count(0); 6133 result.set_optimized_call_site_count(0);
6132 result.set_is_optimizable(is_native ? false : true); 6134 result.set_is_optimizable(is_native ? false : true);
(...skipping 4180 matching lines...) Expand 10 before | Expand all | Expand 10 after
10313 func.ToFullyQualifiedCString(), fp, func.SourceFingerprint()); \ 10315 func.ToFullyQualifiedCString(), fp, func.SourceFingerprint()); \
10314 collected_fp_diffs.Add(FpDiff(fp, func.SourceFingerprint())); \ 10316 collected_fp_diffs.Add(FpDiff(fp, func.SourceFingerprint())); \
10315 } \ 10317 } \
10316 10318
10317 all_libs.Add(&Library::ZoneHandle(Library::CoreLibrary())); 10319 all_libs.Add(&Library::ZoneHandle(Library::CoreLibrary()));
10318 CORE_LIB_INTRINSIC_LIST(CHECK_FINGERPRINTS); 10320 CORE_LIB_INTRINSIC_LIST(CHECK_FINGERPRINTS);
10319 CORE_INTEGER_LIB_INTRINSIC_LIST(CHECK_FINGERPRINTS); 10321 CORE_INTEGER_LIB_INTRINSIC_LIST(CHECK_FINGERPRINTS);
10320 10322
10321 all_libs.Add(&Library::ZoneHandle(Library::MathLibrary())); 10323 all_libs.Add(&Library::ZoneHandle(Library::MathLibrary()));
10322 all_libs.Add(&Library::ZoneHandle(Library::TypedDataLibrary())); 10324 all_libs.Add(&Library::ZoneHandle(Library::TypedDataLibrary()));
10323 RECOGNIZED_LIST(CHECK_FINGERPRINTS); 10325 OTHER_RECOGNIZED_LIST(CHECK_FINGERPRINTS);
10324 INLINE_WHITE_LIST(CHECK_FINGERPRINTS); 10326 INLINE_WHITE_LIST(CHECK_FINGERPRINTS);
10325 POLYMORPHIC_TARGET_LIST(CHECK_FINGERPRINTS); 10327 POLYMORPHIC_TARGET_LIST(CHECK_FINGERPRINTS);
10326 10328
10327 all_libs.Clear(); 10329 all_libs.Clear();
10328 all_libs.Add(&Library::ZoneHandle(Library::MathLibrary())); 10330 all_libs.Add(&Library::ZoneHandle(Library::MathLibrary()));
10329 MATH_LIB_INTRINSIC_LIST(CHECK_FINGERPRINTS); 10331 MATH_LIB_INTRINSIC_LIST(CHECK_FINGERPRINTS);
10330 10332
10331 all_libs.Clear(); 10333 all_libs.Clear();
10332 all_libs.Add(&Library::ZoneHandle(Library::TypedDataLibrary())); 10334 all_libs.Add(&Library::ZoneHandle(Library::TypedDataLibrary()));
10333 TYPED_DATA_LIB_INTRINSIC_LIST(CHECK_FINGERPRINTS); 10335 TYPED_DATA_LIB_INTRINSIC_LIST(CHECK_FINGERPRINTS);
10334 10336
10337 all_libs.Clear();
10338 all_libs.Add(&Library::ZoneHandle(Library::ProfilerLibrary()));
10339 PROFILER_LIB_INTRINSIC_LIST(CHECK_FINGERPRINTS);
10340
10335 #undef CHECK_FINGERPRINTS 10341 #undef CHECK_FINGERPRINTS
10336 10342
10337 Class& cls = Class::Handle(); 10343 Class& cls = Class::Handle();
10338 10344
10339 #define CHECK_FACTORY_FINGERPRINTS(factory_symbol, cid, fp) \ 10345 #define CHECK_FACTORY_FINGERPRINTS(factory_symbol, cid, fp) \
10340 cls = Isolate::Current()->class_table()->At(cid); \ 10346 cls = Isolate::Current()->class_table()->At(cid); \
10341 func = cls.LookupFunctionAllowPrivate(Symbols::factory_symbol()); \ 10347 func = cls.LookupFunctionAllowPrivate(Symbols::factory_symbol()); \
10342 if (func.IsNull()) { \ 10348 if (func.IsNull()) { \
10343 has_errors = true; \ 10349 has_errors = true; \
10344 OS::Print("Function not found %s.%s\n", cls.ToCString(), \ 10350 OS::Print("Function not found %s.%s\n", cls.ToCString(), \
(...skipping 9128 matching lines...) Expand 10 before | Expand all | Expand 10 after
19473 return tag_label.ToCString(); 19479 return tag_label.ToCString();
19474 } 19480 }
19475 19481
19476 19482
19477 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { 19483 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const {
19478 Instance::PrintJSONImpl(stream, ref); 19484 Instance::PrintJSONImpl(stream, ref);
19479 } 19485 }
19480 19486
19481 19487
19482 } // namespace dart 19488 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/symbols.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698