OLD | NEW |
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 7768 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7779 // in a map change. | 7779 // in a map change. |
7780 Handle<JSObject> prototype(JSObject::cast(receiver_map->prototype())); | 7780 Handle<JSObject> prototype(JSObject::cast(receiver_map->prototype())); |
7781 BuildCheckPrototypeMaps(prototype, Handle<JSObject>()); | 7781 BuildCheckPrototypeMaps(prototype, Handle<JSObject>()); |
7782 | 7782 |
7783 const int argc = expr->arguments()->length(); | 7783 const int argc = expr->arguments()->length(); |
7784 if (argc != 1) return false; | 7784 if (argc != 1) return false; |
7785 | 7785 |
7786 HValue* value_to_push = Pop(); | 7786 HValue* value_to_push = Pop(); |
7787 HValue* array = Pop(); | 7787 HValue* array = Pop(); |
7788 | 7788 |
7789 HValue* length = Add<HLoadNamedField>(array, static_cast<HValue*>(NULL), | 7789 HInstruction* new_size = NULL; |
7790 HObjectAccess::ForArrayLength(elements_kind)); | 7790 HValue* length = NULL; |
7791 | 7791 |
7792 { | 7792 { |
7793 NoObservableSideEffectsScope scope(this); | 7793 NoObservableSideEffectsScope scope(this); |
7794 | 7794 |
| 7795 length = Add<HLoadNamedField>(array, static_cast<HValue*>(NULL), |
| 7796 HObjectAccess::ForArrayLength(elements_kind)); |
| 7797 |
| 7798 new_size = AddUncasted<HAdd>(length, graph()->GetConstant1()); |
| 7799 |
7795 bool is_array = receiver_map->instance_type() == JS_ARRAY_TYPE; | 7800 bool is_array = receiver_map->instance_type() == JS_ARRAY_TYPE; |
7796 BuildUncheckedMonomorphicElementAccess(array, length, | 7801 BuildUncheckedMonomorphicElementAccess(array, length, |
7797 value_to_push, is_array, | 7802 value_to_push, is_array, |
7798 elements_kind, STORE, | 7803 elements_kind, STORE, |
7799 NEVER_RETURN_HOLE, | 7804 NEVER_RETURN_HOLE, |
7800 STORE_AND_GROW_NO_TRANSITION); | 7805 STORE_AND_GROW_NO_TRANSITION); |
| 7806 Add<HSimulate>(expr->id(), REMOVABLE_SIMULATE); |
7801 } | 7807 } |
7802 | 7808 |
7803 HInstruction* new_size = NewUncasted<HAdd>(length, Add<HConstant>(argc)); | |
7804 Drop(1); // Drop function. | 7809 Drop(1); // Drop function. |
7805 ast_context()->ReturnInstruction(new_size, expr->id()); | 7810 ast_context()->ReturnValue(new_size); |
7806 return true; | 7811 return true; |
7807 } | 7812 } |
7808 default: | 7813 default: |
7809 // Not yet supported for inlining. | 7814 // Not yet supported for inlining. |
7810 break; | 7815 break; |
7811 } | 7816 } |
7812 return false; | 7817 return false; |
7813 } | 7818 } |
7814 | 7819 |
7815 | 7820 |
(...skipping 3825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11641 if (ShouldProduceTraceOutput()) { | 11646 if (ShouldProduceTraceOutput()) { |
11642 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 11647 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
11643 } | 11648 } |
11644 | 11649 |
11645 #ifdef DEBUG | 11650 #ifdef DEBUG |
11646 graph_->Verify(false); // No full verify. | 11651 graph_->Verify(false); // No full verify. |
11647 #endif | 11652 #endif |
11648 } | 11653 } |
11649 | 11654 |
11650 } } // namespace v8::internal | 11655 } } // namespace v8::internal |
OLD | NEW |