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

Side by Side Diff: src/deoptimizer.cc

Issue 544123002: Do not cache CodeStubInterfaceDescriptor on the isolate. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 3 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
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 1604 matching lines...) Expand 10 before | Expand all | Expand 10 after
1615 // | caller stack param n | 1615 // | caller stack param n |
1616 // +-------------------------+<-spreg 1616 // +-------------------------+<-spreg
1617 // reg = number of parameters 1617 // reg = number of parameters
1618 // reg = failure handler address 1618 // reg = failure handler address
1619 // reg = saved frame 1619 // reg = saved frame
1620 // reg = JSFunction context 1620 // reg = JSFunction context
1621 // 1621 //
1622 1622
1623 CHECK(compiled_code_->is_hydrogen_stub()); 1623 CHECK(compiled_code_->is_hydrogen_stub());
1624 int major_key = CodeStub::GetMajorKey(compiled_code_); 1624 int major_key = CodeStub::GetMajorKey(compiled_code_);
1625 CodeStubInterfaceDescriptor* descriptor = 1625 CodeStubInterfaceDescriptor descriptor;
1626 isolate_->code_stub_interface_descriptor(major_key); 1626 CodeStub::InitializeInterfaceDescriptor(isolate_, compiled_code_->stub_key(),
1627 &descriptor);
1627 // Check that there is a matching descriptor to the major key. 1628 // Check that there is a matching descriptor to the major key.
1628 // This will fail if there has not been one installed to the isolate. 1629 // This will fail if there has not been one installed to the isolate.
1629 DCHECK_EQ(descriptor->MajorKey(), major_key); 1630 DCHECK_EQ(descriptor.MajorKey(), major_key);
1630 1631
1631 // The output frame must have room for all pushed register parameters 1632 // The output frame must have room for all pushed register parameters
1632 // and the standard stack frame slots. Include space for an argument 1633 // and the standard stack frame slots. Include space for an argument
1633 // object to the callee and optionally the space to pass the argument 1634 // object to the callee and optionally the space to pass the argument
1634 // object to the stub failure handler. 1635 // object to the stub failure handler.
1635 int param_count = descriptor->GetEnvironmentParameterCount(); 1636 int param_count = descriptor.GetEnvironmentParameterCount();
1636 CHECK_GE(param_count, 0); 1637 CHECK_GE(param_count, 0);
1637 1638
1638 int height_in_bytes = kPointerSize * param_count + sizeof(Arguments) + 1639 int height_in_bytes = kPointerSize * param_count + sizeof(Arguments) +
1639 kPointerSize; 1640 kPointerSize;
1640 int fixed_frame_size = StandardFrameConstants::kFixedFrameSize; 1641 int fixed_frame_size = StandardFrameConstants::kFixedFrameSize;
1641 int input_frame_size = input_->GetFrameSize(); 1642 int input_frame_size = input_->GetFrameSize();
1642 int output_frame_size = height_in_bytes + fixed_frame_size; 1643 int output_frame_size = height_in_bytes + fixed_frame_size;
1643 if (trace_scope_ != NULL) { 1644 if (trace_scope_ != NULL) {
1644 PrintF(trace_scope_->file(), 1645 PrintF(trace_scope_->file(),
1645 " translating %s => StubFailureTrampolineStub, height=%d\n", 1646 " translating %s => StubFailureTrampolineStub, height=%d\n",
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
1723 Smi::FromInt(StackFrame::STUB_FAILURE_TRAMPOLINE)); 1724 Smi::FromInt(StackFrame::STUB_FAILURE_TRAMPOLINE));
1724 output_frame->SetFrameSlot(output_frame_offset, value); 1725 output_frame->SetFrameSlot(output_frame_offset, value);
1725 if (trace_scope_ != NULL) { 1726 if (trace_scope_ != NULL) {
1726 PrintF(trace_scope_->file(), 1727 PrintF(trace_scope_->file(),
1727 " 0x%08" V8PRIxPTR ": [top + %d] <- 0x%08" 1728 " 0x%08" V8PRIxPTR ": [top + %d] <- 0x%08"
1728 V8PRIxPTR " ; function (stub failure sentinel)\n", 1729 V8PRIxPTR " ; function (stub failure sentinel)\n",
1729 top_address + output_frame_offset, output_frame_offset, value); 1730 top_address + output_frame_offset, output_frame_offset, value);
1730 } 1731 }
1731 1732
1732 intptr_t caller_arg_count = 0; 1733 intptr_t caller_arg_count = 0;
1733 bool arg_count_known = !descriptor->stack_parameter_count().is_valid(); 1734 bool arg_count_known = !descriptor.stack_parameter_count().is_valid();
1734 1735
1735 // Build the Arguments object for the caller's parameters and a pointer to it. 1736 // Build the Arguments object for the caller's parameters and a pointer to it.
1736 output_frame_offset -= kPointerSize; 1737 output_frame_offset -= kPointerSize;
1737 int args_arguments_offset = output_frame_offset; 1738 int args_arguments_offset = output_frame_offset;
1738 intptr_t the_hole = reinterpret_cast<intptr_t>( 1739 intptr_t the_hole = reinterpret_cast<intptr_t>(
1739 isolate_->heap()->the_hole_value()); 1740 isolate_->heap()->the_hole_value());
1740 if (arg_count_known) { 1741 if (arg_count_known) {
1741 value = frame_ptr + StandardFrameConstants::kCallerSPOffset + 1742 value = frame_ptr + StandardFrameConstants::kCallerSPOffset +
1742 (caller_arg_count - 1) * kPointerSize; 1743 (caller_arg_count - 1) * kPointerSize;
1743 } else { 1744 } else {
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
1775 V8PRIxPTR " ; args*\n", 1776 V8PRIxPTR " ; args*\n",
1776 top_address + output_frame_offset, output_frame_offset, value); 1777 top_address + output_frame_offset, output_frame_offset, value);
1777 } 1778 }
1778 1779
1779 // Copy the register parameters to the failure frame. 1780 // Copy the register parameters to the failure frame.
1780 int arguments_length_offset = -1; 1781 int arguments_length_offset = -1;
1781 for (int i = 0; i < param_count; ++i) { 1782 for (int i = 0; i < param_count; ++i) {
1782 output_frame_offset -= kPointerSize; 1783 output_frame_offset -= kPointerSize;
1783 DoTranslateCommand(iterator, 0, output_frame_offset); 1784 DoTranslateCommand(iterator, 0, output_frame_offset);
1784 1785
1785 if (!arg_count_known && 1786 if (!arg_count_known && descriptor.IsEnvironmentParameterCountRegister(i)) {
1786 descriptor->IsEnvironmentParameterCountRegister(i)) {
1787 arguments_length_offset = output_frame_offset; 1787 arguments_length_offset = output_frame_offset;
1788 } 1788 }
1789 } 1789 }
1790 1790
1791 CHECK_EQ(output_frame_offset, 0); 1791 CHECK_EQ(output_frame_offset, 0);
1792 1792
1793 if (!arg_count_known) { 1793 if (!arg_count_known) {
1794 CHECK_GE(arguments_length_offset, 0); 1794 CHECK_GE(arguments_length_offset, 0);
1795 // We know it's a smi because 1) the code stub guarantees the stack 1795 // We know it's a smi because 1) the code stub guarantees the stack
1796 // parameter count is in smi range, and 2) the DoTranslateCommand in the 1796 // parameter count is in smi range, and 2) the DoTranslateCommand in the
(...skipping 18 matching lines...) Expand all
1815 V8PRIxPTR " ; args.arguments\n", 1815 V8PRIxPTR " ; args.arguments\n",
1816 top_address + args_arguments_offset, args_arguments_offset, 1816 top_address + args_arguments_offset, args_arguments_offset,
1817 value); 1817 value);
1818 } 1818 }
1819 } 1819 }
1820 1820
1821 // Copy the double registers from the input into the output frame. 1821 // Copy the double registers from the input into the output frame.
1822 CopyDoubleRegisters(output_frame); 1822 CopyDoubleRegisters(output_frame);
1823 1823
1824 // Fill registers containing handler and number of parameters. 1824 // Fill registers containing handler and number of parameters.
1825 SetPlatformCompiledStubRegisters(output_frame, descriptor); 1825 SetPlatformCompiledStubRegisters(output_frame, &descriptor);
1826 1826
1827 // Compute this frame's PC, state, and continuation. 1827 // Compute this frame's PC, state, and continuation.
1828 Code* trampoline = NULL; 1828 Code* trampoline = NULL;
1829 StubFunctionMode function_mode = descriptor->function_mode(); 1829 StubFunctionMode function_mode = descriptor.function_mode();
1830 StubFailureTrampolineStub(isolate_, 1830 StubFailureTrampolineStub(isolate_,
1831 function_mode).FindCodeInCache(&trampoline); 1831 function_mode).FindCodeInCache(&trampoline);
1832 DCHECK(trampoline != NULL); 1832 DCHECK(trampoline != NULL);
1833 output_frame->SetPc(reinterpret_cast<intptr_t>( 1833 output_frame->SetPc(reinterpret_cast<intptr_t>(
1834 trampoline->instruction_start())); 1834 trampoline->instruction_start()));
1835 if (FLAG_enable_ool_constant_pool) { 1835 if (FLAG_enable_ool_constant_pool) {
1836 Register constant_pool_reg = 1836 Register constant_pool_reg =
1837 StubFailureTrampolineFrame::constant_pool_pointer_register(); 1837 StubFailureTrampolineFrame::constant_pool_pointer_register();
1838 intptr_t constant_pool_value = 1838 intptr_t constant_pool_value =
1839 reinterpret_cast<intptr_t>(trampoline->constant_pool()); 1839 reinterpret_cast<intptr_t>(trampoline->constant_pool());
(...skipping 1835 matching lines...) Expand 10 before | Expand all | Expand 10 after
3675 3675
3676 3676
3677 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) { 3677 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) {
3678 v->VisitPointer(BitCast<Object**>(&function_)); 3678 v->VisitPointer(BitCast<Object**>(&function_));
3679 v->VisitPointer(&context_); 3679 v->VisitPointer(&context_);
3680 v->VisitPointers(parameters_, parameters_ + parameters_count_); 3680 v->VisitPointers(parameters_, parameters_ + parameters_count_);
3681 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_); 3681 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_);
3682 } 3682 }
3683 3683
3684 } } // namespace v8::internal 3684 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698