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

Unified Diff: src/objects-inl.h

Issue 115744: This patch much improves our tracking of whether function is... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 7 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
« src/ic.cc ('K') | « src/objects.cc ('k') | src/runtime.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-inl.h
===================================================================
--- src/objects-inl.h (revision 2034)
+++ src/objects-inl.h (working copy)
@@ -1897,6 +1897,11 @@
}
+InlineCacheInLoop Code::ic_in_loop() {
+ return ExtractICInLoopFromFlags(flags());
+}
+
+
InlineCacheState Code::ic_state() {
InlineCacheState result = ExtractICStateFromFlags(flags());
// Only allow uninitialized or debugger states for non-IC code
@@ -1943,11 +1948,13 @@
Code::Flags Code::ComputeFlags(Kind kind,
+ InlineCacheInLoop in_loop,
InlineCacheState ic_state,
PropertyType type,
int argc) {
// Compute the bit mask.
int bits = kind << kFlagsKindShift;
+ if (in_loop) bits |= kFlagsICInLoopMask;
Kevin Millikin (Chromium) 2009/05/25 11:00:42 if (in_loop == IN_LOOP) ...
bits |= ic_state << kFlagsICStateShift;
bits |= type << kFlagsTypeShift;
bits |= argc << kFlagsArgumentsCountShift;
@@ -1955,6 +1962,7 @@
Flags result = static_cast<Flags>(bits);
ASSERT(ExtractKindFromFlags(result) == kind);
ASSERT(ExtractICStateFromFlags(result) == ic_state);
+ ASSERT(ExtractICInLoopFromFlags(result) == in_loop);
ASSERT(ExtractTypeFromFlags(result) == type);
ASSERT(ExtractArgumentsCountFromFlags(result) == argc);
return result;
@@ -1963,8 +1971,9 @@
Code::Flags Code::ComputeMonomorphicFlags(Kind kind,
PropertyType type,
+ InlineCacheInLoop in_loop,
int argc) {
- return ComputeFlags(kind, MONOMORPHIC, type, argc);
+ return ComputeFlags(kind, in_loop, MONOMORPHIC, type, argc);
}
@@ -1980,6 +1989,12 @@
}
+InlineCacheInLoop Code::ExtractICInLoopFromFlags(Flags flags) {
+ int bits = (flags & kFlagsICInLoopMask);
+ return bits != 0 ? IN_LOOP : NOT_IN_LOOP;
+}
+
+
PropertyType Code::ExtractTypeFromFlags(Flags flags) {
int bits = (flags & kFlagsTypeMask) >> kFlagsTypeShift;
return static_cast<PropertyType>(bits);
« src/ic.cc ('K') | « src/objects.cc ('k') | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698