| Index: src/deoptimizer.h
|
| diff --git a/src/deoptimizer.h b/src/deoptimizer.h
|
| index e5afd1ae67f5695f94b4601bf2c5c4135fe4be1b..f2d51adcdf756e068cd62d6e2d0aea0cbee6d178 100644
|
| --- a/src/deoptimizer.h
|
| +++ b/src/deoptimizer.h
|
| @@ -58,7 +58,6 @@ static inline double read_double_value(Address p) {
|
|
|
| class FrameDescription;
|
| class TranslationIterator;
|
| -class DeoptimizingCodeListNode;
|
| class DeoptimizedFrameInfo;
|
|
|
| class HeapNumberMaterializationDescriptor BASE_EMBEDDED {
|
| @@ -121,17 +120,6 @@ class OptimizedFunctionVisitor BASE_EMBEDDED {
|
| };
|
|
|
|
|
| -class OptimizedFunctionFilter BASE_EMBEDDED {
|
| - public:
|
| - virtual ~OptimizedFunctionFilter() {}
|
| -
|
| - virtual bool TakeFunction(JSFunction* function) = 0;
|
| -};
|
| -
|
| -
|
| -class Deoptimizer;
|
| -
|
| -
|
| class Deoptimizer : public Malloced {
|
| public:
|
| enum BailoutType {
|
| @@ -203,28 +191,20 @@ class Deoptimizer : public Malloced {
|
| // execution returns.
|
| static void DeoptimizeFunction(JSFunction* function);
|
|
|
| - // Iterate over all the functions which share the same code object
|
| - // and make them use unoptimized version.
|
| - static void ReplaceCodeForRelatedFunctions(JSFunction* function, Code* code);
|
| -
|
| - // Deoptimize all functions in the heap.
|
| + // Deoptimize all code in the given isolate.
|
| static void DeoptimizeAll(Isolate* isolate);
|
|
|
| + // Deoptimize code associated with the given global object.
|
| static void DeoptimizeGlobalObject(JSObject* object);
|
|
|
| - static void DeoptimizeAllFunctionsWith(Isolate* isolate,
|
| - OptimizedFunctionFilter* filter);
|
| + // Deoptimizes all optimized code that has been previously marked
|
| + // (via code->set_marked_for_deoptimization) and unlinks all functions that
|
| + // refer to that code.
|
| + static void DeoptimizeMarkedCode(Isolate* isolate);
|
|
|
| - static void DeoptimizeCodeList(Isolate* isolate, ZoneList<Code*>* codes);
|
| -
|
| - static void DeoptimizeAllFunctionsForContext(
|
| - Context* context, OptimizedFunctionFilter* filter);
|
| -
|
| - static void VisitAllOptimizedFunctionsForContext(
|
| - Context* context, OptimizedFunctionVisitor* visitor);
|
| -
|
| - static void VisitAllOptimizedFunctions(Isolate* isolate,
|
| - OptimizedFunctionVisitor* visitor);
|
| + // Visit all the known optimized functions in a given isolate.
|
| + static void VisitAllOptimizedFunctions(
|
| + Isolate* isolate, OptimizedFunctionVisitor* visitor);
|
|
|
| // The size in bytes of the code required at a lazy deopt patch site.
|
| static int patch_size();
|
| @@ -443,17 +423,24 @@ class Deoptimizer : public Malloced {
|
| static void GenerateDeoptimizationEntries(
|
| MacroAssembler* masm, int count, BailoutType type);
|
|
|
| - // Weak handle callback for deoptimizing code objects.
|
| - static void HandleWeakDeoptimizedCode(v8::Isolate* isolate,
|
| - v8::Persistent<v8::Value>* obj,
|
| - void* data);
|
| + // Marks all the code in the given context for deoptimization.
|
| + static void MarkAllCodeForContext(Context* native_context);
|
| +
|
| + // Visit all the known optimized functions in a given context.
|
| + static void VisitAllOptimizedFunctionsForContext(
|
| + Context* context, OptimizedFunctionVisitor* visitor);
|
|
|
| - // Deoptimize the given code and add to appropriate deoptimization lists.
|
| - static void DeoptimizeCode(Isolate* isolate, Code* code);
|
| + // Deoptimizes all code marked in the given context.
|
| + static void DeoptimizeMarkedCodeForContext(Context* native_context);
|
|
|
| // Patch the given code so that it will deoptimize itself.
|
| static void PatchCodeForDeoptimization(Isolate* isolate, Code* code);
|
|
|
| + // Searches the list of known deoptimizing code for a Code object
|
| + // containing the given address (which is supposedly faster than
|
| + // searching all code objects).
|
| + Code* FindDeoptimizingCode(Address addr);
|
| +
|
| // Fill the input from from a JavaScript frame. This is used when
|
| // the debugger needs to inspect an optimized frame. For normal
|
| // deoptimizations the input frame is filled in generated code.
|
| @@ -515,7 +502,6 @@ class Deoptimizer : public Malloced {
|
| static const int table_entry_size_;
|
|
|
| friend class FrameDescription;
|
| - friend class DeoptimizingCodeListNode;
|
| friend class DeoptimizedFrameInfo;
|
| };
|
|
|
| @@ -689,24 +675,16 @@ class DeoptimizerData {
|
| void Iterate(ObjectVisitor* v);
|
| #endif
|
|
|
| - Code* FindDeoptimizingCode(Address addr);
|
| - void RemoveDeoptimizingCode(Code* code);
|
| -
|
| private:
|
| MemoryAllocator* allocator_;
|
| int deopt_entry_code_entries_[Deoptimizer::kBailoutTypesWithCodeEntry];
|
| MemoryChunk* deopt_entry_code_[Deoptimizer::kBailoutTypesWithCodeEntry];
|
| - Deoptimizer* current_;
|
|
|
| #ifdef ENABLE_DEBUGGER_SUPPORT
|
| DeoptimizedFrameInfo* deoptimized_frame_info_;
|
| #endif
|
|
|
| - // List of deoptimized code which still have references from active stack
|
| - // frames. These code objects are needed by the deoptimizer when deoptimizing
|
| - // a frame for which the code object for the function function has been
|
| - // changed from the code present when deoptimizing was done.
|
| - DeoptimizingCodeListNode* deoptimizing_code_list_;
|
| + Deoptimizer* current_;
|
|
|
| friend class Deoptimizer;
|
|
|
| @@ -824,26 +802,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 {
|
|
|