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

Unified Diff: runtime/vm/object.h

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/method_recognizer.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.h
===================================================================
--- runtime/vm/object.h (revision 39404)
+++ runtime/vm/object.h (working copy)
@@ -15,6 +15,7 @@
#include "vm/handles.h"
#include "vm/heap.h"
#include "vm/isolate.h"
+#include "vm/method_recognizer.h"
#include "vm/os.h"
#include "vm/raw_object.h"
#include "vm/report.h"
@@ -1839,11 +1840,15 @@
}
void set_is_intrinsic(bool value) const;
- bool is_recognized() const {
- return RecognizedBit::decode(raw_ptr()->kind_tag_);
+ MethodRecognizer::Kind recognized_kind() const {
+ return RecognizedBits::decode(raw_ptr()->kind_tag_);
}
- void set_is_recognized(bool value) const;
+ void set_recognized_kind(MethodRecognizer::Kind value) const;
+ bool IsRecognized() const {
+ return recognized_kind() != MethodRecognizer::kUnknown;
+ }
+
bool is_redirecting() const {
return RedirectingBit::decode(raw_ptr()->kind_tag_);
}
@@ -1854,6 +1859,21 @@
}
void set_allows_hoisting_check_class(bool value) const;
+ bool always_inline() const {
+ return AlwaysInlineBit::decode(raw_ptr()->kind_tag_);
+ }
+ void set_always_inline(bool value) const {
+ set_kind_tag(AlwaysInlineBit::update(value, raw_ptr()->kind_tag_));
+ }
+
+ bool is_polymorphic_target() const {
+ return PolymorphicTargetBit::decode(raw_ptr()->kind_tag_);
+ }
+ void set_is_polymorphic_target(bool value) const {
+ set_kind_tag(PolymorphicTargetBit::update(value, raw_ptr()->kind_tag_));
+ }
+
+
bool HasOptimizedCode() const;
// Returns true if the argument counts are valid for calling this function.
@@ -2027,23 +2047,37 @@
enum KindTagBits {
kKindTagPos = 0,
kKindTagSize = 4,
- kStaticBit = kKindTagPos + kKindTagSize, // = 4
- kConstBit = 5,
- kAbstractBit = 6,
- kVisibleBit = 7,
- kOptimizableBit = 8,
- kInlinableBit = 9,
- kIntrinsicBit = 10,
- kRecognizedBit = 11,
- kNativeBit = 12,
- kRedirectingBit = 13,
- kExternalBit = 14,
- kAllowsHoistingCheckClassBit = 15,
- kModifierPos = 16,
- kAsyncClosureBit = 17,
+ kRecognizedTagPos = kKindTagPos + kKindTagSize,
+ kRecognizedTagSize = 8,
+ // Single bit sized fields start here.
+ kStaticBit = kRecognizedTagPos + kRecognizedTagSize,
+ kConstBit,
+ kAbstractBit,
+ kVisibleBit,
+ kOptimizableBit,
+ kInlinableBit,
+ kIntrinsicBit,
+ kNativeBit,
+ kRedirectingBit,
+ kExternalBit,
+ kAllowsHoistingCheckClassBit,
+ kModifierPos,
+ kAsyncClosureBit,
+ kAlwaysInlineBit,
+ kPolymorphicTargetBit,
+ kNumTagBits
};
+
+ COMPILE_ASSERT(
+ MethodRecognizer::kNumRecognizedMethods < (1 << kRecognizedTagSize));
+ COMPILE_ASSERT(
+ kNumTagBits <= (kBitsPerByte * sizeof(RawFunction::kind_tag_)));
+
class KindBits :
public BitField<RawFunction::Kind, kKindTagPos, kKindTagSize> {}; // NOLINT
+ class RecognizedBits : public BitField<MethodRecognizer::Kind,
+ kRecognizedTagPos,
+ kRecognizedTagSize> {};
class StaticBit : public BitField<bool, kStaticBit, 1> {};
class ConstBit : public BitField<bool, kConstBit, 1> {};
class AbstractBit : public BitField<bool, kAbstractBit, 1> {};
@@ -2051,7 +2085,6 @@
class OptimizableBit : public BitField<bool, kOptimizableBit, 1> {};
class InlinableBit : public BitField<bool, kInlinableBit, 1> {};
class IntrinsicBit : public BitField<bool, kIntrinsicBit, 1> {};
- class RecognizedBit : public BitField<bool, kRecognizedBit, 1> {};
class NativeBit : public BitField<bool, kNativeBit, 1> {};
class ExternalBit : public BitField<bool, kExternalBit, 1> {};
class RedirectingBit : public BitField<bool, kRedirectingBit, 1> {};
@@ -2060,6 +2093,9 @@
class ModifierBits :
public BitField<RawFunction::AsyncModifier, kModifierPos, 1> {}; // NOLINT
class AsyncClosureBit : public BitField<bool, kAsyncClosureBit, 1> {};
+ class AlwaysInlineBit : public BitField<bool, kAlwaysInlineBit, 1> {};
+ class PolymorphicTargetBit :
+ public BitField<bool, kPolymorphicTargetBit, 1> {}; // NOLINT
void set_name(const String& value) const;
void set_kind(RawFunction::Kind value) const;
« no previous file with comments | « runtime/vm/method_recognizer.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698