Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(336)

Side by Side Diff: src/hydrogen.cc

Issue 9597017: Fix inlining of strict mode constructors. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | test/mjsunit/compiler/inline-construct.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 7675 matching lines...) Expand 10 before | Expand all | Expand 10 after
7686 // Get the argument values from the original environment. 7686 // Get the argument values from the original environment.
7687 for (int i = 0; i <= arity; ++i) { // Include receiver. 7687 for (int i = 0; i <= arity; ++i) { // Include receiver.
7688 HValue* push = (i <= arguments) ? 7688 HValue* push = (i <= arguments) ?
7689 ExpressionStackAt(arguments - i) : undefined; 7689 ExpressionStackAt(arguments - i) : undefined;
7690 inner->SetValueAt(i, push); 7690 inner->SetValueAt(i, push);
7691 } 7691 }
7692 // If the function we are inlining is a strict mode function or a 7692 // If the function we are inlining is a strict mode function or a
7693 // builtin function, pass undefined as the receiver for function 7693 // builtin function, pass undefined as the receiver for function
7694 // calls (instead of the global receiver). 7694 // calls (instead of the global receiver).
7695 if ((target->shared()->native() || !function->is_classic_mode()) && 7695 if ((target->shared()->native() || !function->is_classic_mode()) &&
7696 call_kind == CALL_AS_FUNCTION) { 7696 call_kind == CALL_AS_FUNCTION && !is_construct) {
7697 inner->SetValueAt(0, undefined); 7697 inner->SetValueAt(0, undefined);
7698 } 7698 }
7699 inner->SetValueAt(arity + 1, LookupContext()); 7699 inner->SetValueAt(arity + 1, LookupContext());
7700 for (int i = arity + 2; i < inner->length(); ++i) { 7700 for (int i = arity + 2; i < inner->length(); ++i) {
7701 inner->SetValueAt(i, undefined); 7701 inner->SetValueAt(i, undefined);
7702 } 7702 }
7703 7703
7704 inner->set_ast_id(AstNode::kFunctionEntryId); 7704 inner->set_ast_id(AstNode::kFunctionEntryId);
7705 return inner; 7705 return inner;
7706 } 7706 }
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
8047 } 8047 }
8048 } 8048 }
8049 8049
8050 #ifdef DEBUG 8050 #ifdef DEBUG
8051 if (graph_ != NULL) graph_->Verify(false); // No full verify. 8051 if (graph_ != NULL) graph_->Verify(false); // No full verify.
8052 if (allocator_ != NULL) allocator_->Verify(); 8052 if (allocator_ != NULL) allocator_->Verify();
8053 #endif 8053 #endif
8054 } 8054 }
8055 8055
8056 } } // namespace v8::internal 8056 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/compiler/inline-construct.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698