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/cpu-profiler.h" | 9 #include "src/cpu-profiler.h" |
10 #include "src/deoptimizer.h" | 10 #include "src/deoptimizer.h" |
(...skipping 1999 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2010 object->ShortPrint(trace_scope_->file()); | 2010 object->ShortPrint(trace_scope_->file()); |
2011 PrintF(trace_scope_->file(), "\n"); | 2011 PrintF(trace_scope_->file(), "\n"); |
2012 } | 2012 } |
2013 } | 2013 } |
2014 | 2014 |
2015 CHECK_EQ(materialization_object_index_, materialized_objects_->length()); | 2015 CHECK_EQ(materialization_object_index_, materialized_objects_->length()); |
2016 CHECK_EQ(materialization_value_index_, materialized_values_->length()); | 2016 CHECK_EQ(materialization_value_index_, materialized_values_->length()); |
2017 } | 2017 } |
2018 | 2018 |
2019 if (prev_materialized_count_ > 0) { | 2019 if (prev_materialized_count_ > 0) { |
2020 materialized_store->Remove(stack_fp_); | 2020 bool removed = materialized_store->Remove(stack_fp_); |
| 2021 CHECK(removed); |
2021 } | 2022 } |
2022 } | 2023 } |
2023 | 2024 |
2024 | 2025 |
2025 void Deoptimizer::MaterializeHeapNumbersForDebuggerInspectableFrame( | 2026 void Deoptimizer::MaterializeHeapNumbersForDebuggerInspectableFrame( |
2026 Address parameters_top, | 2027 Address parameters_top, |
2027 uint32_t parameters_size, | 2028 uint32_t parameters_size, |
2028 Address expressions_top, | 2029 Address expressions_top, |
2029 uint32_t expressions_size, | 2030 uint32_t expressions_size, |
2030 DeoptimizedFrameInfo* info) { | 2031 DeoptimizedFrameInfo* info) { |
(...skipping 1641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3672 if (index == -1) { | 3673 if (index == -1) { |
3673 index = frame_fps_.length(); | 3674 index = frame_fps_.length(); |
3674 frame_fps_.Add(fp); | 3675 frame_fps_.Add(fp); |
3675 } | 3676 } |
3676 | 3677 |
3677 Handle<FixedArray> array = EnsureStackEntries(index + 1); | 3678 Handle<FixedArray> array = EnsureStackEntries(index + 1); |
3678 array->set(index, *materialized_objects); | 3679 array->set(index, *materialized_objects); |
3679 } | 3680 } |
3680 | 3681 |
3681 | 3682 |
3682 void MaterializedObjectStore::Remove(Address fp) { | 3683 bool MaterializedObjectStore::Remove(Address fp) { |
3683 int index = StackIdToIndex(fp); | 3684 int index = StackIdToIndex(fp); |
| 3685 if (index == -1) { |
| 3686 return false; |
| 3687 } |
3684 CHECK_GE(index, 0); | 3688 CHECK_GE(index, 0); |
3685 | 3689 |
3686 frame_fps_.Remove(index); | 3690 frame_fps_.Remove(index); |
3687 Handle<FixedArray> array = GetStackEntries(); | 3691 FixedArray* array = isolate()->heap()->materialized_objects(); |
3688 CHECK_LT(index, array->length()); | 3692 CHECK_LT(index, array->length()); |
3689 for (int i = index; i < frame_fps_.length(); i++) { | 3693 for (int i = index; i < frame_fps_.length(); i++) { |
3690 array->set(i, array->get(i + 1)); | 3694 array->set(i, array->get(i + 1)); |
3691 } | 3695 } |
3692 array->set(frame_fps_.length(), isolate()->heap()->undefined_value()); | 3696 array->set(frame_fps_.length(), isolate()->heap()->undefined_value()); |
| 3697 return true; |
3693 } | 3698 } |
3694 | 3699 |
3695 | 3700 |
3696 int MaterializedObjectStore::StackIdToIndex(Address fp) { | 3701 int MaterializedObjectStore::StackIdToIndex(Address fp) { |
3697 for (int i = 0; i < frame_fps_.length(); i++) { | 3702 for (int i = 0; i < frame_fps_.length(); i++) { |
3698 if (frame_fps_[i] == fp) { | 3703 if (frame_fps_[i] == fp) { |
3699 return i; | 3704 return i; |
3700 } | 3705 } |
3701 } | 3706 } |
3702 return -1; | 3707 return -1; |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3800 int raw_position = static_cast<int>(info->data()); | 3805 int raw_position = static_cast<int>(info->data()); |
3801 last_position = raw_position ? SourcePosition::FromRaw(raw_position) | 3806 last_position = raw_position ? SourcePosition::FromRaw(raw_position) |
3802 : SourcePosition::Unknown(); | 3807 : SourcePosition::Unknown(); |
3803 } else if (info->rmode() == RelocInfo::DEOPT_REASON) { | 3808 } else if (info->rmode() == RelocInfo::DEOPT_REASON) { |
3804 last_reason = static_cast<Deoptimizer::DeoptReason>(info->data()); | 3809 last_reason = static_cast<Deoptimizer::DeoptReason>(info->data()); |
3805 } | 3810 } |
3806 } | 3811 } |
3807 return DeoptInfo(SourcePosition::Unknown(), NULL, Deoptimizer::kNoReason); | 3812 return DeoptInfo(SourcePosition::Unknown(), NULL, Deoptimizer::kNoReason); |
3808 } | 3813 } |
3809 } } // namespace v8::internal | 3814 } } // namespace v8::internal |
OLD | NEW |