OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
449 | 449 |
450 // Run through the list of all native contexts and deoptimize. | 450 // Run through the list of all native contexts and deoptimize. |
451 Object* context = Isolate::Current()->heap()->native_contexts_list(); | 451 Object* context = Isolate::Current()->heap()->native_contexts_list(); |
452 while (!context->IsUndefined()) { | 452 while (!context->IsUndefined()) { |
453 DeoptimizeAllFunctionsForContext(Context::cast(context), filter); | 453 DeoptimizeAllFunctionsForContext(Context::cast(context), filter); |
454 context = Context::cast(context)->get(Context::NEXT_CONTEXT_LINK); | 454 context = Context::cast(context)->get(Context::NEXT_CONTEXT_LINK); |
455 } | 455 } |
456 } | 456 } |
457 | 457 |
458 | 458 |
459 void Deoptimizer::HandleWeakDeoptimizedCode(v8::Persistent<v8::Value> obj, | 459 void Deoptimizer::HandleWeakDeoptimizedCode(v8::Isolate* isolate, |
| 460 v8::Persistent<v8::Value> obj, |
460 void* parameter) { | 461 void* parameter) { |
461 DeoptimizingCodeListNode* node = | 462 DeoptimizingCodeListNode* node = |
462 reinterpret_cast<DeoptimizingCodeListNode*>(parameter); | 463 reinterpret_cast<DeoptimizingCodeListNode*>(parameter); |
463 DeoptimizerData* data = Isolate::Current()->deoptimizer_data(); | 464 DeoptimizerData* data = |
| 465 reinterpret_cast<Isolate*>(isolate)->deoptimizer_data(); |
464 data->RemoveDeoptimizingCode(*node->code()); | 466 data->RemoveDeoptimizingCode(*node->code()); |
465 #ifdef DEBUG | 467 #ifdef DEBUG |
466 for (DeoptimizingCodeListNode* current = data->deoptimizing_code_list_; | 468 for (DeoptimizingCodeListNode* current = data->deoptimizing_code_list_; |
467 current != NULL; | 469 current != NULL; |
468 current = current->next()) { | 470 current = current->next()) { |
469 ASSERT(current != node); | 471 ASSERT(current != node); |
470 } | 472 } |
471 #endif | 473 #endif |
472 } | 474 } |
473 | 475 |
(...skipping 1432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1906 | 1908 |
1907 #endif | 1909 #endif |
1908 | 1910 |
1909 | 1911 |
1910 DeoptimizingCodeListNode::DeoptimizingCodeListNode(Code* code): next_(NULL) { | 1912 DeoptimizingCodeListNode::DeoptimizingCodeListNode(Code* code): next_(NULL) { |
1911 GlobalHandles* global_handles = Isolate::Current()->global_handles(); | 1913 GlobalHandles* global_handles = Isolate::Current()->global_handles(); |
1912 // Globalize the code object and make it weak. | 1914 // Globalize the code object and make it weak. |
1913 code_ = Handle<Code>::cast(global_handles->Create(code)); | 1915 code_ = Handle<Code>::cast(global_handles->Create(code)); |
1914 global_handles->MakeWeak(reinterpret_cast<Object**>(code_.location()), | 1916 global_handles->MakeWeak(reinterpret_cast<Object**>(code_.location()), |
1915 this, | 1917 this, |
| 1918 NULL, |
1916 Deoptimizer::HandleWeakDeoptimizedCode); | 1919 Deoptimizer::HandleWeakDeoptimizedCode); |
1917 } | 1920 } |
1918 | 1921 |
1919 | 1922 |
1920 DeoptimizingCodeListNode::~DeoptimizingCodeListNode() { | 1923 DeoptimizingCodeListNode::~DeoptimizingCodeListNode() { |
1921 GlobalHandles* global_handles = Isolate::Current()->global_handles(); | 1924 GlobalHandles* global_handles = Isolate::Current()->global_handles(); |
1922 global_handles->Destroy(reinterpret_cast<Object**>(code_.location())); | 1925 global_handles->Destroy(reinterpret_cast<Object**>(code_.location())); |
1923 } | 1926 } |
1924 | 1927 |
1925 | 1928 |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2111 | 2114 |
2112 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) { | 2115 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) { |
2113 v->VisitPointer(BitCast<Object**>(&function_)); | 2116 v->VisitPointer(BitCast<Object**>(&function_)); |
2114 v->VisitPointers(parameters_, parameters_ + parameters_count_); | 2117 v->VisitPointers(parameters_, parameters_ + parameters_count_); |
2115 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_); | 2118 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_); |
2116 } | 2119 } |
2117 | 2120 |
2118 #endif // ENABLE_DEBUGGER_SUPPORT | 2121 #endif // ENABLE_DEBUGGER_SUPPORT |
2119 | 2122 |
2120 } } // namespace v8::internal | 2123 } } // namespace v8::internal |
OLD | NEW |