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 1177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1188 // and spilled to stack | .... | | 1188 // and spilled to stack | .... | |
1189 // +-------------------------+ | 1189 // +-------------------------+ |
1190 // | caller stack param n | | 1190 // | caller stack param n | |
1191 // +-------------------------+<-spreg | 1191 // +-------------------------+<-spreg |
1192 // reg = number of parameters | 1192 // reg = number of parameters |
1193 // reg = failure handler address | 1193 // reg = failure handler address |
1194 // reg = saved frame | 1194 // reg = saved frame |
1195 // reg = JSFunction context | 1195 // reg = JSFunction context |
1196 // | 1196 // |
1197 | 1197 |
1198 ASSERT(compiled_code_->kind() == Code::COMPILED_STUB); | 1198 ASSERT(compiled_code_->is_crankshafted() && |
| 1199 compiled_code_->kind() != Code::OPTIMIZED_FUNCTION); |
1199 int major_key = compiled_code_->major_key(); | 1200 int major_key = compiled_code_->major_key(); |
1200 CodeStubInterfaceDescriptor* descriptor = | 1201 CodeStubInterfaceDescriptor* descriptor = |
1201 isolate_->code_stub_interface_descriptor(major_key); | 1202 isolate_->code_stub_interface_descriptor(major_key); |
1202 | 1203 |
1203 // The output frame must have room for all pushed register parameters | 1204 // The output frame must have room for all pushed register parameters |
1204 // and the standard stack frame slots. Include space for an argument | 1205 // and the standard stack frame slots. Include space for an argument |
1205 // object to the callee and optionally the space to pass the argument | 1206 // object to the callee and optionally the space to pass the argument |
1206 // object to the stub failure handler. | 1207 // object to the stub failure handler. |
1207 ASSERT(descriptor->register_param_count_ >= 0); | 1208 ASSERT(descriptor->register_param_count_ >= 0); |
1208 int height_in_bytes = kPointerSize * descriptor->register_param_count_ + | 1209 int height_in_bytes = kPointerSize * descriptor->register_param_count_ + |
(...skipping 917 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2126 unsigned fixed_size = ComputeFixedSize(function_); | 2127 unsigned fixed_size = ComputeFixedSize(function_); |
2127 // The fp-to-sp delta already takes the context and the function | 2128 // The fp-to-sp delta already takes the context and the function |
2128 // into account so we have to avoid double counting them (-2). | 2129 // into account so we have to avoid double counting them (-2). |
2129 unsigned result = fixed_size + fp_to_sp_delta_ - (2 * kPointerSize); | 2130 unsigned result = fixed_size + fp_to_sp_delta_ - (2 * kPointerSize); |
2130 #ifdef DEBUG | 2131 #ifdef DEBUG |
2131 if (bailout_type_ == OSR) { | 2132 if (bailout_type_ == OSR) { |
2132 // TODO(kasperl): It would be nice if we could verify that the | 2133 // TODO(kasperl): It would be nice if we could verify that the |
2133 // size matches with the stack height we can compute based on the | 2134 // size matches with the stack height we can compute based on the |
2134 // environment at the OSR entry. The code for that his built into | 2135 // environment at the OSR entry. The code for that his built into |
2135 // the DoComputeOsrOutputFrame function for now. | 2136 // the DoComputeOsrOutputFrame function for now. |
2136 } else if (compiled_code_->kind() != Code::COMPILED_STUB) { | 2137 } else if (compiled_code_->kind() == Code::OPTIMIZED_FUNCTION) { |
2137 unsigned stack_slots = compiled_code_->stack_slots(); | 2138 unsigned stack_slots = compiled_code_->stack_slots(); |
2138 unsigned outgoing_size = ComputeOutgoingArgumentSize(); | 2139 unsigned outgoing_size = ComputeOutgoingArgumentSize(); |
2139 ASSERT(result == fixed_size + (stack_slots * kPointerSize) + outgoing_size); | 2140 ASSERT(result == fixed_size + (stack_slots * kPointerSize) + outgoing_size); |
2140 } | 2141 } |
2141 #endif | 2142 #endif |
2142 return result; | 2143 return result; |
2143 } | 2144 } |
2144 | 2145 |
2145 | 2146 |
2146 unsigned Deoptimizer::ComputeFixedSize(JSFunction* function) const { | 2147 unsigned Deoptimizer::ComputeFixedSize(JSFunction* function) const { |
(...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2772 | 2773 |
2773 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) { | 2774 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) { |
2774 v->VisitPointer(BitCast<Object**>(&function_)); | 2775 v->VisitPointer(BitCast<Object**>(&function_)); |
2775 v->VisitPointers(parameters_, parameters_ + parameters_count_); | 2776 v->VisitPointers(parameters_, parameters_ + parameters_count_); |
2776 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_); | 2777 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_); |
2777 } | 2778 } |
2778 | 2779 |
2779 #endif // ENABLE_DEBUGGER_SUPPORT | 2780 #endif // ENABLE_DEBUGGER_SUPPORT |
2780 | 2781 |
2781 } } // namespace v8::internal | 2782 } } // namespace v8::internal |
OLD | NEW |