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 6730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6741 HEnvironment* inner = | 6741 HEnvironment* inner = |
6742 new(zone) HEnvironment(outer, function->scope(), target); | 6742 new(zone) HEnvironment(outer, function->scope(), target); |
6743 // Get the argument values from the original environment. | 6743 // Get the argument values from the original environment. |
6744 for (int i = 0; i <= arity; ++i) { // Include receiver. | 6744 for (int i = 0; i <= arity; ++i) { // Include receiver. |
6745 HValue* push = ExpressionStackAt(arity - i); | 6745 HValue* push = ExpressionStackAt(arity - i); |
6746 inner->SetValueAt(i, push); | 6746 inner->SetValueAt(i, push); |
6747 } | 6747 } |
6748 // If the function we are inlining is a strict mode function or a | 6748 // If the function we are inlining is a strict mode function or a |
6749 // builtin function, pass undefined as the receiver for function | 6749 // builtin function, pass undefined as the receiver for function |
6750 // calls (instead of the global receiver). | 6750 // calls (instead of the global receiver). |
6751 if ((target->shared()->native() || function->strict_mode()) && | 6751 if ((target->shared()->native() || !function->is_classic_mode()) && |
6752 call_kind == CALL_AS_FUNCTION) { | 6752 call_kind == CALL_AS_FUNCTION) { |
6753 inner->SetValueAt(0, undefined); | 6753 inner->SetValueAt(0, undefined); |
6754 } | 6754 } |
6755 inner->SetValueAt(arity + 1, outer->LookupContext()); | 6755 inner->SetValueAt(arity + 1, outer->LookupContext()); |
6756 for (int i = arity + 2; i < inner->length(); ++i) { | 6756 for (int i = arity + 2; i < inner->length(); ++i) { |
6757 inner->SetValueAt(i, undefined); | 6757 inner->SetValueAt(i, undefined); |
6758 } | 6758 } |
6759 | 6759 |
6760 inner->set_ast_id(AstNode::kFunctionEntryId); | 6760 inner->set_ast_id(AstNode::kFunctionEntryId); |
6761 return inner; | 6761 return inner; |
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7094 } | 7094 } |
7095 } | 7095 } |
7096 | 7096 |
7097 #ifdef DEBUG | 7097 #ifdef DEBUG |
7098 if (graph_ != NULL) graph_->Verify(false); // No full verify. | 7098 if (graph_ != NULL) graph_->Verify(false); // No full verify. |
7099 if (allocator_ != NULL) allocator_->Verify(); | 7099 if (allocator_ != NULL) allocator_->Verify(); |
7100 #endif | 7100 #endif |
7101 } | 7101 } |
7102 | 7102 |
7103 } } // namespace v8::internal | 7103 } } // namespace v8::internal |
OLD | NEW |