| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 713 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 724 | 724 |
| 725 // We rely on this function not causing a GC. It is called from generated code | 725 // We rely on this function not causing a GC. It is called from generated code |
| 726 // without having a real stack frame in place. | 726 // without having a real stack frame in place. |
| 727 void Deoptimizer::DoComputeOutputFrames() { | 727 void Deoptimizer::DoComputeOutputFrames() { |
| 728 // Print some helpful diagnostic information. | 728 // Print some helpful diagnostic information. |
| 729 if (FLAG_log_timer_events && | 729 if (FLAG_log_timer_events && |
| 730 compiled_code_->kind() == Code::OPTIMIZED_FUNCTION) { | 730 compiled_code_->kind() == Code::OPTIMIZED_FUNCTION) { |
| 731 LOG(isolate(), CodeDeoptEvent(compiled_code_)); | 731 LOG(isolate(), CodeDeoptEvent(compiled_code_)); |
| 732 } | 732 } |
| 733 ElapsedTimer timer; | 733 ElapsedTimer timer; |
| 734 | |
| 735 // Determine basic deoptimization information. The optimized frame is | |
| 736 // described by the input data. | |
| 737 DeoptimizationInputData* input_data = | |
| 738 DeoptimizationInputData::cast(compiled_code_->deoptimization_data()); | |
| 739 | |
| 740 if (trace_scope_ != NULL) { | 734 if (trace_scope_ != NULL) { |
| 741 timer.Start(); | 735 timer.Start(); |
| 742 PrintF(trace_scope_->file(), | 736 PrintF(trace_scope_->file(), |
| 743 "[deoptimizing (DEOPT %s): begin 0x%08" V8PRIxPTR " ", | 737 "[deoptimizing (DEOPT %s): begin 0x%08" V8PRIxPTR " ", |
| 744 MessageFor(bailout_type_), | 738 MessageFor(bailout_type_), |
| 745 reinterpret_cast<intptr_t>(function_)); | 739 reinterpret_cast<intptr_t>(function_)); |
| 746 PrintFunctionName(); | 740 PrintFunctionName(); |
| 747 PrintF(trace_scope_->file(), | 741 PrintF(trace_scope_->file(), |
| 748 " (opt #%d) @%d, FP to SP delta: %d]\n", | 742 " @%d, FP to SP delta: %d]\n", |
| 749 input_data->OptimizationId()->value(), | |
| 750 bailout_id_, | 743 bailout_id_, |
| 751 fp_to_sp_delta_); | 744 fp_to_sp_delta_); |
| 752 if (bailout_type_ == EAGER || bailout_type_ == SOFT) { | 745 if (bailout_type_ == EAGER || bailout_type_ == SOFT) { |
| 753 compiled_code_->PrintDeoptLocation(trace_scope_->file(), bailout_id_); | 746 compiled_code_->PrintDeoptLocation(trace_scope_->file(), bailout_id_); |
| 754 } | 747 } |
| 755 } | 748 } |
| 756 | 749 |
| 750 // Determine basic deoptimization information. The optimized frame is |
| 751 // described by the input data. |
| 752 DeoptimizationInputData* input_data = |
| 753 DeoptimizationInputData::cast(compiled_code_->deoptimization_data()); |
| 757 BailoutId node_id = input_data->AstId(bailout_id_); | 754 BailoutId node_id = input_data->AstId(bailout_id_); |
| 758 ByteArray* translations = input_data->TranslationByteArray(); | 755 ByteArray* translations = input_data->TranslationByteArray(); |
| 759 unsigned translation_index = | 756 unsigned translation_index = |
| 760 input_data->TranslationIndex(bailout_id_)->value(); | 757 input_data->TranslationIndex(bailout_id_)->value(); |
| 761 | 758 |
| 762 // Do the input frame to output frame(s) translation. | 759 // Do the input frame to output frame(s) translation. |
| 763 TranslationIterator iterator(translations, translation_index); | 760 TranslationIterator iterator(translations, translation_index); |
| 764 Translation::Opcode opcode = | 761 Translation::Opcode opcode = |
| 765 static_cast<Translation::Opcode>(iterator.Next()); | 762 static_cast<Translation::Opcode>(iterator.Next()); |
| 766 ASSERT(Translation::BEGIN == opcode); | 763 ASSERT(Translation::BEGIN == opcode); |
| (...skipping 1917 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2684 JSFunction* function) | 2681 JSFunction* function) |
| 2685 : frame_size_(frame_size), | 2682 : frame_size_(frame_size), |
| 2686 function_(function), | 2683 function_(function), |
| 2687 top_(kZapUint32), | 2684 top_(kZapUint32), |
| 2688 pc_(kZapUint32), | 2685 pc_(kZapUint32), |
| 2689 fp_(kZapUint32), | 2686 fp_(kZapUint32), |
| 2690 context_(kZapUint32), | 2687 context_(kZapUint32), |
| 2691 constant_pool_(kZapUint32) { | 2688 constant_pool_(kZapUint32) { |
| 2692 // Zap all the registers. | 2689 // Zap all the registers. |
| 2693 for (int r = 0; r < Register::kNumRegisters; r++) { | 2690 for (int r = 0; r < Register::kNumRegisters; r++) { |
| 2694 // TODO(jbramley): It isn't safe to use kZapUint32 here. If the register | |
| 2695 // isn't used before the next safepoint, the GC will try to scan it as a | |
| 2696 // tagged value. kZapUint32 looks like a valid tagged pointer, but it isn't. | |
| 2697 SetRegister(r, kZapUint32); | 2691 SetRegister(r, kZapUint32); |
| 2698 } | 2692 } |
| 2699 | 2693 |
| 2700 // Zap all the slots. | 2694 // Zap all the slots. |
| 2701 for (unsigned o = 0; o < frame_size; o += kPointerSize) { | 2695 for (unsigned o = 0; o < frame_size; o += kPointerSize) { |
| 2702 SetFrameSlot(o, kZapUint32); | 2696 SetFrameSlot(o, kZapUint32); |
| 2703 } | 2697 } |
| 2704 } | 2698 } |
| 2705 | 2699 |
| 2706 | 2700 |
| (...skipping 756 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3463 | 3457 |
| 3464 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) { | 3458 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) { |
| 3465 v->VisitPointer(BitCast<Object**>(&function_)); | 3459 v->VisitPointer(BitCast<Object**>(&function_)); |
| 3466 v->VisitPointers(parameters_, parameters_ + parameters_count_); | 3460 v->VisitPointers(parameters_, parameters_ + parameters_count_); |
| 3467 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_); | 3461 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_); |
| 3468 } | 3462 } |
| 3469 | 3463 |
| 3470 #endif // ENABLE_DEBUGGER_SUPPORT | 3464 #endif // ENABLE_DEBUGGER_SUPPORT |
| 3471 | 3465 |
| 3472 } } // namespace v8::internal | 3466 } } // namespace v8::internal |
| OLD | NEW |