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 8495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8506 } | 8506 } |
8507 | 8507 |
8508 | 8508 |
8509 MaybeObject* JSObject::SetFastDoubleElementsCapacityAndLength( | 8509 MaybeObject* JSObject::SetFastDoubleElementsCapacityAndLength( |
8510 int capacity, | 8510 int capacity, |
8511 int length) { | 8511 int length) { |
8512 Heap* heap = GetHeap(); | 8512 Heap* heap = GetHeap(); |
8513 // We should never end in here with a pixel or external array. | 8513 // We should never end in here with a pixel or external array. |
8514 ASSERT(!HasExternalArrayElements()); | 8514 ASSERT(!HasExternalArrayElements()); |
8515 | 8515 |
8516 FixedDoubleArray* elems; | 8516 FixedArrayBase* elems; |
8517 { MaybeObject* maybe_obj = | 8517 { MaybeObject* maybe_obj = |
8518 heap->AllocateUninitializedFixedDoubleArray(capacity); | 8518 heap->AllocateUninitializedFixedDoubleArray(capacity); |
8519 if (!maybe_obj->To(&elems)) return maybe_obj; | 8519 if (!maybe_obj->To(&elems)) return maybe_obj; |
8520 } | 8520 } |
8521 | 8521 |
8522 Map* new_map; | 8522 Map* new_map; |
8523 { MaybeObject* maybe_obj = | 8523 { MaybeObject* maybe_obj = |
8524 GetElementsTransitionMap(heap->isolate(), FAST_DOUBLE_ELEMENTS); | 8524 GetElementsTransitionMap(heap->isolate(), FAST_DOUBLE_ELEMENTS); |
8525 if (!maybe_obj->To(&new_map)) return maybe_obj; | 8525 if (!maybe_obj->To(&new_map)) return maybe_obj; |
8526 } | 8526 } |
(...skipping 1130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9657 CALL_HEAP_FUNCTION(object->GetIsolate(), | 9657 CALL_HEAP_FUNCTION(object->GetIsolate(), |
9658 object->TransitionElementsKind(to_kind), | 9658 object->TransitionElementsKind(to_kind), |
9659 Object); | 9659 Object); |
9660 } | 9660 } |
9661 | 9661 |
9662 | 9662 |
9663 MaybeObject* JSObject::TransitionElementsKind(ElementsKind to_kind) { | 9663 MaybeObject* JSObject::TransitionElementsKind(ElementsKind to_kind) { |
9664 ElementsKind from_kind = map()->elements_kind(); | 9664 ElementsKind from_kind = map()->elements_kind(); |
9665 | 9665 |
9666 Isolate* isolate = GetIsolate(); | 9666 Isolate* isolate = GetIsolate(); |
9667 if (from_kind == FAST_SMI_ONLY_ELEMENTS && | 9667 if ((from_kind == FAST_SMI_ONLY_ELEMENTS || |
9668 (to_kind == FAST_ELEMENTS || | 9668 elements() == isolate->heap()->empty_fixed_array()) && |
9669 elements() == isolate->heap()->empty_fixed_array())) { | 9669 to_kind == FAST_ELEMENTS) { |
| 9670 ASSERT(from_kind != FAST_ELEMENTS); |
9670 MaybeObject* maybe_new_map = GetElementsTransitionMap(isolate, to_kind); | 9671 MaybeObject* maybe_new_map = GetElementsTransitionMap(isolate, to_kind); |
9671 Map* new_map; | 9672 Map* new_map; |
9672 if (!maybe_new_map->To(&new_map)) return maybe_new_map; | 9673 if (!maybe_new_map->To(&new_map)) return maybe_new_map; |
9673 set_map(new_map); | 9674 set_map(new_map); |
9674 if (FLAG_trace_elements_transitions) { | 9675 if (FLAG_trace_elements_transitions) { |
9675 FixedArrayBase* elms = FixedArrayBase::cast(elements()); | 9676 FixedArrayBase* elms = FixedArrayBase::cast(elements()); |
9676 PrintElementsTransition(stdout, from_kind, elms, to_kind, elms); | 9677 PrintElementsTransition(stdout, from_kind, elms, to_kind, elms); |
9677 } | 9678 } |
9678 return this; | 9679 return this; |
9679 } | 9680 } |
(...skipping 3287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12967 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); | 12968 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); |
12968 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); | 12969 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); |
12969 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); | 12970 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); |
12970 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); | 12971 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); |
12971 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); | 12972 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); |
12972 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); | 12973 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); |
12973 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); | 12974 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); |
12974 } | 12975 } |
12975 | 12976 |
12976 } } // namespace v8::internal | 12977 } } // namespace v8::internal |
OLD | NEW |