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 1537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1548 | 1548 |
1549 CHECK(compiled_code_->is_hydrogen_stub()); | 1549 CHECK(compiled_code_->is_hydrogen_stub()); |
1550 int major_key = compiled_code_->major_key(); | 1550 int major_key = compiled_code_->major_key(); |
1551 CodeStubInterfaceDescriptor* descriptor = | 1551 CodeStubInterfaceDescriptor* descriptor = |
1552 isolate_->code_stub_interface_descriptor(major_key); | 1552 isolate_->code_stub_interface_descriptor(major_key); |
1553 | 1553 |
1554 // The output frame must have room for all pushed register parameters | 1554 // The output frame must have room for all pushed register parameters |
1555 // and the standard stack frame slots. Include space for an argument | 1555 // and the standard stack frame slots. Include space for an argument |
1556 // object to the callee and optionally the space to pass the argument | 1556 // object to the callee and optionally the space to pass the argument |
1557 // object to the stub failure handler. | 1557 // object to the stub failure handler. |
1558 CHECK_GE(descriptor->register_param_count(), 0); | 1558 int param_count = descriptor->GetEnvironmentParameterCount(); |
1559 int height_in_bytes = kPointerSize * descriptor->register_param_count() + | 1559 CHECK_GE(param_count, 0); |
1560 sizeof(Arguments) + kPointerSize; | 1560 |
| 1561 int height_in_bytes = kPointerSize * param_count + sizeof(Arguments) + |
| 1562 kPointerSize; |
1561 int fixed_frame_size = StandardFrameConstants::kFixedFrameSize; | 1563 int fixed_frame_size = StandardFrameConstants::kFixedFrameSize; |
1562 int input_frame_size = input_->GetFrameSize(); | 1564 int input_frame_size = input_->GetFrameSize(); |
1563 int output_frame_size = height_in_bytes + fixed_frame_size; | 1565 int output_frame_size = height_in_bytes + fixed_frame_size; |
1564 if (trace_scope_ != NULL) { | 1566 if (trace_scope_ != NULL) { |
1565 PrintF(trace_scope_->file(), | 1567 PrintF(trace_scope_->file(), |
1566 " translating %s => StubFailureTrampolineStub, height=%d\n", | 1568 " translating %s => StubFailureTrampolineStub, height=%d\n", |
1567 CodeStub::MajorName(static_cast<CodeStub::Major>(major_key), false), | 1569 CodeStub::MajorName(static_cast<CodeStub::Major>(major_key), false), |
1568 height_in_bytes); | 1570 height_in_bytes); |
1569 } | 1571 } |
1570 | 1572 |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1692 output_frame->SetFrameSlot(output_frame_offset, value); | 1694 output_frame->SetFrameSlot(output_frame_offset, value); |
1693 if (trace_scope_ != NULL) { | 1695 if (trace_scope_ != NULL) { |
1694 PrintF(trace_scope_->file(), | 1696 PrintF(trace_scope_->file(), |
1695 " 0x%08" V8PRIxPTR ": [top + %d] <- 0x%08" | 1697 " 0x%08" V8PRIxPTR ": [top + %d] <- 0x%08" |
1696 V8PRIxPTR " ; args*\n", | 1698 V8PRIxPTR " ; args*\n", |
1697 top_address + output_frame_offset, output_frame_offset, value); | 1699 top_address + output_frame_offset, output_frame_offset, value); |
1698 } | 1700 } |
1699 | 1701 |
1700 // Copy the register parameters to the failure frame. | 1702 // Copy the register parameters to the failure frame. |
1701 int arguments_length_offset = -1; | 1703 int arguments_length_offset = -1; |
1702 for (int i = 0; i < descriptor->register_param_count(); ++i) { | 1704 for (int i = 0; i < param_count; ++i) { |
1703 output_frame_offset -= kPointerSize; | 1705 output_frame_offset -= kPointerSize; |
1704 DoTranslateCommand(iterator, 0, output_frame_offset); | 1706 DoTranslateCommand(iterator, 0, output_frame_offset); |
1705 | 1707 |
1706 if (!arg_count_known && descriptor->IsParameterCountRegister(i)) { | 1708 if (!arg_count_known && |
| 1709 descriptor->IsEnvironmentParameterCountRegister(i)) { |
1707 arguments_length_offset = output_frame_offset; | 1710 arguments_length_offset = output_frame_offset; |
1708 } | 1711 } |
1709 } | 1712 } |
1710 | 1713 |
1711 CHECK_EQ(output_frame_offset, 0); | 1714 CHECK_EQ(output_frame_offset, 0); |
1712 | 1715 |
1713 if (!arg_count_known) { | 1716 if (!arg_count_known) { |
1714 CHECK_GE(arguments_length_offset, 0); | 1717 CHECK_GE(arguments_length_offset, 0); |
1715 // We know it's a smi because 1) the code stub guarantees the stack | 1718 // We know it's a smi because 1) the code stub guarantees the stack |
1716 // parameter count is in smi range, and 2) the DoTranslateCommand in the | 1719 // parameter count is in smi range, and 2) the DoTranslateCommand in the |
(...skipping 1868 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3585 } | 3588 } |
3586 | 3589 |
3587 | 3590 |
3588 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) { | 3591 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) { |
3589 v->VisitPointer(BitCast<Object**>(&function_)); | 3592 v->VisitPointer(BitCast<Object**>(&function_)); |
3590 v->VisitPointers(parameters_, parameters_ + parameters_count_); | 3593 v->VisitPointers(parameters_, parameters_ + parameters_count_); |
3591 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_); | 3594 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_); |
3592 } | 3595 } |
3593 | 3596 |
3594 } } // namespace v8::internal | 3597 } } // namespace v8::internal |
OLD | NEW |