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 5866 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5877 HValue* push = ExpressionStackAt(arity - i); | 5877 HValue* push = ExpressionStackAt(arity - i); |
5878 inner->SetValueAt(i, push); | 5878 inner->SetValueAt(i, push); |
5879 } | 5879 } |
5880 } else { | 5880 } else { |
5881 ASSERT(compilation_phase == LITHIUM); | 5881 ASSERT(compilation_phase == LITHIUM); |
5882 for (int i = 0; i <= arity; ++i) { // Include receiver. | 5882 for (int i = 0; i <= arity; ++i) { // Include receiver. |
5883 HValue* push = ExpressionStackAt(arity - i); | 5883 HValue* push = ExpressionStackAt(arity - i); |
5884 inner->SetValueAt(i, push); | 5884 inner->SetValueAt(i, push); |
5885 } | 5885 } |
5886 } | 5886 } |
5887 // If the function we are inlining is a strict mode function, pass | 5887 // If the function we are inlining is a strict mode function or a |
5888 // undefined as the receiver for function calls (instead of the | 5888 // builtin function, pass undefined as the receiver for function |
5889 // global receiver). | 5889 // calls (instead of the global receiver). |
5890 if (function->strict_mode() && call_kind == CALL_AS_FUNCTION) { | 5890 if ((target->shared()->native() || function->strict_mode()) && |
| 5891 call_kind == CALL_AS_FUNCTION) { |
5891 inner->SetValueAt(0, undefined); | 5892 inner->SetValueAt(0, undefined); |
5892 } | 5893 } |
5893 inner->SetValueAt(arity + 1, outer->LookupContext()); | 5894 inner->SetValueAt(arity + 1, outer->LookupContext()); |
5894 for (int i = arity + 2; i < inner->length(); ++i) { | 5895 for (int i = arity + 2; i < inner->length(); ++i) { |
5895 inner->SetValueAt(i, undefined); | 5896 inner->SetValueAt(i, undefined); |
5896 } | 5897 } |
5897 | 5898 |
5898 inner->set_ast_id(AstNode::kFunctionEntryId); | 5899 inner->set_ast_id(AstNode::kFunctionEntryId); |
5899 return inner; | 5900 return inner; |
5900 } | 5901 } |
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6230 } | 6231 } |
6231 } | 6232 } |
6232 | 6233 |
6233 #ifdef DEBUG | 6234 #ifdef DEBUG |
6234 if (graph_ != NULL) graph_->Verify(); | 6235 if (graph_ != NULL) graph_->Verify(); |
6235 if (allocator_ != NULL) allocator_->Verify(); | 6236 if (allocator_ != NULL) allocator_->Verify(); |
6236 #endif | 6237 #endif |
6237 } | 6238 } |
6238 | 6239 |
6239 } } // namespace v8::internal | 6240 } } // namespace v8::internal |
OLD | NEW |