| 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 7678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7689 if (cell_contents->IsSmi()) { | 7689 if (cell_contents->IsSmi()) { |
| 7690 *kind = static_cast<ElementsKind>( | 7690 *kind = static_cast<ElementsKind>( |
| 7691 Smi::cast(cell_contents)->value()); | 7691 Smi::cast(cell_contents)->value()); |
| 7692 return true; | 7692 return true; |
| 7693 } | 7693 } |
| 7694 } | 7694 } |
| 7695 return false; | 7695 return false; |
| 7696 } | 7696 } |
| 7697 | 7697 |
| 7698 | 7698 |
| 7699 // Heuristic: We only need to create allocation site info if the boilerplate | |
| 7700 // elements kind is the initial elements kind. | |
| 7701 AllocationSiteMode AllocationSiteInfo::GetMode( | |
| 7702 ElementsKind boilerplate_elements_kind) { | |
| 7703 if (FLAG_track_allocation_sites && | |
| 7704 IsFastSmiElementsKind(boilerplate_elements_kind)) { | |
| 7705 return TRACK_ALLOCATION_SITE; | |
| 7706 } | |
| 7707 | |
| 7708 return DONT_TRACK_ALLOCATION_SITE; | |
| 7709 } | |
| 7710 | |
| 7711 | |
| 7712 AllocationSiteMode AllocationSiteInfo::GetMode(ElementsKind from, | |
| 7713 ElementsKind to) { | |
| 7714 if (FLAG_track_allocation_sites && | |
| 7715 IsFastSmiElementsKind(from) && | |
| 7716 (IsFastObjectElementsKind(to) || IsFastDoubleElementsKind(to))) { | |
| 7717 return TRACK_ALLOCATION_SITE; | |
| 7718 } | |
| 7719 | |
| 7720 return DONT_TRACK_ALLOCATION_SITE; | |
| 7721 } | |
| 7722 | |
| 7723 | |
| 7724 uint32_t StringHasher::MakeArrayIndexHash(uint32_t value, int length) { | 7699 uint32_t StringHasher::MakeArrayIndexHash(uint32_t value, int length) { |
| 7725 // For array indexes mix the length into the hash as an array index could | 7700 // For array indexes mix the length into the hash as an array index could |
| 7726 // be zero. | 7701 // be zero. |
| 7727 ASSERT(length > 0); | 7702 ASSERT(length > 0); |
| 7728 ASSERT(length <= String::kMaxArrayIndexSize); | 7703 ASSERT(length <= String::kMaxArrayIndexSize); |
| 7729 ASSERT(TenToThe(String::kMaxCachedArrayIndexLength) < | 7704 ASSERT(TenToThe(String::kMaxCachedArrayIndexLength) < |
| 7730 (1 << String::kArrayIndexValueBits)); | 7705 (1 << String::kArrayIndexValueBits)); |
| 7731 | 7706 |
| 7732 value <<= String::kHashShift; | 7707 value <<= String::kHashShift; |
| 7733 value |= length << String::kArrayIndexHashLengthShift; | 7708 value |= length << String::kArrayIndexHashLengthShift; |
| (...skipping 6589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14323 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); | 14298 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); |
| 14324 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); | 14299 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); |
| 14325 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); | 14300 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); |
| 14326 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); | 14301 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); |
| 14327 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); | 14302 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); |
| 14328 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); | 14303 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); |
| 14329 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); | 14304 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); |
| 14330 } | 14305 } |
| 14331 | 14306 |
| 14332 } } // namespace v8::internal | 14307 } } // namespace v8::internal |
| OLD | NEW |