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 1517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1528 // object to the callee and optionally the space to pass the argument | 1528 // object to the callee and optionally the space to pass the argument |
1529 // object to the stub failure handler. | 1529 // object to the stub failure handler. |
1530 ASSERT(descriptor->register_param_count_ >= 0); | 1530 ASSERT(descriptor->register_param_count_ >= 0); |
1531 int height_in_bytes = kPointerSize * descriptor->register_param_count_ + | 1531 int height_in_bytes = kPointerSize * descriptor->register_param_count_ + |
1532 sizeof(Arguments) + kPointerSize; | 1532 sizeof(Arguments) + kPointerSize; |
1533 int fixed_frame_size = StandardFrameConstants::kFixedFrameSize; | 1533 int fixed_frame_size = StandardFrameConstants::kFixedFrameSize; |
1534 int input_frame_size = input_->GetFrameSize(); | 1534 int input_frame_size = input_->GetFrameSize(); |
1535 int output_frame_size = height_in_bytes + fixed_frame_size; | 1535 int output_frame_size = height_in_bytes + fixed_frame_size; |
1536 if (trace_scope_ != NULL) { | 1536 if (trace_scope_ != NULL) { |
1537 PrintF(trace_scope_->file(), | 1537 PrintF(trace_scope_->file(), |
1538 " translating %s => StubFailure%sTrampolineStub, height=%d\n", | 1538 " translating %s => StubFailureTrampolineStub, height=%d\n", |
1539 CodeStub::MajorName(static_cast<CodeStub::Major>(major_key), false), | 1539 CodeStub::MajorName(static_cast<CodeStub::Major>(major_key), false), |
1540 descriptor->HasTailCallContinuation() ? "TailCall" : "", | |
1541 height_in_bytes); | 1540 height_in_bytes); |
1542 } | 1541 } |
1543 | 1542 |
1544 // The stub failure trampoline is a single frame. | 1543 // The stub failure trampoline is a single frame. |
1545 FrameDescription* output_frame = | 1544 FrameDescription* output_frame = |
1546 new(output_frame_size) FrameDescription(output_frame_size, NULL); | 1545 new(output_frame_size) FrameDescription(output_frame_size, NULL); |
1547 output_frame->SetFrameType(StackFrame::STUB_FAILURE_TRAMPOLINE); | 1546 output_frame->SetFrameType(StackFrame::STUB_FAILURE_TRAMPOLINE); |
1548 ASSERT(frame_index == 0); | 1547 ASSERT(frame_index == 0); |
1549 output_[frame_index] = output_frame; | 1548 output_[frame_index] = output_frame; |
1550 | 1549 |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1619 value = reinterpret_cast<intptr_t>( | 1618 value = reinterpret_cast<intptr_t>( |
1620 Smi::FromInt(StackFrame::STUB_FAILURE_TRAMPOLINE)); | 1619 Smi::FromInt(StackFrame::STUB_FAILURE_TRAMPOLINE)); |
1621 output_frame->SetFrameSlot(output_frame_offset, value); | 1620 output_frame->SetFrameSlot(output_frame_offset, value); |
1622 if (trace_scope_ != NULL) { | 1621 if (trace_scope_ != NULL) { |
1623 PrintF(trace_scope_->file(), | 1622 PrintF(trace_scope_->file(), |
1624 " 0x%08" V8PRIxPTR ": [top + %d] <- 0x%08" | 1623 " 0x%08" V8PRIxPTR ": [top + %d] <- 0x%08" |
1625 V8PRIxPTR " ; function (stub failure sentinel)\n", | 1624 V8PRIxPTR " ; function (stub failure sentinel)\n", |
1626 top_address + output_frame_offset, output_frame_offset, value); | 1625 top_address + output_frame_offset, output_frame_offset, value); |
1627 } | 1626 } |
1628 | 1627 |
1629 intptr_t caller_arg_count = descriptor->HasTailCallContinuation() | 1628 intptr_t caller_arg_count = 0; |
1630 ? compiled_code_->arguments_count() + 1 : 0; | |
1631 bool arg_count_known = !descriptor->stack_parameter_count_.is_valid(); | 1629 bool arg_count_known = !descriptor->stack_parameter_count_.is_valid(); |
1632 | 1630 |
1633 // Build the Arguments object for the caller's parameters and a pointer to it. | 1631 // Build the Arguments object for the caller's parameters and a pointer to it. |
1634 output_frame_offset -= kPointerSize; | 1632 output_frame_offset -= kPointerSize; |
1635 int args_arguments_offset = output_frame_offset; | 1633 int args_arguments_offset = output_frame_offset; |
1636 intptr_t the_hole = reinterpret_cast<intptr_t>( | 1634 intptr_t the_hole = reinterpret_cast<intptr_t>( |
1637 isolate_->heap()->the_hole_value()); | 1635 isolate_->heap()->the_hole_value()); |
1638 if (arg_count_known) { | 1636 if (arg_count_known) { |
1639 value = frame_ptr + StandardFrameConstants::kCallerSPOffset + | 1637 value = frame_ptr + StandardFrameConstants::kCallerSPOffset + |
1640 (caller_arg_count - 1) * kPointerSize; | 1638 (caller_arg_count - 1) * kPointerSize; |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1716 } | 1714 } |
1717 | 1715 |
1718 // Copy the double registers from the input into the output frame. | 1716 // Copy the double registers from the input into the output frame. |
1719 CopyDoubleRegisters(output_frame); | 1717 CopyDoubleRegisters(output_frame); |
1720 | 1718 |
1721 // Fill registers containing handler and number of parameters. | 1719 // Fill registers containing handler and number of parameters. |
1722 SetPlatformCompiledStubRegisters(output_frame, descriptor); | 1720 SetPlatformCompiledStubRegisters(output_frame, descriptor); |
1723 | 1721 |
1724 // Compute this frame's PC, state, and continuation. | 1722 // Compute this frame's PC, state, and continuation. |
1725 Code* trampoline = NULL; | 1723 Code* trampoline = NULL; |
1726 if (descriptor->HasTailCallContinuation()) { | 1724 StubFunctionMode function_mode = descriptor->function_mode_; |
1727 StubFailureTailCallTrampolineStub().FindCodeInCache(&trampoline, isolate_); | 1725 StubFailureTrampolineStub(function_mode).FindCodeInCache(&trampoline, |
1728 } else { | 1726 isolate_); |
1729 StubFunctionMode function_mode = descriptor->function_mode_; | |
1730 StubFailureTrampolineStub(function_mode).FindCodeInCache(&trampoline, | |
1731 isolate_); | |
1732 } | |
1733 ASSERT(trampoline != NULL); | 1727 ASSERT(trampoline != NULL); |
1734 output_frame->SetPc(reinterpret_cast<intptr_t>( | 1728 output_frame->SetPc(reinterpret_cast<intptr_t>( |
1735 trampoline->instruction_start())); | 1729 trampoline->instruction_start())); |
1736 output_frame->SetState(Smi::FromInt(FullCodeGenerator::NO_REGISTERS)); | 1730 output_frame->SetState(Smi::FromInt(FullCodeGenerator::NO_REGISTERS)); |
1737 Code* notify_failure = NotifyStubFailureBuiltin(); | 1731 Code* notify_failure = NotifyStubFailureBuiltin(); |
1738 output_frame->SetContinuation( | 1732 output_frame->SetContinuation( |
1739 reinterpret_cast<intptr_t>(notify_failure->entry())); | 1733 reinterpret_cast<intptr_t>(notify_failure->entry())); |
1740 } | 1734 } |
1741 | 1735 |
1742 | 1736 |
(...skipping 1720 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 |