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 1406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 if (descriptor->call_stub_) { |
1428 CodeStub::MajorName(static_cast<CodeStub::Major>(major_key), false), | 1428 PrintF(" translating %s => CallStubFailureTrampolineStub, height=%d\n", |
danno
2013/10/02 08:49:11
You can use a single statement and just switch the
Toon Verwaest
2013/10/02 16:28:16
Done.
| |
1429 height_in_bytes); | 1429 CodeStub::MajorName( |
1430 static_cast<CodeStub::Major>(major_key), false), | |
1431 height_in_bytes); | |
1432 } else { | |
1433 PrintF(" translating %s => StubFailureTrampolineStub, height=%d\n", | |
1434 CodeStub::MajorName( | |
1435 static_cast<CodeStub::Major>(major_key), false), | |
1436 height_in_bytes); | |
1437 } | |
1430 } | 1438 } |
1431 | 1439 |
1432 // The stub failure trampoline is a single frame. | 1440 // The stub failure trampoline is a single frame. |
1433 FrameDescription* output_frame = | 1441 FrameDescription* output_frame = |
1434 new(output_frame_size) FrameDescription(output_frame_size, NULL); | 1442 new(output_frame_size) FrameDescription(output_frame_size, NULL); |
1435 output_frame->SetFrameType(StackFrame::STUB_FAILURE_TRAMPOLINE); | 1443 output_frame->SetFrameType(StackFrame::STUB_FAILURE_TRAMPOLINE); |
1436 ASSERT(frame_index == 0); | 1444 ASSERT(frame_index == 0); |
1437 output_[frame_index] = output_frame; | 1445 output_[frame_index] = output_frame; |
1438 | 1446 |
1439 // The top address for the output frame can be computed from the input | 1447 // The top address for the output frame can be computed from the input |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1486 output_frame_offset -= kPointerSize; | 1494 output_frame_offset -= kPointerSize; |
1487 value = reinterpret_cast<intptr_t>( | 1495 value = reinterpret_cast<intptr_t>( |
1488 Smi::FromInt(StackFrame::STUB_FAILURE_TRAMPOLINE)); | 1496 Smi::FromInt(StackFrame::STUB_FAILURE_TRAMPOLINE)); |
1489 output_frame->SetFrameSlot(output_frame_offset, value); | 1497 output_frame->SetFrameSlot(output_frame_offset, value); |
1490 if (trace_) { | 1498 if (trace_) { |
1491 PrintF(" 0x%08" V8PRIxPTR ": [top + %d] <- 0x%08" | 1499 PrintF(" 0x%08" V8PRIxPTR ": [top + %d] <- 0x%08" |
1492 V8PRIxPTR " ; function (stub failure sentinel)\n", | 1500 V8PRIxPTR " ; function (stub failure sentinel)\n", |
1493 top_address + output_frame_offset, output_frame_offset, value); | 1501 top_address + output_frame_offset, output_frame_offset, value); |
1494 } | 1502 } |
1495 | 1503 |
1496 intptr_t caller_arg_count = 0; | 1504 intptr_t caller_arg_count = descriptor->call_stub_ |
1505 ? compiled_code_->arguments_count() : 0; | |
1497 bool arg_count_known = descriptor->stack_parameter_count_ == NULL; | 1506 bool arg_count_known = descriptor->stack_parameter_count_ == NULL; |
1498 | 1507 |
1499 // Build the Arguments object for the caller's parameters and a pointer to it. | 1508 // Build the Arguments object for the caller's parameters and a pointer to it. |
1500 output_frame_offset -= kPointerSize; | 1509 output_frame_offset -= kPointerSize; |
1501 int args_arguments_offset = output_frame_offset; | 1510 int args_arguments_offset = output_frame_offset; |
1502 intptr_t the_hole = reinterpret_cast<intptr_t>( | 1511 intptr_t the_hole = reinterpret_cast<intptr_t>( |
1503 isolate_->heap()->the_hole_value()); | 1512 isolate_->heap()->the_hole_value()); |
1504 if (arg_count_known) { | 1513 if (arg_count_known) { |
1505 value = frame_ptr + StandardFrameConstants::kCallerSPOffset + | 1514 value = frame_ptr + StandardFrameConstants::kCallerSPOffset + |
1506 (caller_arg_count - 1) * kPointerSize; | 1515 (caller_arg_count - 1) * kPointerSize; |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1560 ASSERT(0 == output_frame_offset); | 1569 ASSERT(0 == output_frame_offset); |
1561 | 1570 |
1562 // Copy the double registers from the input into the output frame. | 1571 // Copy the double registers from the input into the output frame. |
1563 CopyDoubleRegisters(output_frame); | 1572 CopyDoubleRegisters(output_frame); |
1564 | 1573 |
1565 // Fill registers containing handler and number of parameters. | 1574 // Fill registers containing handler and number of parameters. |
1566 SetPlatformCompiledStubRegisters(output_frame, descriptor); | 1575 SetPlatformCompiledStubRegisters(output_frame, descriptor); |
1567 | 1576 |
1568 // Compute this frame's PC, state, and continuation. | 1577 // Compute this frame's PC, state, and continuation. |
1569 Code* trampoline = NULL; | 1578 Code* trampoline = NULL; |
1570 StubFunctionMode function_mode = descriptor->function_mode_; | 1579 if (descriptor->call_stub_) { |
1571 StubFailureTrampolineStub(function_mode).FindCodeInCache(&trampoline, | 1580 CallStubFailureTrampolineStub().FindCodeInCache(&trampoline, isolate_); |
danno
2013/10/02 08:49:11
Is this only going to every be used with CallStubs
Toon Verwaest
2013/10/02 16:28:16
Done.
| |
1572 isolate_); | 1581 } else { |
1582 StubFunctionMode function_mode = descriptor->function_mode_; | |
1583 StubFailureTrampolineStub(function_mode).FindCodeInCache(&trampoline, | |
1584 isolate_); | |
1585 } | |
1573 ASSERT(trampoline != NULL); | 1586 ASSERT(trampoline != NULL); |
1574 output_frame->SetPc(reinterpret_cast<intptr_t>( | 1587 output_frame->SetPc(reinterpret_cast<intptr_t>( |
1575 trampoline->instruction_start())); | 1588 trampoline->instruction_start())); |
1576 output_frame->SetState(Smi::FromInt(FullCodeGenerator::NO_REGISTERS)); | 1589 output_frame->SetState(Smi::FromInt(FullCodeGenerator::NO_REGISTERS)); |
1577 Code* notify_failure = | 1590 Code* notify_failure = |
1578 isolate_->builtins()->builtin(Builtins::kNotifyStubFailure); | 1591 isolate_->builtins()->builtin(Builtins::kNotifyStubFailure); |
1579 output_frame->SetContinuation( | 1592 output_frame->SetContinuation( |
1580 reinterpret_cast<intptr_t>(notify_failure->entry())); | 1593 reinterpret_cast<intptr_t>(notify_failure->entry())); |
1581 } | 1594 } |
1582 | 1595 |
(...skipping 1390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2973 | 2986 |
2974 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) { | 2987 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) { |
2975 v->VisitPointer(BitCast<Object**>(&function_)); | 2988 v->VisitPointer(BitCast<Object**>(&function_)); |
2976 v->VisitPointers(parameters_, parameters_ + parameters_count_); | 2989 v->VisitPointers(parameters_, parameters_ + parameters_count_); |
2977 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_); | 2990 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_); |
2978 } | 2991 } |
2979 | 2992 |
2980 #endif // ENABLE_DEBUGGER_SUPPORT | 2993 #endif // ENABLE_DEBUGGER_SUPPORT |
2981 | 2994 |
2982 } } // namespace v8::internal | 2995 } } // namespace v8::internal |
OLD | NEW |