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 1335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1346 | 1346 |
1347 return DONT_TRACK_ALLOCATION_SITE; | 1347 return DONT_TRACK_ALLOCATION_SITE; |
1348 } | 1348 } |
1349 | 1349 |
1350 | 1350 |
1351 inline bool AllocationSite::CanTrack(InstanceType type) { | 1351 inline bool AllocationSite::CanTrack(InstanceType type) { |
1352 return type == JS_ARRAY_TYPE; | 1352 return type == JS_ARRAY_TYPE; |
1353 } | 1353 } |
1354 | 1354 |
1355 | 1355 |
1356 MaybeObject* JSObject::EnsureCanContainHeapObjectElements() { | 1356 void JSObject::EnsureCanContainHeapObjectElements(Handle<JSObject> object) { |
1357 ValidateElements(); | 1357 object->ValidateElements(); |
1358 ElementsKind elements_kind = map()->elements_kind(); | 1358 ElementsKind elements_kind = object->map()->elements_kind(); |
1359 if (!IsFastObjectElementsKind(elements_kind)) { | 1359 if (!IsFastObjectElementsKind(elements_kind)) { |
1360 if (IsFastHoleyElementsKind(elements_kind)) { | 1360 if (IsFastHoleyElementsKind(elements_kind)) { |
1361 return TransitionElementsKind(FAST_HOLEY_ELEMENTS); | 1361 TransitionElementsKind(object, FAST_HOLEY_ELEMENTS); |
1362 } else { | 1362 } else { |
1363 return TransitionElementsKind(FAST_ELEMENTS); | 1363 TransitionElementsKind(object, FAST_ELEMENTS); |
1364 } | 1364 } |
1365 } | 1365 } |
1366 return this; | |
1367 } | 1366 } |
1368 | 1367 |
1369 | 1368 |
1370 MaybeObject* JSObject::EnsureCanContainElements(Object** objects, | 1369 MaybeObject* JSObject::EnsureCanContainElements(Object** objects, |
1371 uint32_t count, | 1370 uint32_t count, |
1372 EnsureElementsMode mode) { | 1371 EnsureElementsMode mode) { |
1373 ElementsKind current_kind = map()->elements_kind(); | 1372 ElementsKind current_kind = map()->elements_kind(); |
1374 ElementsKind target_kind = current_kind; | 1373 ElementsKind target_kind = current_kind; |
1375 ASSERT(mode != ALLOW_COPIED_DOUBLE_ELEMENTS); | 1374 ASSERT(mode != ALLOW_COPIED_DOUBLE_ELEMENTS); |
1376 bool is_holey = IsFastHoleyElementsKind(current_kind); | 1375 bool is_holey = IsFastHoleyElementsKind(current_kind); |
(...skipping 4921 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6298 #undef WRITE_UINT32_FIELD | 6297 #undef WRITE_UINT32_FIELD |
6299 #undef READ_SHORT_FIELD | 6298 #undef READ_SHORT_FIELD |
6300 #undef WRITE_SHORT_FIELD | 6299 #undef WRITE_SHORT_FIELD |
6301 #undef READ_BYTE_FIELD | 6300 #undef READ_BYTE_FIELD |
6302 #undef WRITE_BYTE_FIELD | 6301 #undef WRITE_BYTE_FIELD |
6303 | 6302 |
6304 | 6303 |
6305 } } // namespace v8::internal | 6304 } } // namespace v8::internal |
6306 | 6305 |
6307 #endif // V8_OBJECTS_INL_H_ | 6306 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |