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/deoptimizer.h" | 5 #include "src/deoptimizer.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "src/accessors.h" | 9 #include "src/accessors.h" |
10 #include "src/assembler-inl.h" | 10 #include "src/assembler-inl.h" |
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
502 ? StackFrame::STUB | 502 ? StackFrame::STUB |
503 : StackFrame::JAVA_SCRIPT; | 503 : StackFrame::JAVA_SCRIPT; |
504 trace_scope_ = TraceEnabledFor(frame_type) | 504 trace_scope_ = TraceEnabledFor(frame_type) |
505 ? new CodeTracer::Scope(isolate->GetCodeTracer()) | 505 ? new CodeTracer::Scope(isolate->GetCodeTracer()) |
506 : NULL; | 506 : NULL; |
507 #ifdef DEBUG | 507 #ifdef DEBUG |
508 CHECK(AllowHeapAllocation::IsAllowed()); | 508 CHECK(AllowHeapAllocation::IsAllowed()); |
509 disallow_heap_allocation_ = new DisallowHeapAllocation(); | 509 disallow_heap_allocation_ = new DisallowHeapAllocation(); |
510 #endif // DEBUG | 510 #endif // DEBUG |
511 if (compiled_code_->kind() == Code::OPTIMIZED_FUNCTION) { | 511 if (compiled_code_->kind() == Code::OPTIMIZED_FUNCTION) { |
512 PROFILE(isolate_, CodeDeoptEvent(compiled_code_, from_, fp_to_sp_delta_)); | 512 CodeEventListener::DeoptKind kind = CodeEventListener::kLazy; |
513 switch (type) { | |
Leszek Swirski
2017/03/21 14:28:39
extract to method
| |
514 case EAGER: | |
515 kind = CodeEventListener::kEager; | |
516 break; | |
517 case SOFT: | |
518 kind = CodeEventListener::kSoft; | |
519 break; | |
520 case LAZY: | |
521 kind = CodeEventListener::kLazy; | |
522 break; | |
523 } | |
524 PROFILE(isolate_, | |
525 CodeDeoptEvent(kind, compiled_code_, from_, fp_to_sp_delta_)); | |
513 } | 526 } |
514 unsigned size = ComputeInputFrameSize(); | 527 unsigned size = ComputeInputFrameSize(); |
515 int parameter_count = | 528 int parameter_count = |
516 function == nullptr | 529 function == nullptr |
517 ? 0 | 530 ? 0 |
518 : (function->shared()->internal_formal_parameter_count() + 1); | 531 : (function->shared()->internal_formal_parameter_count() + 1); |
519 input_ = new (size) FrameDescription(size, parameter_count); | 532 input_ = new (size) FrameDescription(size, parameter_count); |
520 input_->SetFrameType(frame_type); | 533 input_->SetFrameType(frame_type); |
521 } | 534 } |
522 | 535 |
(...skipping 3901 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4424 CHECK(value_info->IsMaterializedObject()); | 4437 CHECK(value_info->IsMaterializedObject()); |
4425 | 4438 |
4426 value_info->value_ = | 4439 value_info->value_ = |
4427 Handle<Object>(previously_materialized_objects->get(i), isolate_); | 4440 Handle<Object>(previously_materialized_objects->get(i), isolate_); |
4428 } | 4441 } |
4429 } | 4442 } |
4430 } | 4443 } |
4431 | 4444 |
4432 } // namespace internal | 4445 } // namespace internal |
4433 } // namespace v8 | 4446 } // namespace v8 |
OLD | NEW |