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 1447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1458 // object to the callee and optionally the space to pass the argument | 1458 // object to the callee and optionally the space to pass the argument |
1459 // object to the stub failure handler. | 1459 // object to the stub failure handler. |
1460 ASSERT(descriptor->register_param_count_ >= 0); | 1460 ASSERT(descriptor->register_param_count_ >= 0); |
1461 int height_in_bytes = kPointerSize * descriptor->register_param_count_ + | 1461 int height_in_bytes = kPointerSize * descriptor->register_param_count_ + |
1462 sizeof(Arguments) + kPointerSize; | 1462 sizeof(Arguments) + kPointerSize; |
1463 int fixed_frame_size = StandardFrameConstants::kFixedFrameSize; | 1463 int fixed_frame_size = StandardFrameConstants::kFixedFrameSize; |
1464 int input_frame_size = input_->GetFrameSize(); | 1464 int input_frame_size = input_->GetFrameSize(); |
1465 int output_frame_size = height_in_bytes + fixed_frame_size; | 1465 int output_frame_size = height_in_bytes + fixed_frame_size; |
1466 if (trace_scope_ != NULL) { | 1466 if (trace_scope_ != NULL) { |
1467 PrintF(trace_scope_->file(), | 1467 PrintF(trace_scope_->file(), |
1468 " translating %s => StubFailure%sTrampolineStub, height=%d\n", | 1468 " translating %s => StubFailureTrampolineStub, height=%d\n", |
1469 CodeStub::MajorName(static_cast<CodeStub::Major>(major_key), false), | 1469 CodeStub::MajorName(static_cast<CodeStub::Major>(major_key), false), |
1470 descriptor->HasTailCallContinuation() ? "TailCall" : "", | |
1471 height_in_bytes); | 1470 height_in_bytes); |
1472 } | 1471 } |
1473 | 1472 |
1474 // The stub failure trampoline is a single frame. | 1473 // The stub failure trampoline is a single frame. |
1475 FrameDescription* output_frame = | 1474 FrameDescription* output_frame = |
1476 new(output_frame_size) FrameDescription(output_frame_size, NULL); | 1475 new(output_frame_size) FrameDescription(output_frame_size, NULL); |
1477 output_frame->SetFrameType(StackFrame::STUB_FAILURE_TRAMPOLINE); | 1476 output_frame->SetFrameType(StackFrame::STUB_FAILURE_TRAMPOLINE); |
1478 ASSERT(frame_index == 0); | 1477 ASSERT(frame_index == 0); |
1479 output_[frame_index] = output_frame; | 1478 output_[frame_index] = output_frame; |
1480 | 1479 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1532 value = reinterpret_cast<intptr_t>( | 1531 value = reinterpret_cast<intptr_t>( |
1533 Smi::FromInt(StackFrame::STUB_FAILURE_TRAMPOLINE)); | 1532 Smi::FromInt(StackFrame::STUB_FAILURE_TRAMPOLINE)); |
1534 output_frame->SetFrameSlot(output_frame_offset, value); | 1533 output_frame->SetFrameSlot(output_frame_offset, value); |
1535 if (trace_scope_ != NULL) { | 1534 if (trace_scope_ != NULL) { |
1536 PrintF(trace_scope_->file(), | 1535 PrintF(trace_scope_->file(), |
1537 " 0x%08" V8PRIxPTR ": [top + %d] <- 0x%08" | 1536 " 0x%08" V8PRIxPTR ": [top + %d] <- 0x%08" |
1538 V8PRIxPTR " ; function (stub failure sentinel)\n", | 1537 V8PRIxPTR " ; function (stub failure sentinel)\n", |
1539 top_address + output_frame_offset, output_frame_offset, value); | 1538 top_address + output_frame_offset, output_frame_offset, value); |
1540 } | 1539 } |
1541 | 1540 |
1542 intptr_t caller_arg_count = descriptor->HasTailCallContinuation() | 1541 intptr_t caller_arg_count = 0; |
1543 ? compiled_code_->arguments_count() + 1 : 0; | |
1544 bool arg_count_known = !descriptor->stack_parameter_count_.is_valid(); | 1542 bool arg_count_known = !descriptor->stack_parameter_count_.is_valid(); |
1545 | 1543 |
1546 // Build the Arguments object for the caller's parameters and a pointer to it. | 1544 // Build the Arguments object for the caller's parameters and a pointer to it. |
1547 output_frame_offset -= kPointerSize; | 1545 output_frame_offset -= kPointerSize; |
1548 int args_arguments_offset = output_frame_offset; | 1546 int args_arguments_offset = output_frame_offset; |
1549 intptr_t the_hole = reinterpret_cast<intptr_t>( | 1547 intptr_t the_hole = reinterpret_cast<intptr_t>( |
1550 isolate_->heap()->the_hole_value()); | 1548 isolate_->heap()->the_hole_value()); |
1551 if (arg_count_known) { | 1549 if (arg_count_known) { |
1552 value = frame_ptr + StandardFrameConstants::kCallerSPOffset + | 1550 value = frame_ptr + StandardFrameConstants::kCallerSPOffset + |
1553 (caller_arg_count - 1) * kPointerSize; | 1551 (caller_arg_count - 1) * kPointerSize; |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1629 } | 1627 } |
1630 | 1628 |
1631 // Copy the double registers from the input into the output frame. | 1629 // Copy the double registers from the input into the output frame. |
1632 CopyDoubleRegisters(output_frame); | 1630 CopyDoubleRegisters(output_frame); |
1633 | 1631 |
1634 // Fill registers containing handler and number of parameters. | 1632 // Fill registers containing handler and number of parameters. |
1635 SetPlatformCompiledStubRegisters(output_frame, descriptor); | 1633 SetPlatformCompiledStubRegisters(output_frame, descriptor); |
1636 | 1634 |
1637 // Compute this frame's PC, state, and continuation. | 1635 // Compute this frame's PC, state, and continuation. |
1638 Code* trampoline = NULL; | 1636 Code* trampoline = NULL; |
1639 if (descriptor->HasTailCallContinuation()) { | 1637 StubFunctionMode function_mode = descriptor->function_mode_; |
1640 StubFailureTailCallTrampolineStub().FindCodeInCache(&trampoline, isolate_); | 1638 StubFailureTrampolineStub(function_mode).FindCodeInCache(&trampoline, |
1641 } else { | 1639 isolate_); |
1642 StubFunctionMode function_mode = descriptor->function_mode_; | |
1643 StubFailureTrampolineStub(function_mode).FindCodeInCache(&trampoline, | |
1644 isolate_); | |
1645 } | |
1646 ASSERT(trampoline != NULL); | 1640 ASSERT(trampoline != NULL); |
1647 output_frame->SetPc(reinterpret_cast<intptr_t>( | 1641 output_frame->SetPc(reinterpret_cast<intptr_t>( |
1648 trampoline->instruction_start())); | 1642 trampoline->instruction_start())); |
1649 output_frame->SetState(Smi::FromInt(FullCodeGenerator::NO_REGISTERS)); | 1643 output_frame->SetState(Smi::FromInt(FullCodeGenerator::NO_REGISTERS)); |
1650 Code* notify_failure = | 1644 Code* notify_failure = |
1651 isolate_->builtins()->builtin(Builtins::kNotifyStubFailure); | 1645 isolate_->builtins()->builtin(Builtins::kNotifyStubFailure); |
1652 output_frame->SetContinuation( | 1646 output_frame->SetContinuation( |
1653 reinterpret_cast<intptr_t>(notify_failure->entry())); | 1647 reinterpret_cast<intptr_t>(notify_failure->entry())); |
1654 } | 1648 } |
1655 | 1649 |
(...skipping 1396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3052 | 3046 |
3053 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) { | 3047 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) { |
3054 v->VisitPointer(BitCast<Object**>(&function_)); | 3048 v->VisitPointer(BitCast<Object**>(&function_)); |
3055 v->VisitPointers(parameters_, parameters_ + parameters_count_); | 3049 v->VisitPointers(parameters_, parameters_ + parameters_count_); |
3056 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_); | 3050 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_); |
3057 } | 3051 } |
3058 | 3052 |
3059 #endif // ENABLE_DEBUGGER_SUPPORT | 3053 #endif // ENABLE_DEBUGGER_SUPPORT |
3060 | 3054 |
3061 } } // namespace v8::internal | 3055 } } // namespace v8::internal |
OLD | NEW |