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

Side by Side Diff: src/deoptimizer.cc

Issue 23537067: Add support for keyed-call on arrays of fast elements (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments Created 7 years, 2 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 // 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 1406 matching lines...) Expand 10 before | Expand all | Expand 10 after
1417 // and the standard stack frame slots. Include space for an argument 1417 // and the standard stack frame slots. Include space for an argument
1418 // object to the callee and optionally the space to pass the argument 1418 // object to the callee and optionally the space to pass the argument
1419 // object to the stub failure handler. 1419 // object to the stub failure handler.
1420 ASSERT(descriptor->register_param_count_ >= 0); 1420 ASSERT(descriptor->register_param_count_ >= 0);
1421 int height_in_bytes = kPointerSize * descriptor->register_param_count_ + 1421 int height_in_bytes = kPointerSize * descriptor->register_param_count_ +
1422 sizeof(Arguments) + kPointerSize; 1422 sizeof(Arguments) + kPointerSize;
1423 int fixed_frame_size = StandardFrameConstants::kFixedFrameSize; 1423 int fixed_frame_size = StandardFrameConstants::kFixedFrameSize;
1424 int input_frame_size = input_->GetFrameSize(); 1424 int input_frame_size = input_->GetFrameSize();
1425 int output_frame_size = height_in_bytes + fixed_frame_size; 1425 int output_frame_size = height_in_bytes + fixed_frame_size;
1426 if (trace_) { 1426 if (trace_) {
1427 PrintF(" translating %s => StubFailureTrampolineStub, height=%d\n", 1427 PrintF(" translating %s => StubFailure%sTrampolineStub, height=%d\n",
1428 CodeStub::MajorName(static_cast<CodeStub::Major>(major_key), false), 1428 CodeStub::MajorName(
1429 static_cast<CodeStub::Major>(major_key), false),
1430 descriptor->HasTailCallContinuation() ? "TailCall" : "",
1429 height_in_bytes); 1431 height_in_bytes);
1430 } 1432 }
1431 1433
1432 // The stub failure trampoline is a single frame. 1434 // The stub failure trampoline is a single frame.
1433 FrameDescription* output_frame = 1435 FrameDescription* output_frame =
1434 new(output_frame_size) FrameDescription(output_frame_size, NULL); 1436 new(output_frame_size) FrameDescription(output_frame_size, NULL);
1435 output_frame->SetFrameType(StackFrame::STUB_FAILURE_TRAMPOLINE); 1437 output_frame->SetFrameType(StackFrame::STUB_FAILURE_TRAMPOLINE);
1436 ASSERT(frame_index == 0); 1438 ASSERT(frame_index == 0);
1437 output_[frame_index] = output_frame; 1439 output_[frame_index] = output_frame;
1438 1440
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
1486 output_frame_offset -= kPointerSize; 1488 output_frame_offset -= kPointerSize;
1487 value = reinterpret_cast<intptr_t>( 1489 value = reinterpret_cast<intptr_t>(
1488 Smi::FromInt(StackFrame::STUB_FAILURE_TRAMPOLINE)); 1490 Smi::FromInt(StackFrame::STUB_FAILURE_TRAMPOLINE));
1489 output_frame->SetFrameSlot(output_frame_offset, value); 1491 output_frame->SetFrameSlot(output_frame_offset, value);
1490 if (trace_) { 1492 if (trace_) {
1491 PrintF(" 0x%08" V8PRIxPTR ": [top + %d] <- 0x%08" 1493 PrintF(" 0x%08" V8PRIxPTR ": [top + %d] <- 0x%08"
1492 V8PRIxPTR " ; function (stub failure sentinel)\n", 1494 V8PRIxPTR " ; function (stub failure sentinel)\n",
1493 top_address + output_frame_offset, output_frame_offset, value); 1495 top_address + output_frame_offset, output_frame_offset, value);
1494 } 1496 }
1495 1497
1496 intptr_t caller_arg_count = 0; 1498 intptr_t caller_arg_count = descriptor->HasTailCallContinuation()
1499 ? compiled_code_->arguments_count() + 1 : 0;
1497 bool arg_count_known = descriptor->stack_parameter_count_ == NULL; 1500 bool arg_count_known = descriptor->stack_parameter_count_ == NULL;
1498 1501
1499 // Build the Arguments object for the caller's parameters and a pointer to it. 1502 // Build the Arguments object for the caller's parameters and a pointer to it.
1500 output_frame_offset -= kPointerSize; 1503 output_frame_offset -= kPointerSize;
1501 int args_arguments_offset = output_frame_offset; 1504 int args_arguments_offset = output_frame_offset;
1502 intptr_t the_hole = reinterpret_cast<intptr_t>( 1505 intptr_t the_hole = reinterpret_cast<intptr_t>(
1503 isolate_->heap()->the_hole_value()); 1506 isolate_->heap()->the_hole_value());
1504 if (arg_count_known) { 1507 if (arg_count_known) {
1505 value = frame_ptr + StandardFrameConstants::kCallerSPOffset + 1508 value = frame_ptr + StandardFrameConstants::kCallerSPOffset +
1506 (caller_arg_count - 1) * kPointerSize; 1509 (caller_arg_count - 1) * kPointerSize;
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
1560 ASSERT(0 == output_frame_offset); 1563 ASSERT(0 == output_frame_offset);
1561 1564
1562 // Copy the double registers from the input into the output frame. 1565 // Copy the double registers from the input into the output frame.
1563 CopyDoubleRegisters(output_frame); 1566 CopyDoubleRegisters(output_frame);
1564 1567
1565 // Fill registers containing handler and number of parameters. 1568 // Fill registers containing handler and number of parameters.
1566 SetPlatformCompiledStubRegisters(output_frame, descriptor); 1569 SetPlatformCompiledStubRegisters(output_frame, descriptor);
1567 1570
1568 // Compute this frame's PC, state, and continuation. 1571 // Compute this frame's PC, state, and continuation.
1569 Code* trampoline = NULL; 1572 Code* trampoline = NULL;
1570 StubFunctionMode function_mode = descriptor->function_mode_; 1573 if (descriptor->HasTailCallContinuation()) {
1571 StubFailureTrampolineStub(function_mode).FindCodeInCache(&trampoline, 1574 StubFailureTailCallTrampolineStub().FindCodeInCache(&trampoline, isolate_);
1572 isolate_); 1575 } else {
1576 StubFunctionMode function_mode = descriptor->function_mode_;
1577 StubFailureTrampolineStub(function_mode).FindCodeInCache(&trampoline,
1578 isolate_);
1579 }
1573 ASSERT(trampoline != NULL); 1580 ASSERT(trampoline != NULL);
1574 output_frame->SetPc(reinterpret_cast<intptr_t>( 1581 output_frame->SetPc(reinterpret_cast<intptr_t>(
1575 trampoline->instruction_start())); 1582 trampoline->instruction_start()));
1576 output_frame->SetState(Smi::FromInt(FullCodeGenerator::NO_REGISTERS)); 1583 output_frame->SetState(Smi::FromInt(FullCodeGenerator::NO_REGISTERS));
1577 Code* notify_failure = 1584 Code* notify_failure =
1578 isolate_->builtins()->builtin(Builtins::kNotifyStubFailure); 1585 isolate_->builtins()->builtin(Builtins::kNotifyStubFailure);
1579 output_frame->SetContinuation( 1586 output_frame->SetContinuation(
1580 reinterpret_cast<intptr_t>(notify_failure->entry())); 1587 reinterpret_cast<intptr_t>(notify_failure->entry()));
1581 } 1588 }
1582 1589
(...skipping 1390 matching lines...) Expand 10 before | Expand all | Expand 10 after
2973 2980
2974 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) { 2981 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) {
2975 v->VisitPointer(BitCast<Object**>(&function_)); 2982 v->VisitPointer(BitCast<Object**>(&function_));
2976 v->VisitPointers(parameters_, parameters_ + parameters_count_); 2983 v->VisitPointers(parameters_, parameters_ + parameters_count_);
2977 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_); 2984 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_);
2978 } 2985 }
2979 2986
2980 #endif // ENABLE_DEBUGGER_SUPPORT 2987 #endif // ENABLE_DEBUGGER_SUPPORT
2981 2988
2982 } } // namespace v8::internal 2989 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/compiler.cc ('k') | src/frames.cc » ('j') | src/ia32/lithium-ia32.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698