| OLD | NEW | 
|   1 // Copyright 2016 the V8 project authors. All rights reserved. |   1 // Copyright 2016 the V8 project authors. All rights reserved. | 
|   2 // Use of this source code is governed by a BSD-style license that can be |   2 // Use of this source code is governed by a BSD-style license that can be | 
|   3 // found in the LICENSE file. |   3 // found in the LICENSE file. | 
|   4  |   4  | 
|   5 #ifndef V8_INTERPRETER_HANDLER_TABLE_BUILDER_H_ |   5 #ifndef V8_INTERPRETER_HANDLER_TABLE_BUILDER_H_ | 
|   6 #define V8_INTERPRETER_HANDLER_TABLE_BUILDER_H_ |   6 #define V8_INTERPRETER_HANDLER_TABLE_BUILDER_H_ | 
|   7  |   7  | 
|   8 #include "src/handles.h" |   8 #include "src/handles.h" | 
|   9 #include "src/interpreter/bytecode-register.h" |   9 #include "src/interpreter/bytecode-register.h" | 
|  10 #include "src/interpreter/bytecodes.h" |  10 #include "src/interpreter/bytecodes.h" | 
| (...skipping 19 matching lines...) Expand all  Loading... | 
|  30   // Creates a new handler table entry and returns a {hander_id} identifying the |  30   // Creates a new handler table entry and returns a {hander_id} identifying the | 
|  31   // entry, so that it can be referenced by below setter functions. |  31   // entry, so that it can be referenced by below setter functions. | 
|  32   int NewHandlerEntry(); |  32   int NewHandlerEntry(); | 
|  33  |  33  | 
|  34   // Setter functions that modify certain values within the handler table entry |  34   // Setter functions that modify certain values within the handler table entry | 
|  35   // being referenced by the given {handler_id}. All values will be encoded by |  35   // being referenced by the given {handler_id}. All values will be encoded by | 
|  36   // the resulting {HandlerTable} class when copied into the heap. |  36   // the resulting {HandlerTable} class when copied into the heap. | 
|  37   void SetTryRegionStart(int handler_id, size_t offset); |  37   void SetTryRegionStart(int handler_id, size_t offset); | 
|  38   void SetTryRegionEnd(int handler_id, size_t offset); |  38   void SetTryRegionEnd(int handler_id, size_t offset); | 
|  39   void SetHandlerTarget(int handler_id, size_t offset); |  39   void SetHandlerTarget(int handler_id, size_t offset); | 
|  40   void SetPrediction(int handler_id, bool will_catch); |  40   void SetPrediction(int handler_id, HandlerTable::CatchPrediction prediction); | 
|  41   void SetContextRegister(int handler_id, Register reg); |  41   void SetContextRegister(int handler_id, Register reg); | 
|  42  |  42  | 
|  43  private: |  43  private: | 
|  44   struct Entry { |  44   struct Entry { | 
|  45     size_t offset_start;   // Bytecode offset starting try-region. |  45     size_t offset_start;   // Bytecode offset starting try-region. | 
|  46     size_t offset_end;     // Bytecode offset ending try-region. |  46     size_t offset_end;     // Bytecode offset ending try-region. | 
|  47     size_t offset_target;  // Bytecode offset of handler target. |  47     size_t offset_target;  // Bytecode offset of handler target. | 
|  48     Register context;      // Register holding context for handler. |  48     Register context;      // Register holding context for handler. | 
|  49     bool will_catch;       // Optimistic prediction for handler. |  49                            // Optimistic prediction for handler. | 
 |  50     HandlerTable::CatchPrediction catch_prediction_; | 
|  50   }; |  51   }; | 
|  51  |  52  | 
|  52   Isolate* isolate_; |  53   Isolate* isolate_; | 
|  53   ZoneVector<Entry> entries_; |  54   ZoneVector<Entry> entries_; | 
|  54  |  55  | 
|  55   DISALLOW_COPY_AND_ASSIGN(HandlerTableBuilder); |  56   DISALLOW_COPY_AND_ASSIGN(HandlerTableBuilder); | 
|  56 }; |  57 }; | 
|  57  |  58  | 
|  58 }  // namespace interpreter |  59 }  // namespace interpreter | 
|  59 }  // namespace internal |  60 }  // namespace internal | 
|  60 }  // namespace v8 |  61 }  // namespace v8 | 
|  61  |  62  | 
|  62 #endif  // V8_INTERPRETER_HANDLER_TABLE_BUILDER_H_ |  63 #endif  // V8_INTERPRETER_HANDLER_TABLE_BUILDER_H_ | 
| OLD | NEW |