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

Unified Diff: src/objects-inl.h

Issue 2052763003: [ic] [stubs] Remove InlineCacheState field from the code flags. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebasing Created 4 years, 6 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 | « src/objects.cc ('k') | test/cctest/heap/test-heap.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index 7cdcb056ff293dbe357041a694eb90dfdf02d9f0..25e1d7d74b4c70993c4367a81e65a2270ecad947 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -14,6 +14,7 @@
#include "src/base/atomicops.h"
#include "src/base/bits.h"
+#include "src/builtins.h"
#include "src/contexts-inl.h"
#include "src/conversions-inl.h"
#include "src/factory.h"
@@ -4858,20 +4859,9 @@ bool Code::IsCodeStubOrIC() {
kind() == COMPARE_IC || kind() == TO_BOOLEAN_IC;
}
-InlineCacheState Code::ic_state() {
- InlineCacheState result = ExtractICStateFromFlags(flags());
- // Only allow uninitialized or debugger states for non-IC code
- // objects. This is used in the debugger to determine whether or not
- // a call to code object has been replaced with a debug break call.
- DCHECK(is_inline_cache_stub() ||
- result == UNINITIALIZED ||
- result == DEBUG_STUB);
- return result;
-}
-
ExtraICState Code::extra_ic_state() {
- DCHECK(is_inline_cache_stub() || ic_state() == DEBUG_STUB);
+ DCHECK(is_inline_cache_stub() || is_debug_stub());
return ExtractExtraICStateFromFlags(flags());
}
@@ -5107,7 +5097,18 @@ bool Code::is_inline_cache_stub() {
}
}
-bool Code::is_debug_stub() { return ic_state() == DEBUG_STUB; }
+bool Code::is_debug_stub() {
+ if (kind() != BUILTIN) return false;
+ switch (builtin_index()) {
+#define CASE_DEBUG_BUILTIN(name, kind, extra) case Builtins::k##name:
+ BUILTIN_LIST_DEBUG_A(CASE_DEBUG_BUILTIN)
+#undef CASE_DEBUG_BUILTIN
+ return true;
+ default:
+ return false;
+ }
+ return false;
+}
bool Code::is_handler() { return kind() == HANDLER; }
bool Code::is_call_stub() { return kind() == CALL_IC; }
bool Code::is_binary_op_stub() { return kind() == BINARY_OP_IC; }
@@ -5116,14 +5117,6 @@ bool Code::is_to_boolean_ic_stub() { return kind() == TO_BOOLEAN_IC; }
bool Code::is_optimized_code() { return kind() == OPTIMIZED_FUNCTION; }
bool Code::is_wasm_code() { return kind() == WASM_FUNCTION; }
-bool Code::embeds_maps_weakly() {
- Kind k = kind();
- return (k == LOAD_IC || k == STORE_IC || k == KEYED_LOAD_IC ||
- k == KEYED_STORE_IC) &&
- ic_state() == MONOMORPHIC;
-}
-
-
Address Code::constant_pool() {
Address constant_pool = NULL;
if (FLAG_enable_embedded_constant_pool) {
@@ -5135,25 +5128,18 @@ Address Code::constant_pool() {
return constant_pool;
}
-Code::Flags Code::ComputeFlags(Kind kind, InlineCacheState ic_state,
- ExtraICState extra_ic_state,
+Code::Flags Code::ComputeFlags(Kind kind, ExtraICState extra_ic_state,
CacheHolderFlag holder) {
// Compute the bit mask.
- unsigned int bits = KindField::encode(kind) | ICStateField::encode(ic_state) |
+ unsigned int bits = KindField::encode(kind) |
ExtraICStateField::encode(extra_ic_state) |
CacheHolderField::encode(holder);
return static_cast<Flags>(bits);
}
-Code::Flags Code::ComputeMonomorphicFlags(Kind kind,
- ExtraICState extra_ic_state,
- CacheHolderFlag holder) {
- return ComputeFlags(kind, MONOMORPHIC, extra_ic_state, holder);
-}
-
Code::Flags Code::ComputeHandlerFlags(Kind handler_kind,
CacheHolderFlag holder) {
- return ComputeFlags(Code::HANDLER, MONOMORPHIC, handler_kind, holder);
+ return ComputeFlags(Code::HANDLER, handler_kind, holder);
}
@@ -5162,11 +5148,6 @@ Code::Kind Code::ExtractKindFromFlags(Flags flags) {
}
-InlineCacheState Code::ExtractICStateFromFlags(Flags flags) {
- return ICStateField::decode(flags);
-}
-
-
ExtraICState Code::ExtractExtraICStateFromFlags(Flags flags) {
return ExtraICStateField::decode(flags);
}
« no previous file with comments | « src/objects.cc ('k') | test/cctest/heap/test-heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698