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

Side by Side Diff: src/hydrogen.cc

Issue 7085034: Reapply change to Pass undefined to JS builtins when called with (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 6 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 | « src/heap.cc ('k') | src/ia32/builtins-ia32.cc » ('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 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
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
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
OLDNEW
« no previous file with comments | « src/heap.cc ('k') | src/ia32/builtins-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698