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

Side by Side Diff: src/hydrogen.cc

Issue 7071009: Revert "Pass undefined to JS builtins when called with implicit receiver." (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 7 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 5888 matching lines...) Expand 10 before | Expand all | Expand 10 after
5899 HValue* push = ExpressionStackAt(arity - i); 5899 HValue* push = ExpressionStackAt(arity - i);
5900 inner->SetValueAt(i, push); 5900 inner->SetValueAt(i, push);
5901 } 5901 }
5902 } else { 5902 } else {
5903 ASSERT(compilation_phase == LITHIUM); 5903 ASSERT(compilation_phase == LITHIUM);
5904 for (int i = 0; i <= arity; ++i) { // Include receiver. 5904 for (int i = 0; i <= arity; ++i) { // Include receiver.
5905 HValue* push = ExpressionStackAt(arity - i); 5905 HValue* push = ExpressionStackAt(arity - i);
5906 inner->SetValueAt(i, push); 5906 inner->SetValueAt(i, push);
5907 } 5907 }
5908 } 5908 }
5909 // If the function we are inlining is a strict mode function or a 5909 // If the function we are inlining is a strict mode function, pass
5910 // builtin function, pass undefined as the receiver for function 5910 // undefined as the receiver for function calls (instead of the
5911 // calls (instead of the global receiver). 5911 // global receiver).
5912 if ((target->shared()->native() || function->strict_mode()) && 5912 if (function->strict_mode() && call_kind == CALL_AS_FUNCTION) {
5913 call_kind == CALL_AS_FUNCTION) {
5914 inner->SetValueAt(0, undefined); 5913 inner->SetValueAt(0, undefined);
5915 } 5914 }
5916 inner->SetValueAt(arity + 1, outer->LookupContext()); 5915 inner->SetValueAt(arity + 1, outer->LookupContext());
5917 for (int i = arity + 2; i < inner->length(); ++i) { 5916 for (int i = arity + 2; i < inner->length(); ++i) {
5918 inner->SetValueAt(i, undefined); 5917 inner->SetValueAt(i, undefined);
5919 } 5918 }
5920 5919
5921 inner->set_ast_id(AstNode::kFunctionEntryId); 5920 inner->set_ast_id(AstNode::kFunctionEntryId);
5922 return inner; 5921 return inner;
5923 } 5922 }
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
6253 } 6252 }
6254 } 6253 }
6255 6254
6256 #ifdef DEBUG 6255 #ifdef DEBUG
6257 if (graph_ != NULL) graph_->Verify(); 6256 if (graph_ != NULL) graph_->Verify();
6258 if (allocator_ != NULL) allocator_->Verify(); 6257 if (allocator_ != NULL) allocator_->Verify();
6259 #endif 6258 #endif
6260 } 6259 }
6261 6260
6262 } } // namespace v8::internal 6261 } } // 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