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 8904 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8915 if (!maybe_maps->To(&maps)) return maybe_maps; | 8915 if (!maybe_maps->To(&maps)) return maybe_maps; |
8916 | 8916 |
8917 Map* current_map = initial_map; | 8917 Map* current_map = initial_map; |
8918 ElementsKind kind = current_map->elements_kind(); | 8918 ElementsKind kind = current_map->elements_kind(); |
8919 ASSERT(kind == GetInitialFastElementsKind()); | 8919 ASSERT(kind == GetInitialFastElementsKind()); |
8920 maps->set(kind, current_map); | 8920 maps->set(kind, current_map); |
8921 for (int i = GetSequenceIndexFromFastElementsKind(kind) + 1; | 8921 for (int i = GetSequenceIndexFromFastElementsKind(kind) + 1; |
8922 i < kFastElementsKindCount; ++i) { | 8922 i < kFastElementsKindCount; ++i) { |
8923 Map* new_map; | 8923 Map* new_map; |
8924 ElementsKind next_kind = GetFastElementsKindFromSequenceIndex(i); | 8924 ElementsKind next_kind = GetFastElementsKindFromSequenceIndex(i); |
8925 MaybeObject* maybe_new_map = | 8925 if (current_map->HasElementsTransition()) { |
8926 current_map->CopyAsElementsKind(next_kind, INSERT_TRANSITION); | 8926 new_map = current_map->elements_transition_map(); |
8927 if (!maybe_new_map->To(&new_map)) return maybe_new_map; | 8927 ASSERT(new_map->elements_kind() == next_kind); |
| 8928 } else { |
| 8929 MaybeObject* maybe_new_map = |
| 8930 current_map->CopyAsElementsKind(next_kind, INSERT_TRANSITION); |
| 8931 if (!maybe_new_map->To(&new_map)) return maybe_new_map; |
| 8932 } |
8928 maps->set(next_kind, new_map); | 8933 maps->set(next_kind, new_map); |
8929 current_map = new_map; | 8934 current_map = new_map; |
8930 } | 8935 } |
8931 native_context->set_js_array_maps(maps); | 8936 native_context->set_js_array_maps(maps); |
8932 return initial_map; | 8937 return initial_map; |
8933 } | 8938 } |
8934 | 8939 |
8935 | 8940 |
8936 Handle<Object> CacheInitialJSArrayMaps(Handle<Context> native_context, | 8941 Handle<Object> CacheInitialJSArrayMaps(Handle<Context> native_context, |
8937 Handle<Map> initial_map) { | 8942 Handle<Map> initial_map) { |
(...skipping 6147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
15085 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); | 15090 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); |
15086 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); | 15091 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); |
15087 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); | 15092 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); |
15088 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); | 15093 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); |
15089 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); | 15094 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); |
15090 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); | 15095 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); |
15091 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); | 15096 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); |
15092 } | 15097 } |
15093 | 15098 |
15094 } } // namespace v8::internal | 15099 } } // namespace v8::internal |
OLD | NEW |