OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
533 function = NULL; | 533 function = NULL; |
534 } | 534 } |
535 if (function != NULL && function->IsOptimized()) { | 535 if (function != NULL && function->IsOptimized()) { |
536 function->shared()->increment_deopt_count(); | 536 function->shared()->increment_deopt_count(); |
537 } | 537 } |
538 compiled_code_ = FindOptimizedCode(function, optimized_code); | 538 compiled_code_ = FindOptimizedCode(function, optimized_code); |
539 if (TraceEnabledFor(type)) Trace(); | 539 if (TraceEnabledFor(type)) Trace(); |
540 ASSERT(HEAP->allow_allocation(false)); | 540 ASSERT(HEAP->allow_allocation(false)); |
541 unsigned size = ComputeInputFrameSize(); | 541 unsigned size = ComputeInputFrameSize(); |
542 input_ = new(size) FrameDescription(size, function); | 542 input_ = new(size) FrameDescription(size, function); |
543 input_->SetFrameType(StackFrame::JAVA_SCRIPT); | 543 StackFrame::Type frame_type = function == NULL |
| 544 ? StackFrame::STUB |
| 545 : StackFrame::JAVA_SCRIPT; |
| 546 input_->SetFrameType(frame_type); |
544 } | 547 } |
545 | 548 |
546 | 549 |
547 Code* Deoptimizer::FindOptimizedCode(JSFunction* function, | 550 Code* Deoptimizer::FindOptimizedCode(JSFunction* function, |
548 Code* optimized_code) { | 551 Code* optimized_code) { |
549 switch (bailout_type_) { | 552 switch (bailout_type_) { |
550 case Deoptimizer::EAGER: | 553 case Deoptimizer::EAGER: |
551 ASSERT(from_ == NULL); | 554 ASSERT(from_ == NULL); |
552 return function->code(); | 555 return function->code(); |
553 case Deoptimizer::LAZY: { | 556 case Deoptimizer::LAZY: { |
(...skipping 1090 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1644 | 1647 |
1645 int FrameDescription::ComputeParametersCount() { | 1648 int FrameDescription::ComputeParametersCount() { |
1646 switch (type_) { | 1649 switch (type_) { |
1647 case StackFrame::JAVA_SCRIPT: | 1650 case StackFrame::JAVA_SCRIPT: |
1648 return function_->shared()->formal_parameter_count(); | 1651 return function_->shared()->formal_parameter_count(); |
1649 case StackFrame::ARGUMENTS_ADAPTOR: { | 1652 case StackFrame::ARGUMENTS_ADAPTOR: { |
1650 // Last slot contains number of incomming arguments as a smi. | 1653 // Last slot contains number of incomming arguments as a smi. |
1651 // Can't use GetExpression(0) because it would cause infinite recursion. | 1654 // Can't use GetExpression(0) because it would cause infinite recursion. |
1652 return reinterpret_cast<Smi*>(*GetFrameSlotPointer(0))->value(); | 1655 return reinterpret_cast<Smi*>(*GetFrameSlotPointer(0))->value(); |
1653 } | 1656 } |
| 1657 case StackFrame::STUB: |
| 1658 return 0; |
1654 default: | 1659 default: |
1655 UNREACHABLE(); | 1660 UNREACHABLE(); |
1656 return 0; | 1661 return 0; |
1657 } | 1662 } |
1658 } | 1663 } |
1659 | 1664 |
1660 | 1665 |
1661 Object* FrameDescription::GetParameter(int index) { | 1666 Object* FrameDescription::GetParameter(int index) { |
1662 ASSERT(index >= 0); | 1667 ASSERT(index >= 0); |
1663 ASSERT(index < ComputeParametersCount()); | 1668 ASSERT(index < ComputeParametersCount()); |
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2111 | 2116 |
2112 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) { | 2117 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) { |
2113 v->VisitPointer(BitCast<Object**>(&function_)); | 2118 v->VisitPointer(BitCast<Object**>(&function_)); |
2114 v->VisitPointers(parameters_, parameters_ + parameters_count_); | 2119 v->VisitPointers(parameters_, parameters_ + parameters_count_); |
2115 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_); | 2120 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_); |
2116 } | 2121 } |
2117 | 2122 |
2118 #endif // ENABLE_DEBUGGER_SUPPORT | 2123 #endif // ENABLE_DEBUGGER_SUPPORT |
2119 | 2124 |
2120 } } // namespace v8::internal | 2125 } } // namespace v8::internal |
OLD | NEW |