Revision f230a1cf deps/v8/src/deoptimizer.h

View differences:

deps/v8/src/deoptimizer.h
60 60
class TranslationIterator;
61 61
class DeoptimizedFrameInfo;
62 62

  
63
template<typename T>
63 64
class HeapNumberMaterializationDescriptor BASE_EMBEDDED {
64 65
 public:
65
  HeapNumberMaterializationDescriptor(Address slot_address, double val)
66
      : slot_address_(slot_address), val_(val) { }
66
  HeapNumberMaterializationDescriptor(T destination, double value)
67
      : destination_(destination), value_(value) { }
67 68

  
68
  Address slot_address() const { return slot_address_; }
69
  double value() const { return val_; }
69
  T destination() const { return destination_; }
70
  double value() const { return value_; }
70 71

  
71 72
 private:
72
  Address slot_address_;
73
  double val_;
73
  T destination_;
74
  double value_;
74 75
};
75 76

  
76 77

  
......
131 132
    DEBUGGER
132 133
  };
133 134

  
134
  enum InterruptPatchState {
135
    NOT_PATCHED,
136
    PATCHED_FOR_OSR
137
  };
138

  
139 135
  static const int kBailoutTypesWithCodeEntry = SOFT + 1;
140 136

  
141 137
  struct JumpTableEntry {
......
213 209
  // The size in bytes of the code required at a lazy deopt patch site.
214 210
  static int patch_size();
215 211

  
216
  // Patch all interrupts with allowed loop depth in the unoptimized code to
217
  // unconditionally call replacement_code.
218
  static void PatchInterruptCode(Isolate* isolate,
219
                                 Code* unoptimized_code);
220

  
221
  // Patch the interrupt at the instruction before pc_after in
222
  // the unoptimized code to unconditionally call replacement_code.
223
  static void PatchInterruptCodeAt(Code* unoptimized_code,
224
                                   Address pc_after,
225
                                   Code* replacement_code);
226

  
227
  // Change all patched interrupts patched in the unoptimized code
228
  // back to normal interrupts.
229
  static void RevertInterruptCode(Isolate* isolate,
230
                                  Code* unoptimized_code);
231

  
232
  // Change patched interrupt in the unoptimized code
233
  // back to a normal interrupt.
234
  static void RevertInterruptCodeAt(Code* unoptimized_code,
235
                                    Address pc_after,
236
                                    Code* interrupt_code);
237

  
238
#ifdef DEBUG
239
  static InterruptPatchState GetInterruptPatchState(Isolate* isolate,
240
                                                    Code* unoptimized_code,
241
                                                    Address pc_after);
242

  
243
  // Verify that all back edges of a certain loop depth are patched.
244
  static bool VerifyInterruptCode(Isolate* isolate,
245
                                  Code* unoptimized_code,
246
                                  int loop_nesting_level);
247
#endif  // DEBUG
248

  
249 212
  ~Deoptimizer();
250 213

  
251 214
  void MaterializeHeapObjects(JavaScriptFrameIterator* it);
......
469 432

  
470 433
  // Deferred values to be materialized.
471 434
  List<Object*> deferred_objects_tagged_values_;
472
  List<double> deferred_objects_double_values_;
435
  List<HeapNumberMaterializationDescriptor<int> >
436
      deferred_objects_double_values_;
473 437
  List<ObjectMaterializationDescriptor> deferred_objects_;
474
  List<HeapNumberMaterializationDescriptor> deferred_heap_numbers_;
438
  List<HeapNumberMaterializationDescriptor<Address> > deferred_heap_numbers_;
475 439

  
476 440
  // Output frame information. Only used during heap object materialization.
477 441
  List<Handle<JSFunction> > jsframe_functions_;
......
542 506
  void SetCallerFp(unsigned offset, intptr_t value);
543 507

  
544 508
  intptr_t GetRegister(unsigned n) const {
545
    ASSERT(n < ARRAY_SIZE(registers_));
509
#if DEBUG
510
    // This convoluted ASSERT is needed to work around a gcc problem that
511
    // improperly detects an array bounds overflow in optimized debug builds
512
    // when using a plain ASSERT.
513
    if (n >= ARRAY_SIZE(registers_)) {
514
      ASSERT(false);
515
      return 0;
516
    }
517
#endif
546 518
    return registers_[n];
547 519
  }
548 520

  
......
717 689
};
718 690

  
719 691

  
692
#define TRANSLATION_OPCODE_LIST(V)                                             \
693
  V(BEGIN)                                                                     \
694
  V(JS_FRAME)                                                                  \
695
  V(CONSTRUCT_STUB_FRAME)                                                      \
696
  V(GETTER_STUB_FRAME)                                                         \
697
  V(SETTER_STUB_FRAME)                                                         \
698
  V(ARGUMENTS_ADAPTOR_FRAME)                                                   \
699
  V(COMPILED_STUB_FRAME)                                                       \
700
  V(DUPLICATED_OBJECT)                                                         \
701
  V(ARGUMENTS_OBJECT)                                                          \
702
  V(CAPTURED_OBJECT)                                                           \
703
  V(REGISTER)                                                                  \
704
  V(INT32_REGISTER)                                                            \
705
  V(UINT32_REGISTER)                                                           \
706
  V(DOUBLE_REGISTER)                                                           \
707
  V(STACK_SLOT)                                                                \
708
  V(INT32_STACK_SLOT)                                                          \
709
  V(UINT32_STACK_SLOT)                                                         \
710
  V(DOUBLE_STACK_SLOT)                                                         \
711
  V(LITERAL)
712

  
713

  
720 714
class Translation BASE_EMBEDDED {
721 715
 public:
716
#define DECLARE_TRANSLATION_OPCODE_ENUM(item) item,
722 717
  enum Opcode {
723
    BEGIN,
724
    JS_FRAME,
725
    CONSTRUCT_STUB_FRAME,
726
    GETTER_STUB_FRAME,
727
    SETTER_STUB_FRAME,
728
    ARGUMENTS_ADAPTOR_FRAME,
729
    COMPILED_STUB_FRAME,
730
    DUPLICATED_OBJECT,
731
    ARGUMENTS_OBJECT,
732
    CAPTURED_OBJECT,
733
    REGISTER,
734
    INT32_REGISTER,
735
    UINT32_REGISTER,
736
    DOUBLE_REGISTER,
737
    STACK_SLOT,
738
    INT32_STACK_SLOT,
739
    UINT32_STACK_SLOT,
740
    DOUBLE_STACK_SLOT,
741
    LITERAL
718
    TRANSLATION_OPCODE_LIST(DECLARE_TRANSLATION_OPCODE_ENUM)
719
    LAST = LITERAL
742 720
  };
721
#undef DECLARE_TRANSLATION_OPCODE_ENUM
743 722

  
744 723
  Translation(TranslationBuffer* buffer, int frame_count, int jsframe_count,
745 724
              Zone* zone)

Also available in: Unified diff