| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 5941 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5952 HValue* push = ExpressionStackAt(arity - i); | 5952 HValue* push = ExpressionStackAt(arity - i); |
| 5953 inner->SetValueAt(i, push); | 5953 inner->SetValueAt(i, push); |
| 5954 } | 5954 } |
| 5955 } else { | 5955 } else { |
| 5956 ASSERT(compilation_phase == LITHIUM); | 5956 ASSERT(compilation_phase == LITHIUM); |
| 5957 for (int i = 0; i <= arity; ++i) { // Include receiver. | 5957 for (int i = 0; i <= arity; ++i) { // Include receiver. |
| 5958 HValue* push = ExpressionStackAt(arity - i); | 5958 HValue* push = ExpressionStackAt(arity - i); |
| 5959 inner->SetValueAt(i, push); | 5959 inner->SetValueAt(i, push); |
| 5960 } | 5960 } |
| 5961 } | 5961 } |
| 5962 // If the function we are inlining is a strict mode function, pass | 5962 // If the function we are inlining is a strict mode function or a |
| 5963 // undefined as the receiver for function calls (instead of the | 5963 // builtin function, pass undefined as the receiver for function |
| 5964 // global receiver). | 5964 // calls (instead of the global receiver). |
| 5965 if (function->strict_mode() && call_kind == CALL_AS_FUNCTION) { | 5965 if ((target->shared()->native() || function->strict_mode()) && |
| 5966 call_kind == CALL_AS_FUNCTION) { |
| 5966 inner->SetValueAt(0, undefined); | 5967 inner->SetValueAt(0, undefined); |
| 5967 } | 5968 } |
| 5968 inner->SetValueAt(arity + 1, outer->LookupContext()); | 5969 inner->SetValueAt(arity + 1, outer->LookupContext()); |
| 5969 for (int i = arity + 2; i < inner->length(); ++i) { | 5970 for (int i = arity + 2; i < inner->length(); ++i) { |
| 5970 inner->SetValueAt(i, undefined); | 5971 inner->SetValueAt(i, undefined); |
| 5971 } | 5972 } |
| 5972 | 5973 |
| 5973 inner->set_ast_id(AstNode::kFunctionEntryId); | 5974 inner->set_ast_id(AstNode::kFunctionEntryId); |
| 5974 return inner; | 5975 return inner; |
| 5975 } | 5976 } |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6305 } | 6306 } |
| 6306 } | 6307 } |
| 6307 | 6308 |
| 6308 #ifdef DEBUG | 6309 #ifdef DEBUG |
| 6309 if (graph_ != NULL) graph_->Verify(); | 6310 if (graph_ != NULL) graph_->Verify(); |
| 6310 if (allocator_ != NULL) allocator_->Verify(); | 6311 if (allocator_ != NULL) allocator_->Verify(); |
| 6311 #endif | 6312 #endif |
| 6312 } | 6313 } |
| 6313 | 6314 |
| 6314 } } // namespace v8::internal | 6315 } } // namespace v8::internal |
| OLD | NEW |