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

Side by Side Diff: src/hydrogen.cc

Issue 247573008: Fix deoptimization problem with inlined Array.push() (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 | « src/deoptimizer.cc ('k') | test/mjsunit/array-push10.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 7793 matching lines...) Expand 10 before | Expand all | Expand 10 after
7804 // chain, which would cause elements to go to dictionary mode and result 7804 // chain, which would cause elements to go to dictionary mode and result
7805 // in a map change. 7805 // in a map change.
7806 Handle<JSObject> prototype(JSObject::cast(receiver_map->prototype())); 7806 Handle<JSObject> prototype(JSObject::cast(receiver_map->prototype()));
7807 BuildCheckPrototypeMaps(prototype, Handle<JSObject>()); 7807 BuildCheckPrototypeMaps(prototype, Handle<JSObject>());
7808 7808
7809 const int argc = expr->arguments()->length(); 7809 const int argc = expr->arguments()->length();
7810 if (argc != 1) return false; 7810 if (argc != 1) return false;
7811 7811
7812 HValue* value_to_push = Pop(); 7812 HValue* value_to_push = Pop();
7813 HValue* array = Pop(); 7813 HValue* array = Pop();
7814 Drop(1); // Drop function.
7814 7815
7815 HInstruction* new_size = NULL; 7816 HInstruction* new_size = NULL;
7816 HValue* length = NULL; 7817 HValue* length = NULL;
7817 7818
7818 { 7819 {
7819 NoObservableSideEffectsScope scope(this); 7820 NoObservableSideEffectsScope scope(this);
7820 7821
7821 length = Add<HLoadNamedField>(array, static_cast<HValue*>(NULL), 7822 length = Add<HLoadNamedField>(array, static_cast<HValue*>(NULL),
7822 HObjectAccess::ForArrayLength(elements_kind)); 7823 HObjectAccess::ForArrayLength(elements_kind));
7823 7824
7824 new_size = AddUncasted<HAdd>(length, graph()->GetConstant1()); 7825 new_size = AddUncasted<HAdd>(length, graph()->GetConstant1());
7825 7826
7826 bool is_array = receiver_map->instance_type() == JS_ARRAY_TYPE; 7827 bool is_array = receiver_map->instance_type() == JS_ARRAY_TYPE;
7827 BuildUncheckedMonomorphicElementAccess(array, length, 7828 BuildUncheckedMonomorphicElementAccess(array, length,
7828 value_to_push, is_array, 7829 value_to_push, is_array,
7829 elements_kind, STORE, 7830 elements_kind, STORE,
7830 NEVER_RETURN_HOLE, 7831 NEVER_RETURN_HOLE,
7831 STORE_AND_GROW_NO_TRANSITION); 7832 STORE_AND_GROW_NO_TRANSITION);
7832 Add<HSimulate>(expr->id(), REMOVABLE_SIMULATE); 7833 Add<HSimulate>(expr->id(), REMOVABLE_SIMULATE);
7833 } 7834 }
7834 7835
7835 Drop(1); // Drop function.
7836 ast_context()->ReturnValue(new_size); 7836 ast_context()->ReturnValue(new_size);
7837 return true; 7837 return true;
7838 } 7838 }
7839 default: 7839 default:
7840 // Not yet supported for inlining. 7840 // Not yet supported for inlining.
7841 break; 7841 break;
7842 } 7842 }
7843 return false; 7843 return false;
7844 } 7844 }
7845 7845
(...skipping 3826 matching lines...) Expand 10 before | Expand all | Expand 10 after
11672 if (ShouldProduceTraceOutput()) { 11672 if (ShouldProduceTraceOutput()) {
11673 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); 11673 isolate()->GetHTracer()->TraceHydrogen(name(), graph_);
11674 } 11674 }
11675 11675
11676 #ifdef DEBUG 11676 #ifdef DEBUG
11677 graph_->Verify(false); // No full verify. 11677 graph_->Verify(false); // No full verify.
11678 #endif 11678 #endif
11679 } 11679 }
11680 11680
11681 } } // namespace v8::internal 11681 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/deoptimizer.cc ('k') | test/mjsunit/array-push10.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698