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

Side by Side Diff: src/deoptimizer.cc

Issue 71783003: Reland and fix "Add support for keyed-call on arrays of fast elements" (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Test + fix Created 7 years, 1 month 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/compiler.cc ('k') | src/frames.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 // 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
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 => StubFailureTrampolineStub, height=%d\n", 1468 " translating %s => StubFailure%sTrampolineStub, 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" : "",
1470 height_in_bytes); 1471 height_in_bytes);
1471 } 1472 }
1472 1473
1473 // The stub failure trampoline is a single frame. 1474 // The stub failure trampoline is a single frame.
1474 FrameDescription* output_frame = 1475 FrameDescription* output_frame =
1475 new(output_frame_size) FrameDescription(output_frame_size, NULL); 1476 new(output_frame_size) FrameDescription(output_frame_size, NULL);
1476 output_frame->SetFrameType(StackFrame::STUB_FAILURE_TRAMPOLINE); 1477 output_frame->SetFrameType(StackFrame::STUB_FAILURE_TRAMPOLINE);
1477 ASSERT(frame_index == 0); 1478 ASSERT(frame_index == 0);
1478 output_[frame_index] = output_frame; 1479 output_[frame_index] = output_frame;
1479 1480
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
1531 value = reinterpret_cast<intptr_t>( 1532 value = reinterpret_cast<intptr_t>(
1532 Smi::FromInt(StackFrame::STUB_FAILURE_TRAMPOLINE)); 1533 Smi::FromInt(StackFrame::STUB_FAILURE_TRAMPOLINE));
1533 output_frame->SetFrameSlot(output_frame_offset, value); 1534 output_frame->SetFrameSlot(output_frame_offset, value);
1534 if (trace_scope_ != NULL) { 1535 if (trace_scope_ != NULL) {
1535 PrintF(trace_scope_->file(), 1536 PrintF(trace_scope_->file(),
1536 " 0x%08" V8PRIxPTR ": [top + %d] <- 0x%08" 1537 " 0x%08" V8PRIxPTR ": [top + %d] <- 0x%08"
1537 V8PRIxPTR " ; function (stub failure sentinel)\n", 1538 V8PRIxPTR " ; function (stub failure sentinel)\n",
1538 top_address + output_frame_offset, output_frame_offset, value); 1539 top_address + output_frame_offset, output_frame_offset, value);
1539 } 1540 }
1540 1541
1541 intptr_t caller_arg_count = 0; 1542 intptr_t caller_arg_count = descriptor->HasTailCallContinuation()
1543 ? compiled_code_->arguments_count() + 1 : 0;
1542 bool arg_count_known = !descriptor->stack_parameter_count_.is_valid(); 1544 bool arg_count_known = !descriptor->stack_parameter_count_.is_valid();
1543 1545
1544 // Build the Arguments object for the caller's parameters and a pointer to it. 1546 // Build the Arguments object for the caller's parameters and a pointer to it.
1545 output_frame_offset -= kPointerSize; 1547 output_frame_offset -= kPointerSize;
1546 int args_arguments_offset = output_frame_offset; 1548 int args_arguments_offset = output_frame_offset;
1547 intptr_t the_hole = reinterpret_cast<intptr_t>( 1549 intptr_t the_hole = reinterpret_cast<intptr_t>(
1548 isolate_->heap()->the_hole_value()); 1550 isolate_->heap()->the_hole_value());
1549 if (arg_count_known) { 1551 if (arg_count_known) {
1550 value = frame_ptr + StandardFrameConstants::kCallerSPOffset + 1552 value = frame_ptr + StandardFrameConstants::kCallerSPOffset +
1551 (caller_arg_count - 1) * kPointerSize; 1553 (caller_arg_count - 1) * kPointerSize;
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
1627 } 1629 }
1628 1630
1629 // Copy the double registers from the input into the output frame. 1631 // Copy the double registers from the input into the output frame.
1630 CopyDoubleRegisters(output_frame); 1632 CopyDoubleRegisters(output_frame);
1631 1633
1632 // Fill registers containing handler and number of parameters. 1634 // Fill registers containing handler and number of parameters.
1633 SetPlatformCompiledStubRegisters(output_frame, descriptor); 1635 SetPlatformCompiledStubRegisters(output_frame, descriptor);
1634 1636
1635 // Compute this frame's PC, state, and continuation. 1637 // Compute this frame's PC, state, and continuation.
1636 Code* trampoline = NULL; 1638 Code* trampoline = NULL;
1637 StubFunctionMode function_mode = descriptor->function_mode_; 1639 if (descriptor->HasTailCallContinuation()) {
1638 StubFailureTrampolineStub(function_mode).FindCodeInCache(&trampoline, 1640 StubFailureTailCallTrampolineStub().FindCodeInCache(&trampoline, isolate_);
1639 isolate_); 1641 } else {
1642 StubFunctionMode function_mode = descriptor->function_mode_;
1643 StubFailureTrampolineStub(function_mode).FindCodeInCache(&trampoline,
1644 isolate_);
1645 }
1640 ASSERT(trampoline != NULL); 1646 ASSERT(trampoline != NULL);
1641 output_frame->SetPc(reinterpret_cast<intptr_t>( 1647 output_frame->SetPc(reinterpret_cast<intptr_t>(
1642 trampoline->instruction_start())); 1648 trampoline->instruction_start()));
1643 output_frame->SetState(Smi::FromInt(FullCodeGenerator::NO_REGISTERS)); 1649 output_frame->SetState(Smi::FromInt(FullCodeGenerator::NO_REGISTERS));
1644 Code* notify_failure = 1650 Code* notify_failure =
1645 isolate_->builtins()->builtin(Builtins::kNotifyStubFailure); 1651 isolate_->builtins()->builtin(Builtins::kNotifyStubFailure);
1646 output_frame->SetContinuation( 1652 output_frame->SetContinuation(
1647 reinterpret_cast<intptr_t>(notify_failure->entry())); 1653 reinterpret_cast<intptr_t>(notify_failure->entry()));
1648 } 1654 }
1649 1655
(...skipping 1396 matching lines...) Expand 10 before | Expand all | Expand 10 after
3046 3052
3047 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) { 3053 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) {
3048 v->VisitPointer(BitCast<Object**>(&function_)); 3054 v->VisitPointer(BitCast<Object**>(&function_));
3049 v->VisitPointers(parameters_, parameters_ + parameters_count_); 3055 v->VisitPointers(parameters_, parameters_ + parameters_count_);
3050 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_); 3056 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_);
3051 } 3057 }
3052 3058
3053 #endif // ENABLE_DEBUGGER_SUPPORT 3059 #endif // ENABLE_DEBUGGER_SUPPORT
3054 3060
3055 } } // namespace v8::internal 3061 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/compiler.cc ('k') | src/frames.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698