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 13461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13472 } else { | 13472 } else { |
13473 // Non-smi length argument produces a dictionary | 13473 // Non-smi length argument produces a dictionary |
13474 can_use_type_feedback = false; | 13474 can_use_type_feedback = false; |
13475 } | 13475 } |
13476 } | 13476 } |
13477 | 13477 |
13478 JSArray* array; | 13478 JSArray* array; |
13479 MaybeObject* maybe_array; | 13479 MaybeObject* maybe_array; |
13480 if (!type_info.is_null() && | 13480 if (!type_info.is_null() && |
13481 *type_info != isolate->heap()->undefined_value() && | 13481 *type_info != isolate->heap()->undefined_value() && |
13482 JSGlobalPropertyCell::cast(*type_info)->value()->IsSmi() && | 13482 Cell::cast(*type_info)->value()->IsSmi() && |
13483 can_use_type_feedback) { | 13483 can_use_type_feedback) { |
13484 JSGlobalPropertyCell* cell = JSGlobalPropertyCell::cast(*type_info); | 13484 Cell* cell = Cell::cast(*type_info); |
13485 Smi* smi = Smi::cast(cell->value()); | 13485 Smi* smi = Smi::cast(cell->value()); |
13486 ElementsKind to_kind = static_cast<ElementsKind>(smi->value()); | 13486 ElementsKind to_kind = static_cast<ElementsKind>(smi->value()); |
13487 if (holey && !IsFastHoleyElementsKind(to_kind)) { | 13487 if (holey && !IsFastHoleyElementsKind(to_kind)) { |
13488 to_kind = GetHoleyElementsKind(to_kind); | 13488 to_kind = GetHoleyElementsKind(to_kind); |
13489 // Update the allocation site info to reflect the advice alteration. | 13489 // Update the allocation site info to reflect the advice alteration. |
13490 cell->set_value(Smi::FromInt(to_kind)); | 13490 cell->set_value(Smi::FromInt(to_kind)); |
13491 } | 13491 } |
13492 | 13492 |
13493 maybe_array = isolate->heap()->AllocateJSObjectWithAllocationSite( | 13493 maybe_array = isolate->heap()->AllocateJSObjectWithAllocationSite( |
13494 *constructor, type_info); | 13494 *constructor, type_info); |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13633 // Handle last resort GC and make sure to allow future allocations | 13633 // Handle last resort GC and make sure to allow future allocations |
13634 // to grow the heap without causing GCs (if possible). | 13634 // to grow the heap without causing GCs (if possible). |
13635 isolate->counters()->gc_last_resort_from_js()->Increment(); | 13635 isolate->counters()->gc_last_resort_from_js()->Increment(); |
13636 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 13636 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
13637 "Runtime::PerformGC"); | 13637 "Runtime::PerformGC"); |
13638 } | 13638 } |
13639 } | 13639 } |
13640 | 13640 |
13641 | 13641 |
13642 } } // namespace v8::internal | 13642 } } // namespace v8::internal |
OLD | NEW |