| 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" |
| 11 #include "src/full-codegen.h" | 11 #include "src/full-codegen.h" |
| 12 #include "src/global-handles.h" | 12 #include "src/global-handles.h" |
| 13 #include "src/macro-assembler.h" | 13 #include "src/macro-assembler.h" |
| 14 #include "src/prettyprinter.h" | 14 #include "src/prettyprinter.h" |
| 15 #include "src/prototype-iterator.h" |
| 15 | 16 |
| 16 | 17 |
| 17 namespace v8 { | 18 namespace v8 { |
| 18 namespace internal { | 19 namespace internal { |
| 19 | 20 |
| 20 static MemoryChunk* AllocateCodeChunk(MemoryAllocator* allocator) { | 21 static MemoryChunk* AllocateCodeChunk(MemoryAllocator* allocator) { |
| 21 return allocator->AllocateChunk(Deoptimizer::GetMaxDeoptTableSize(), | 22 return allocator->AllocateChunk(Deoptimizer::GetMaxDeoptTableSize(), |
| 22 OS::CommitPageSize(), | 23 OS::CommitPageSize(), |
| 23 #if defined(__native_client__) | 24 #if defined(__native_client__) |
| 24 // The Native Client port of V8 uses an interpreter, | 25 // The Native Client port of V8 uses an interpreter, |
| (...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 452 } | 453 } |
| 453 | 454 |
| 454 | 455 |
| 455 void Deoptimizer::DeoptimizeGlobalObject(JSObject* object) { | 456 void Deoptimizer::DeoptimizeGlobalObject(JSObject* object) { |
| 456 if (FLAG_trace_deopt) { | 457 if (FLAG_trace_deopt) { |
| 457 CodeTracer::Scope scope(object->GetHeap()->isolate()->GetCodeTracer()); | 458 CodeTracer::Scope scope(object->GetHeap()->isolate()->GetCodeTracer()); |
| 458 PrintF(scope.file(), "[deoptimize global object @ 0x%08" V8PRIxPTR "]\n", | 459 PrintF(scope.file(), "[deoptimize global object @ 0x%08" V8PRIxPTR "]\n", |
| 459 reinterpret_cast<intptr_t>(object)); | 460 reinterpret_cast<intptr_t>(object)); |
| 460 } | 461 } |
| 461 if (object->IsJSGlobalProxy()) { | 462 if (object->IsJSGlobalProxy()) { |
| 462 Object* proto = object->GetPrototype(); | 463 Object* proto = SAFE_GET_PROTOTYPE_FAST(object); |
| 463 CHECK(proto->IsJSGlobalObject()); | 464 CHECK(proto->IsJSGlobalObject()); |
| 464 Context* native_context = GlobalObject::cast(proto)->native_context(); | 465 Context* native_context = GlobalObject::cast(proto)->native_context(); |
| 465 MarkAllCodeForContext(native_context); | 466 MarkAllCodeForContext(native_context); |
| 466 DeoptimizeMarkedCodeForContext(native_context); | 467 DeoptimizeMarkedCodeForContext(native_context); |
| 467 } else if (object->IsGlobalObject()) { | 468 } else if (object->IsGlobalObject()) { |
| 468 Context* native_context = GlobalObject::cast(object)->native_context(); | 469 Context* native_context = GlobalObject::cast(object)->native_context(); |
| 469 MarkAllCodeForContext(native_context); | 470 MarkAllCodeForContext(native_context); |
| 470 DeoptimizeMarkedCodeForContext(native_context); | 471 DeoptimizeMarkedCodeForContext(native_context); |
| 471 } | 472 } |
| 472 } | 473 } |
| (...skipping 3109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3582 } | 3583 } |
| 3583 | 3584 |
| 3584 | 3585 |
| 3585 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) { | 3586 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) { |
| 3586 v->VisitPointer(BitCast<Object**>(&function_)); | 3587 v->VisitPointer(BitCast<Object**>(&function_)); |
| 3587 v->VisitPointers(parameters_, parameters_ + parameters_count_); | 3588 v->VisitPointers(parameters_, parameters_ + parameters_count_); |
| 3588 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_); | 3589 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_); |
| 3589 } | 3590 } |
| 3590 | 3591 |
| 3591 } } // namespace v8::internal | 3592 } } // namespace v8::internal |
| OLD | NEW |