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

Unified Diff: src/interpreter/interpreter.h

Issue 1817033002: [Interpreter] Add dispatch counters for each bytecode. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@fix-abort
Patch Set: Remove unused bailout reason, rebase on master. Created 4 years, 8 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
Index: src/interpreter/interpreter.h
diff --git a/src/interpreter/interpreter.h b/src/interpreter/interpreter.h
index 075fe741e943f064f22184c727cc04c823ea3fb3..4f1edfa1f385183c3e584b35615021d257852afe 100644
--- a/src/interpreter/interpreter.h
+++ b/src/interpreter/interpreter.h
@@ -53,10 +53,19 @@ class Interpreter {
return reinterpret_cast<Address>(&dispatch_table_[0]);
}
+ uint32_t* handlers_dispatch_counters() {
+ return &handlers_dispatch_counters_[0];
+ }
+
// Returns true if a handler is generated for a bytecode at a given
// operand scale.
static bool BytecodeHasHandler(Bytecode bytecode, OperandScale operand_scale);
+ static const int kNumberOfWideVariants = 3;
+ static const int kDispatchTableSize = kNumberOfWideVariants * (kMaxUInt8 + 1);
+ static const int kCountersTableRowSize =
+ static_cast<int>(Bytecode::kLast) + 1;
rmcilroy 2016/04/05 10:00:46 Please keep these private. I don't think you need
Stefano Sanfilippo 2016/04/05 14:01:46 Moved to private. I'd be in favour of keeping the
+
private:
// Bytecode handler generator functions.
#define DECLARE_BYTECODE_HANDLER_GENERATOR(Name, ...) \
@@ -140,11 +149,9 @@ class Interpreter {
bool IsDispatchTableInitialized();
- static const int kNumberOfWideVariants = 3;
- static const int kDispatchTableSize = kNumberOfWideVariants * (kMaxUInt8 + 1);
-
Isolate* isolate_;
Code* dispatch_table_[kDispatchTableSize];
+ uint32_t handlers_dispatch_counters_[kCountersTableRowSize];
rmcilroy 2016/04/05 10:00:46 Could we make this a smart pointer which is only a
Stefano Sanfilippo 2016/04/05 14:01:46 I replaced the array with a std::vector which gets
DISALLOW_COPY_AND_ASSIGN(Interpreter);
};

Powered by Google App Engine
This is Rietveld 408576698