Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1213)

Side by Side Diff: src/deoptimizer.cc

Issue 352583002: The IC exposes a register definition. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments. Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/code-stubs-hydrogen.cc ('k') | src/ia32/code-stubs-ia32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1540 matching lines...) Expand 10 before | Expand all | Expand 10 after
1551 CHECK(compiled_code_->is_crankshafted() && 1551 CHECK(compiled_code_->is_crankshafted() &&
1552 compiled_code_->kind() != Code::OPTIMIZED_FUNCTION); 1552 compiled_code_->kind() != Code::OPTIMIZED_FUNCTION);
1553 int major_key = compiled_code_->major_key(); 1553 int major_key = compiled_code_->major_key();
1554 CodeStubInterfaceDescriptor* descriptor = 1554 CodeStubInterfaceDescriptor* descriptor =
1555 isolate_->code_stub_interface_descriptor(major_key); 1555 isolate_->code_stub_interface_descriptor(major_key);
1556 1556
1557 // The output frame must have room for all pushed register parameters 1557 // The output frame must have room for all pushed register parameters
1558 // and the standard stack frame slots. Include space for an argument 1558 // and the standard stack frame slots. Include space for an argument
1559 // object to the callee and optionally the space to pass the argument 1559 // object to the callee and optionally the space to pass the argument
1560 // object to the stub failure handler. 1560 // object to the stub failure handler.
1561 CHECK_GE(descriptor->register_param_count_, 0); 1561 CHECK_GE(descriptor->register_param_count(), 0);
1562 int height_in_bytes = kPointerSize * descriptor->register_param_count_ + 1562 int height_in_bytes = kPointerSize * descriptor->register_param_count() +
1563 sizeof(Arguments) + kPointerSize; 1563 sizeof(Arguments) + kPointerSize;
1564 int fixed_frame_size = StandardFrameConstants::kFixedFrameSize; 1564 int fixed_frame_size = StandardFrameConstants::kFixedFrameSize;
1565 int input_frame_size = input_->GetFrameSize(); 1565 int input_frame_size = input_->GetFrameSize();
1566 int output_frame_size = height_in_bytes + fixed_frame_size; 1566 int output_frame_size = height_in_bytes + fixed_frame_size;
1567 if (trace_scope_ != NULL) { 1567 if (trace_scope_ != NULL) {
1568 PrintF(trace_scope_->file(), 1568 PrintF(trace_scope_->file(),
1569 " translating %s => StubFailureTrampolineStub, height=%d\n", 1569 " translating %s => StubFailureTrampolineStub, height=%d\n",
1570 CodeStub::MajorName(static_cast<CodeStub::Major>(major_key), false), 1570 CodeStub::MajorName(static_cast<CodeStub::Major>(major_key), false),
1571 height_in_bytes); 1571 height_in_bytes);
1572 } 1572 }
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
1647 Smi::FromInt(StackFrame::STUB_FAILURE_TRAMPOLINE)); 1647 Smi::FromInt(StackFrame::STUB_FAILURE_TRAMPOLINE));
1648 output_frame->SetFrameSlot(output_frame_offset, value); 1648 output_frame->SetFrameSlot(output_frame_offset, value);
1649 if (trace_scope_ != NULL) { 1649 if (trace_scope_ != NULL) {
1650 PrintF(trace_scope_->file(), 1650 PrintF(trace_scope_->file(),
1651 " 0x%08" V8PRIxPTR ": [top + %d] <- 0x%08" 1651 " 0x%08" V8PRIxPTR ": [top + %d] <- 0x%08"
1652 V8PRIxPTR " ; function (stub failure sentinel)\n", 1652 V8PRIxPTR " ; function (stub failure sentinel)\n",
1653 top_address + output_frame_offset, output_frame_offset, value); 1653 top_address + output_frame_offset, output_frame_offset, value);
1654 } 1654 }
1655 1655
1656 intptr_t caller_arg_count = 0; 1656 intptr_t caller_arg_count = 0;
1657 bool arg_count_known = !descriptor->stack_parameter_count_.is_valid(); 1657 bool arg_count_known = !descriptor->stack_parameter_count().is_valid();
1658 1658
1659 // Build the Arguments object for the caller's parameters and a pointer to it. 1659 // Build the Arguments object for the caller's parameters and a pointer to it.
1660 output_frame_offset -= kPointerSize; 1660 output_frame_offset -= kPointerSize;
1661 int args_arguments_offset = output_frame_offset; 1661 int args_arguments_offset = output_frame_offset;
1662 intptr_t the_hole = reinterpret_cast<intptr_t>( 1662 intptr_t the_hole = reinterpret_cast<intptr_t>(
1663 isolate_->heap()->the_hole_value()); 1663 isolate_->heap()->the_hole_value());
1664 if (arg_count_known) { 1664 if (arg_count_known) {
1665 value = frame_ptr + StandardFrameConstants::kCallerSPOffset + 1665 value = frame_ptr + StandardFrameConstants::kCallerSPOffset +
1666 (caller_arg_count - 1) * kPointerSize; 1666 (caller_arg_count - 1) * kPointerSize;
1667 } else { 1667 } else {
(...skipping 27 matching lines...) Expand all
1695 output_frame->SetFrameSlot(output_frame_offset, value); 1695 output_frame->SetFrameSlot(output_frame_offset, value);
1696 if (trace_scope_ != NULL) { 1696 if (trace_scope_ != NULL) {
1697 PrintF(trace_scope_->file(), 1697 PrintF(trace_scope_->file(),
1698 " 0x%08" V8PRIxPTR ": [top + %d] <- 0x%08" 1698 " 0x%08" V8PRIxPTR ": [top + %d] <- 0x%08"
1699 V8PRIxPTR " ; args*\n", 1699 V8PRIxPTR " ; args*\n",
1700 top_address + output_frame_offset, output_frame_offset, value); 1700 top_address + output_frame_offset, output_frame_offset, value);
1701 } 1701 }
1702 1702
1703 // Copy the register parameters to the failure frame. 1703 // Copy the register parameters to the failure frame.
1704 int arguments_length_offset = -1; 1704 int arguments_length_offset = -1;
1705 for (int i = 0; i < descriptor->register_param_count_; ++i) { 1705 for (int i = 0; i < descriptor->register_param_count(); ++i) {
1706 output_frame_offset -= kPointerSize; 1706 output_frame_offset -= kPointerSize;
1707 DoTranslateCommand(iterator, 0, output_frame_offset); 1707 DoTranslateCommand(iterator, 0, output_frame_offset);
1708 1708
1709 if (!arg_count_known && descriptor->IsParameterCountRegister(i)) { 1709 if (!arg_count_known && descriptor->IsParameterCountRegister(i)) {
1710 arguments_length_offset = output_frame_offset; 1710 arguments_length_offset = output_frame_offset;
1711 } 1711 }
1712 } 1712 }
1713 1713
1714 CHECK_EQ(output_frame_offset, 0); 1714 CHECK_EQ(output_frame_offset, 0);
1715 1715
(...skipping 26 matching lines...) Expand all
1742 } 1742 }
1743 1743
1744 // Copy the double registers from the input into the output frame. 1744 // Copy the double registers from the input into the output frame.
1745 CopyDoubleRegisters(output_frame); 1745 CopyDoubleRegisters(output_frame);
1746 1746
1747 // Fill registers containing handler and number of parameters. 1747 // Fill registers containing handler and number of parameters.
1748 SetPlatformCompiledStubRegisters(output_frame, descriptor); 1748 SetPlatformCompiledStubRegisters(output_frame, descriptor);
1749 1749
1750 // Compute this frame's PC, state, and continuation. 1750 // Compute this frame's PC, state, and continuation.
1751 Code* trampoline = NULL; 1751 Code* trampoline = NULL;
1752 StubFunctionMode function_mode = descriptor->function_mode_; 1752 StubFunctionMode function_mode = descriptor->function_mode();
1753 StubFailureTrampolineStub(isolate_, 1753 StubFailureTrampolineStub(isolate_,
1754 function_mode).FindCodeInCache(&trampoline); 1754 function_mode).FindCodeInCache(&trampoline);
1755 ASSERT(trampoline != NULL); 1755 ASSERT(trampoline != NULL);
1756 output_frame->SetPc(reinterpret_cast<intptr_t>( 1756 output_frame->SetPc(reinterpret_cast<intptr_t>(
1757 trampoline->instruction_start())); 1757 trampoline->instruction_start()));
1758 if (FLAG_enable_ool_constant_pool) { 1758 if (FLAG_enable_ool_constant_pool) {
1759 Register constant_pool_reg = 1759 Register constant_pool_reg =
1760 StubFailureTrampolineFrame::constant_pool_pointer_register(); 1760 StubFailureTrampolineFrame::constant_pool_pointer_register();
1761 intptr_t constant_pool_value = 1761 intptr_t constant_pool_value =
1762 reinterpret_cast<intptr_t>(trampoline->constant_pool()); 1762 reinterpret_cast<intptr_t>(trampoline->constant_pool());
(...skipping 1819 matching lines...) Expand 10 before | Expand all | Expand 10 after
3582 } 3582 }
3583 3583
3584 3584
3585 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) { 3585 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) {
3586 v->VisitPointer(BitCast<Object**>(&function_)); 3586 v->VisitPointer(BitCast<Object**>(&function_));
3587 v->VisitPointers(parameters_, parameters_ + parameters_count_); 3587 v->VisitPointers(parameters_, parameters_ + parameters_count_);
3588 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_); 3588 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_);
3589 } 3589 }
3590 3590
3591 } } // namespace v8::internal 3591 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/code-stubs-hydrogen.cc ('k') | src/ia32/code-stubs-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698