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 1049 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1060 // so long as we don't inline functions that need local contexts. | 1060 // so long as we don't inline functions that need local contexts. |
1061 Register context_reg = JavaScriptFrame::context_register(); | 1061 Register context_reg = JavaScriptFrame::context_register(); |
1062 output_offset -= kPointerSize; | 1062 output_offset -= kPointerSize; |
1063 input_offset -= kPointerSize; | 1063 input_offset -= kPointerSize; |
1064 // Read the context from the translations. | 1064 // Read the context from the translations. |
1065 DoTranslateCommand(iterator, frame_index, output_offset); | 1065 DoTranslateCommand(iterator, frame_index, output_offset); |
1066 value = output_frame->GetFrameSlot(output_offset); | 1066 value = output_frame->GetFrameSlot(output_offset); |
1067 // The context should not be a placeholder for a materialized object. | 1067 // The context should not be a placeholder for a materialized object. |
1068 CHECK(value != | 1068 CHECK(value != |
1069 reinterpret_cast<intptr_t>(isolate_->heap()->arguments_marker())); | 1069 reinterpret_cast<intptr_t>(isolate_->heap()->arguments_marker())); |
| 1070 if (value == |
| 1071 reinterpret_cast<intptr_t>(isolate_->heap()->undefined_value())) { |
| 1072 // If the context was optimized away, just use the context from |
| 1073 // the activation. This should only apply to Crankshaft code. |
| 1074 CHECK(!compiled_code_->is_turbofanned()); |
| 1075 if (is_bottommost) { |
| 1076 value = input_->GetFrameSlot(input_offset); |
| 1077 } else { |
| 1078 value = reinterpret_cast<intptr_t>(function->context()); |
| 1079 } |
| 1080 output_frame->SetFrameSlot(output_offset, value); |
| 1081 } |
1070 output_frame->SetContext(value); | 1082 output_frame->SetContext(value); |
1071 if (is_topmost) output_frame->SetRegister(context_reg.code(), value); | 1083 if (is_topmost) output_frame->SetRegister(context_reg.code(), value); |
1072 if (trace_scope_ != NULL) { | 1084 if (trace_scope_ != NULL) { |
1073 PrintF(trace_scope_->file(), | 1085 PrintF(trace_scope_->file(), |
1074 " 0x%08" V8PRIxPTR ": [top + %d] <- 0x%08" | 1086 " 0x%08" V8PRIxPTR ": [top + %d] <- 0x%08" |
1075 V8PRIxPTR "; context\n", | 1087 V8PRIxPTR "; context\n", |
1076 top_address + output_offset, output_offset, value); | 1088 top_address + output_offset, output_offset, value); |
1077 } | 1089 } |
1078 | 1090 |
1079 // The function was mentioned explicitly in the BEGIN_FRAME. | 1091 // The function was mentioned explicitly in the BEGIN_FRAME. |
(...skipping 2583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3663 | 3675 |
3664 | 3676 |
3665 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) { | 3677 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) { |
3666 v->VisitPointer(BitCast<Object**>(&function_)); | 3678 v->VisitPointer(BitCast<Object**>(&function_)); |
3667 v->VisitPointer(&context_); | 3679 v->VisitPointer(&context_); |
3668 v->VisitPointers(parameters_, parameters_ + parameters_count_); | 3680 v->VisitPointers(parameters_, parameters_ + parameters_count_); |
3669 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_); | 3681 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_); |
3670 } | 3682 } |
3671 | 3683 |
3672 } } // namespace v8::internal | 3684 } } // namespace v8::internal |
OLD | NEW |