Chromium Code Reviews| 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); |
| }; |