OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 3768 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3779 // until the first value is seen that can't be stored as a double. | 3779 // until the first value is seen that can't be stored as a double. |
3780 if (boilerplate_value->IsNumber()) { | 3780 if (boilerplate_value->IsNumber()) { |
3781 double_literals->set(i, boilerplate_value->Number()); | 3781 double_literals->set(i, boilerplate_value->Number()); |
3782 } else { | 3782 } else { |
3783 elements_kind = FAST_ELEMENTS; | 3783 elements_kind = FAST_ELEMENTS; |
3784 } | 3784 } |
3785 } | 3785 } |
3786 } | 3786 } |
3787 } | 3787 } |
3788 | 3788 |
3789 // Very small array literals that don't have a concrete hint about their type | 3789 // Very small array literals that don't have a concrete hint about their type |
danno
2012/11/13 22:05:12
Remove all the code from this line (beginning of c
Toon Verwaest
2012/11/14 11:53:13
Done.
| |
3790 // from a constant value should default to the slow case to avoid lots of | 3790 // from a constant value should default to the slow case to avoid lots of |
3791 // elements transitions on really small objects. | 3791 // elements transitions on really small objects. |
3792 if (has_only_undefined_values && values->length() <= 2) { | 3792 if (has_only_undefined_values && |
3793 elements_kind = FAST_ELEMENTS; | 3793 values->length() <= 2 && |
3794 values->length() > 0) { | |
3795 // elements_kind = FAST_ELEMENTS; | |
3794 } | 3796 } |
danno
2012/11/13 22:05:12
... to here.
Toon Verwaest
2012/11/14 11:53:13
Done.
| |
3795 | 3797 |
3796 // Simple and shallow arrays can be lazily copied, we transform the | 3798 // Simple and shallow arrays can be lazily copied, we transform the |
3797 // elements array to a copy-on-write array. | 3799 // elements array to a copy-on-write array. |
3798 if (is_simple && depth == 1 && values->length() > 0 && | 3800 if (is_simple && depth == 1 && values->length() > 0 && |
3799 elements_kind != FAST_DOUBLE_ELEMENTS) { | 3801 elements_kind != FAST_DOUBLE_ELEMENTS) { |
3800 object_literals->set_map(heap->fixed_cow_array_map()); | 3802 object_literals->set_map(heap->fixed_cow_array_map()); |
3801 } | 3803 } |
3802 | 3804 |
3803 Handle<FixedArrayBase> element_values = elements_kind == FAST_DOUBLE_ELEMENTS | 3805 Handle<FixedArrayBase> element_values = elements_kind == FAST_DOUBLE_ELEMENTS |
3804 ? Handle<FixedArrayBase>(double_literals) | 3806 ? Handle<FixedArrayBase>(double_literals) |
(...skipping 2175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5980 ASSERT(info->isolate()->has_pending_exception()); | 5982 ASSERT(info->isolate()->has_pending_exception()); |
5981 } else { | 5983 } else { |
5982 result = parser.ParseProgram(); | 5984 result = parser.ParseProgram(); |
5983 } | 5985 } |
5984 } | 5986 } |
5985 info->SetFunction(result); | 5987 info->SetFunction(result); |
5986 return (result != NULL); | 5988 return (result != NULL); |
5987 } | 5989 } |
5988 | 5990 |
5989 } } // namespace v8::internal | 5991 } } // namespace v8::internal |
OLD | NEW |