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

Side by Side Diff: src/hydrogen.cc

Issue 246543007: Fix the Array.push simulate for non-effect context. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 8 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/array-push11.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 7812 matching lines...) Expand 10 before | Expand all | Expand 10 after
7823 HObjectAccess::ForArrayLength(elements_kind)); 7823 HObjectAccess::ForArrayLength(elements_kind));
7824 7824
7825 new_size = AddUncasted<HAdd>(length, graph()->GetConstant1()); 7825 new_size = AddUncasted<HAdd>(length, graph()->GetConstant1());
7826 7826
7827 bool is_array = receiver_map->instance_type() == JS_ARRAY_TYPE; 7827 bool is_array = receiver_map->instance_type() == JS_ARRAY_TYPE;
7828 BuildUncheckedMonomorphicElementAccess(array, length, 7828 BuildUncheckedMonomorphicElementAccess(array, length,
7829 value_to_push, is_array, 7829 value_to_push, is_array,
7830 elements_kind, STORE, 7830 elements_kind, STORE,
7831 NEVER_RETURN_HOLE, 7831 NEVER_RETURN_HOLE,
7832 STORE_AND_GROW_NO_TRANSITION); 7832 STORE_AND_GROW_NO_TRANSITION);
7833
7834 if (!ast_context()->IsEffect()) Push(new_size);
7833 Add<HSimulate>(expr->id(), REMOVABLE_SIMULATE); 7835 Add<HSimulate>(expr->id(), REMOVABLE_SIMULATE);
7836 if (!ast_context()->IsEffect()) Drop(1);
7834 } 7837 }
7835 7838
7836 ast_context()->ReturnValue(new_size); 7839 ast_context()->ReturnValue(new_size);
7837 return true; 7840 return true;
7838 } 7841 }
7839 default: 7842 default:
7840 // Not yet supported for inlining. 7843 // Not yet supported for inlining.
7841 break; 7844 break;
7842 } 7845 }
7843 return false; 7846 return false;
(...skipping 3828 matching lines...) Expand 10 before | Expand all | Expand 10 after
11672 if (ShouldProduceTraceOutput()) { 11675 if (ShouldProduceTraceOutput()) {
11673 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); 11676 isolate()->GetHTracer()->TraceHydrogen(name(), graph_);
11674 } 11677 }
11675 11678
11676 #ifdef DEBUG 11679 #ifdef DEBUG
11677 graph_->Verify(false); // No full verify. 11680 graph_->Verify(false); // No full verify.
11678 #endif 11681 #endif
11679 } 11682 }
11680 11683
11681 } } // namespace v8::internal 11684 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/array-push11.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698