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 "src/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/ast/prettyprinter.h" | 8 #include "src/ast/prettyprinter.h" |
9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
10 #include "src/disasm.h" | 10 #include "src/disasm.h" |
(...skipping 3620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3631 CHECK(arg_iterator == previous_frame->end()); | 3631 CHECK(arg_iterator == previous_frame->end()); |
3632 *result = arguments; | 3632 *result = arguments; |
3633 return true; | 3633 return true; |
3634 } | 3634 } |
3635 } | 3635 } |
3636 | 3636 |
3637 | 3637 |
3638 TranslatedFrame* TranslatedState::GetArgumentsInfoFromJSFrameIndex( | 3638 TranslatedFrame* TranslatedState::GetArgumentsInfoFromJSFrameIndex( |
3639 int jsframe_index, int* args_count) { | 3639 int jsframe_index, int* args_count) { |
3640 for (size_t i = 0; i < frames_.size(); i++) { | 3640 for (size_t i = 0; i < frames_.size(); i++) { |
3641 if (frames_[i].kind() == TranslatedFrame::kFunction) { | 3641 if (frames_[i].kind() == TranslatedFrame::kFunction || |
| 3642 frames_[i].kind() == TranslatedFrame::kInterpretedFunction) { |
3642 if (jsframe_index > 0) { | 3643 if (jsframe_index > 0) { |
3643 jsframe_index--; | 3644 jsframe_index--; |
3644 } else { | 3645 } else { |
3645 // We have the JS function frame, now check if it has arguments adaptor. | 3646 // We have the JS function frame, now check if it has arguments adaptor. |
3646 if (i > 0 && | 3647 if (i > 0 && |
3647 frames_[i - 1].kind() == TranslatedFrame::kArgumentsAdaptor) { | 3648 frames_[i - 1].kind() == TranslatedFrame::kArgumentsAdaptor) { |
3648 *args_count = frames_[i - 1].height(); | 3649 *args_count = frames_[i - 1].height(); |
3649 return &(frames_[i - 1]); | 3650 return &(frames_[i - 1]); |
3650 } | 3651 } |
3651 *args_count = | 3652 *args_count = |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3694 previously_materialized_objects->set(i, *value); | 3695 previously_materialized_objects->set(i, *value); |
3695 value_changed = true; | 3696 value_changed = true; |
3696 } else { | 3697 } else { |
3697 CHECK(previously_materialized_objects->get(i) == *value); | 3698 CHECK(previously_materialized_objects->get(i) == *value); |
3698 } | 3699 } |
3699 } | 3700 } |
3700 } | 3701 } |
3701 if (new_store && value_changed) { | 3702 if (new_store && value_changed) { |
3702 materialized_store->Set(stack_frame_pointer_, | 3703 materialized_store->Set(stack_frame_pointer_, |
3703 previously_materialized_objects); | 3704 previously_materialized_objects); |
3704 CHECK_EQ(TranslatedFrame::kFunction, frames_[0].kind()); | 3705 CHECK(frames_[0].kind() == TranslatedFrame::kFunction || |
| 3706 frames_[0].kind() == TranslatedFrame::kInterpretedFunction); |
3705 Object* const function = frames_[0].front().GetRawValue(); | 3707 Object* const function = frames_[0].front().GetRawValue(); |
3706 Deoptimizer::DeoptimizeFunction(JSFunction::cast(function)); | 3708 Deoptimizer::DeoptimizeFunction(JSFunction::cast(function)); |
3707 } | 3709 } |
3708 } | 3710 } |
3709 | 3711 |
3710 | 3712 |
3711 void TranslatedState::UpdateFromPreviouslyMaterializedObjects() { | 3713 void TranslatedState::UpdateFromPreviouslyMaterializedObjects() { |
3712 MaterializedObjectStore* materialized_store = | 3714 MaterializedObjectStore* materialized_store = |
3713 isolate_->materialized_object_store(); | 3715 isolate_->materialized_object_store(); |
3714 Handle<FixedArray> previously_materialized_objects = | 3716 Handle<FixedArray> previously_materialized_objects = |
(...skipping 17 matching lines...) Expand all Loading... |
3732 CHECK(value_info->IsMaterializedObject()); | 3734 CHECK(value_info->IsMaterializedObject()); |
3733 | 3735 |
3734 value_info->value_ = | 3736 value_info->value_ = |
3735 Handle<Object>(previously_materialized_objects->get(i), isolate_); | 3737 Handle<Object>(previously_materialized_objects->get(i), isolate_); |
3736 } | 3738 } |
3737 } | 3739 } |
3738 } | 3740 } |
3739 | 3741 |
3740 } // namespace internal | 3742 } // namespace internal |
3741 } // namespace v8 | 3743 } // namespace v8 |
OLD | NEW |