OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/codegen.h" | 8 #include "src/codegen.h" |
9 #include "src/deoptimizer.h" | 9 #include "src/deoptimizer.h" |
10 #include "src/disasm.h" | 10 #include "src/disasm.h" |
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 } | 452 } |
453 | 453 |
454 | 454 |
455 void Deoptimizer::DeoptimizeGlobalObject(JSObject* object) { | 455 void Deoptimizer::DeoptimizeGlobalObject(JSObject* object) { |
456 if (FLAG_trace_deopt) { | 456 if (FLAG_trace_deopt) { |
457 CodeTracer::Scope scope(object->GetHeap()->isolate()->GetCodeTracer()); | 457 CodeTracer::Scope scope(object->GetHeap()->isolate()->GetCodeTracer()); |
458 PrintF(scope.file(), "[deoptimize global object @ 0x%08" V8PRIxPTR "]\n", | 458 PrintF(scope.file(), "[deoptimize global object @ 0x%08" V8PRIxPTR "]\n", |
459 reinterpret_cast<intptr_t>(object)); | 459 reinterpret_cast<intptr_t>(object)); |
460 } | 460 } |
461 if (object->IsJSGlobalProxy()) { | 461 if (object->IsJSGlobalProxy()) { |
462 Object* proto = object->GetPrototype(); | 462 PrototypeIterator iter(object->GetIsolate(), object); |
463 CHECK(proto->IsJSGlobalObject()); | 463 // TODO(verwaest): This CHECK will be hit if the global proxy is detached. |
464 Context* native_context = GlobalObject::cast(proto)->native_context(); | 464 CHECK(iter.GetCurrent()->IsJSGlobalObject()); |
| 465 Context* native_context = |
| 466 GlobalObject::cast(iter.GetCurrent())->native_context(); |
465 MarkAllCodeForContext(native_context); | 467 MarkAllCodeForContext(native_context); |
466 DeoptimizeMarkedCodeForContext(native_context); | 468 DeoptimizeMarkedCodeForContext(native_context); |
467 } else if (object->IsGlobalObject()) { | 469 } else if (object->IsGlobalObject()) { |
468 Context* native_context = GlobalObject::cast(object)->native_context(); | 470 Context* native_context = GlobalObject::cast(object)->native_context(); |
469 MarkAllCodeForContext(native_context); | 471 MarkAllCodeForContext(native_context); |
470 DeoptimizeMarkedCodeForContext(native_context); | 472 DeoptimizeMarkedCodeForContext(native_context); |
471 } | 473 } |
472 } | 474 } |
473 | 475 |
474 | 476 |
(...skipping 3110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3585 } | 3587 } |
3586 | 3588 |
3587 | 3589 |
3588 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) { | 3590 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) { |
3589 v->VisitPointer(BitCast<Object**>(&function_)); | 3591 v->VisitPointer(BitCast<Object**>(&function_)); |
3590 v->VisitPointers(parameters_, parameters_ + parameters_count_); | 3592 v->VisitPointers(parameters_, parameters_ + parameters_count_); |
3591 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_); | 3593 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_); |
3592 } | 3594 } |
3593 | 3595 |
3594 } } // namespace v8::internal | 3596 } } // namespace v8::internal |
OLD | NEW |