| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 456 // Run through the list of all native contexts and deoptimize. | 456 // Run through the list of all native contexts and deoptimize. |
| 457 Object* context = isolate->heap()->native_contexts_list(); | 457 Object* context = isolate->heap()->native_contexts_list(); |
| 458 while (!context->IsUndefined()) { | 458 while (!context->IsUndefined()) { |
| 459 DeoptimizeAllFunctionsForContext(Context::cast(context), filter); | 459 DeoptimizeAllFunctionsForContext(Context::cast(context), filter); |
| 460 context = Context::cast(context)->get(Context::NEXT_CONTEXT_LINK); | 460 context = Context::cast(context)->get(Context::NEXT_CONTEXT_LINK); |
| 461 } | 461 } |
| 462 } | 462 } |
| 463 | 463 |
| 464 | 464 |
| 465 void Deoptimizer::HandleWeakDeoptimizedCode(v8::Isolate* isolate, | 465 void Deoptimizer::HandleWeakDeoptimizedCode(v8::Isolate* isolate, |
| 466 v8::Persistent<v8::Value> obj, | 466 v8::Persistent<v8::Value>* obj, |
| 467 void* parameter) { | 467 void* parameter) { |
| 468 DeoptimizingCodeListNode* node = | 468 DeoptimizingCodeListNode* node = |
| 469 reinterpret_cast<DeoptimizingCodeListNode*>(parameter); | 469 reinterpret_cast<DeoptimizingCodeListNode*>(parameter); |
| 470 DeoptimizerData* data = | 470 DeoptimizerData* data = |
| 471 reinterpret_cast<Isolate*>(isolate)->deoptimizer_data(); | 471 reinterpret_cast<Isolate*>(isolate)->deoptimizer_data(); |
| 472 data->RemoveDeoptimizingCode(*node->code()); | 472 data->RemoveDeoptimizingCode(*node->code()); |
| 473 #ifdef DEBUG | 473 #ifdef DEBUG |
| 474 for (DeoptimizingCodeListNode* current = data->deoptimizing_code_list_; | 474 for (DeoptimizingCodeListNode* current = data->deoptimizing_code_list_; |
| 475 current != NULL; | 475 current != NULL; |
| 476 current = current->next()) { | 476 current = current->next()) { |
| (...skipping 2266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2743 | 2743 |
| 2744 #endif | 2744 #endif |
| 2745 | 2745 |
| 2746 | 2746 |
| 2747 DeoptimizingCodeListNode::DeoptimizingCodeListNode(Code* code): next_(NULL) { | 2747 DeoptimizingCodeListNode::DeoptimizingCodeListNode(Code* code): next_(NULL) { |
| 2748 GlobalHandles* global_handles = code->GetIsolate()->global_handles(); | 2748 GlobalHandles* global_handles = code->GetIsolate()->global_handles(); |
| 2749 // Globalize the code object and make it weak. | 2749 // Globalize the code object and make it weak. |
| 2750 code_ = Handle<Code>::cast(global_handles->Create(code)); | 2750 code_ = Handle<Code>::cast(global_handles->Create(code)); |
| 2751 global_handles->MakeWeak(reinterpret_cast<Object**>(code_.location()), | 2751 global_handles->MakeWeak(reinterpret_cast<Object**>(code_.location()), |
| 2752 this, | 2752 this, |
| 2753 NULL, | |
| 2754 Deoptimizer::HandleWeakDeoptimizedCode); | 2753 Deoptimizer::HandleWeakDeoptimizedCode); |
| 2755 } | 2754 } |
| 2756 | 2755 |
| 2757 | 2756 |
| 2758 DeoptimizingCodeListNode::~DeoptimizingCodeListNode() { | 2757 DeoptimizingCodeListNode::~DeoptimizingCodeListNode() { |
| 2759 GlobalHandles* global_handles = code_->GetIsolate()->global_handles(); | 2758 GlobalHandles* global_handles = code_->GetIsolate()->global_handles(); |
| 2760 global_handles->Destroy(reinterpret_cast<Object**>(code_.location())); | 2759 global_handles->Destroy(reinterpret_cast<Object**>(code_.location())); |
| 2761 } | 2760 } |
| 2762 | 2761 |
| 2763 | 2762 |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2950 | 2949 |
| 2951 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) { | 2950 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) { |
| 2952 v->VisitPointer(BitCast<Object**>(&function_)); | 2951 v->VisitPointer(BitCast<Object**>(&function_)); |
| 2953 v->VisitPointers(parameters_, parameters_ + parameters_count_); | 2952 v->VisitPointers(parameters_, parameters_ + parameters_count_); |
| 2954 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_); | 2953 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_); |
| 2955 } | 2954 } |
| 2956 | 2955 |
| 2957 #endif // ENABLE_DEBUGGER_SUPPORT | 2956 #endif // ENABLE_DEBUGGER_SUPPORT |
| 2958 | 2957 |
| 2959 } } // namespace v8::internal | 2958 } } // namespace v8::internal |
| OLD | NEW |