| Index: src/deoptimizer.h
|
| diff --git a/src/deoptimizer.h b/src/deoptimizer.h
|
| index cd33477e26bc262d900c3d2758b934890f355036..e988135d58c44fa554d724d13aacad571f86da00 100644
|
| --- a/src/deoptimizer.h
|
| +++ b/src/deoptimizer.h
|
| @@ -76,6 +76,26 @@ class OptimizedFunctionVisitor BASE_EMBEDDED {
|
| class Deoptimizer;
|
|
|
|
|
| +// Linked list holding deoptimizing code objects. The deoptimizing code objects
|
| +// are kept as weak handles until they are no longer activated on the stack.
|
| +class DeoptimizingCodeListNode : public Malloced {
|
| + public:
|
| + explicit DeoptimizingCodeListNode(Code* code);
|
| + ~DeoptimizingCodeListNode();
|
| +
|
| + DeoptimizingCodeListNode* next() const { return next_; }
|
| + void set_next(DeoptimizingCodeListNode* next) { next_ = next; }
|
| + Handle<Code> code() const { return code_; }
|
| +
|
| + private:
|
| + // Global (weak) handle to the deoptimizing code object.
|
| + Handle<Code> code_;
|
| +
|
| + // Next pointer for linked list.
|
| + DeoptimizingCodeListNode* next_;
|
| +};
|
| +
|
| +
|
| class DeoptimizerData {
|
| public:
|
| DeoptimizerData();
|
| @@ -85,6 +105,12 @@ class DeoptimizerData {
|
| void Iterate(ObjectVisitor* v);
|
| #endif
|
|
|
| + void append_deoptimizing_code(Code* code) {
|
| + DeoptimizingCodeListNode* head = new DeoptimizingCodeListNode(code);
|
| + head->set_next(deoptimizing_code_list_);
|
| + deoptimizing_code_list_ = head;
|
| + }
|
| +
|
| private:
|
| MemoryChunk* eager_deoptimization_entry_code_;
|
| MemoryChunk* lazy_deoptimization_entry_code_;
|
| @@ -101,6 +127,7 @@ class DeoptimizerData {
|
| DeoptimizingCodeListNode* deoptimizing_code_list_;
|
|
|
| friend class Deoptimizer;
|
| + friend class Isolate;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(DeoptimizerData);
|
| };
|
| @@ -265,6 +292,9 @@ class Deoptimizer : public Malloced {
|
|
|
| int ConvertJSFrameIndexToFrameIndex(int jsframe_index);
|
|
|
| + // Unregister a code object from lazy deoptimization.
|
| + static void RemoveDeoptimizingCode(Code* code);
|
| +
|
| private:
|
| static const int kNumberOfEntries = 16384;
|
|
|
| @@ -302,6 +332,7 @@ class Deoptimizer : public Malloced {
|
|
|
| unsigned ComputeIncomingArgumentSize(JSFunction* function) const;
|
| unsigned ComputeOutgoingArgumentSize() const;
|
| + unsigned ComputeHandlersSize() const;
|
|
|
| Object* ComputeLiteral(int index) const;
|
|
|
| @@ -315,7 +346,6 @@ class Deoptimizer : public Malloced {
|
| static void HandleWeakDeoptimizedCode(
|
| v8::Persistent<v8::Value> obj, void* data);
|
| static Code* FindDeoptimizingCodeFromAddress(Address addr);
|
| - static void RemoveDeoptimizingCode(Code* code);
|
|
|
| // Fill the input from from a JavaScript frame. This is used when
|
| // the debugger needs to inspect an optimized frame. For normal
|
| @@ -483,6 +513,8 @@ class FrameDescription {
|
| return OFFSET_OF(FrameDescription, frame_content_);
|
| }
|
|
|
| + unsigned frame_size() { return static_cast<unsigned>(frame_size_); }
|
| +
|
| private:
|
| static const uint32_t kZapUint32 = 0xbeeddead;
|
|
|
| @@ -594,7 +626,10 @@ class Translation BASE_EMBEDDED {
|
| int index() const { return index_; }
|
|
|
| // Commands.
|
| - void BeginJSFrame(BailoutId node_id, int literal_id, unsigned height);
|
| + void BeginJSFrame(BailoutId node_id,
|
| + int literal_id,
|
| + unsigned height,
|
| + int handler_count);
|
| void BeginArgumentsAdaptorFrame(int literal_id, unsigned height);
|
| void BeginConstructStubFrame(int literal_id, unsigned height);
|
| void BeginGetterStubFrame(int literal_id);
|
| @@ -629,26 +664,6 @@ class Translation BASE_EMBEDDED {
|
| };
|
|
|
|
|
| -// Linked list holding deoptimizing code objects. The deoptimizing code objects
|
| -// are kept as weak handles until they are no longer activated on the stack.
|
| -class DeoptimizingCodeListNode : public Malloced {
|
| - public:
|
| - explicit DeoptimizingCodeListNode(Code* code);
|
| - ~DeoptimizingCodeListNode();
|
| -
|
| - DeoptimizingCodeListNode* next() const { return next_; }
|
| - void set_next(DeoptimizingCodeListNode* next) { next_ = next; }
|
| - Handle<Code> code() const { return code_; }
|
| -
|
| - private:
|
| - // Global (weak) handle to the deoptimizing code object.
|
| - Handle<Code> code_;
|
| -
|
| - // Next pointer for linked list.
|
| - DeoptimizingCodeListNode* next_;
|
| -};
|
| -
|
| -
|
| class SlotRef BASE_EMBEDDED {
|
| public:
|
| enum SlotRepresentation {
|
|
|