OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "v8.h" | 5 #include "v8.h" |
6 | 6 |
7 #include "accessors.h" | 7 #include "accessors.h" |
8 #include "api.h" | 8 #include "api.h" |
9 #include "bootstrapper.h" | 9 #include "bootstrapper.h" |
10 #include "codegen.h" | 10 #include "codegen.h" |
(...skipping 843 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
854 | 854 |
855 | 855 |
856 void Heap::MoveElements(FixedArray* array, | 856 void Heap::MoveElements(FixedArray* array, |
857 int dst_index, | 857 int dst_index, |
858 int src_index, | 858 int src_index, |
859 int len) { | 859 int len) { |
860 if (len == 0) return; | 860 if (len == 0) return; |
861 | 861 |
862 ASSERT(array->map() != fixed_cow_array_map()); | 862 ASSERT(array->map() != fixed_cow_array_map()); |
863 Object** dst_objects = array->data_start() + dst_index; | 863 Object** dst_objects = array->data_start() + dst_index; |
864 MemMove(dst_objects, array->data_start() + src_index, len * kPointerSize); | 864 OS::MemMove(dst_objects, |
| 865 array->data_start() + src_index, |
| 866 len * kPointerSize); |
865 if (!InNewSpace(array)) { | 867 if (!InNewSpace(array)) { |
866 for (int i = 0; i < len; i++) { | 868 for (int i = 0; i < len; i++) { |
867 // TODO(hpayer): check store buffer for entries | 869 // TODO(hpayer): check store buffer for entries |
868 if (InNewSpace(dst_objects[i])) { | 870 if (InNewSpace(dst_objects[i])) { |
869 RecordWrite(array->address(), array->OffsetOfElementAt(dst_index + i)); | 871 RecordWrite(array->address(), array->OffsetOfElementAt(dst_index + i)); |
870 } | 872 } |
871 } | 873 } |
872 } | 874 } |
873 incremental_marking()->RecordWrites(array); | 875 incremental_marking()->RecordWrites(array); |
874 } | 876 } |
(...skipping 2904 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3779 } | 3781 } |
3780 return result; | 3782 return result; |
3781 } | 3783 } |
3782 | 3784 |
3783 | 3785 |
3784 static inline void WriteOneByteData(Vector<const char> vector, | 3786 static inline void WriteOneByteData(Vector<const char> vector, |
3785 uint8_t* chars, | 3787 uint8_t* chars, |
3786 int len) { | 3788 int len) { |
3787 // Only works for ascii. | 3789 // Only works for ascii. |
3788 ASSERT(vector.length() == len); | 3790 ASSERT(vector.length() == len); |
3789 MemCopy(chars, vector.start(), len); | 3791 OS::MemCopy(chars, vector.start(), len); |
3790 } | 3792 } |
3791 | 3793 |
3792 static inline void WriteTwoByteData(Vector<const char> vector, | 3794 static inline void WriteTwoByteData(Vector<const char> vector, |
3793 uint16_t* chars, | 3795 uint16_t* chars, |
3794 int len) { | 3796 int len) { |
3795 const uint8_t* stream = reinterpret_cast<const uint8_t*>(vector.start()); | 3797 const uint8_t* stream = reinterpret_cast<const uint8_t*>(vector.start()); |
3796 unsigned stream_length = vector.length(); | 3798 unsigned stream_length = vector.length(); |
3797 while (stream_length != 0) { | 3799 while (stream_length != 0) { |
3798 unsigned consumed = 0; | 3800 unsigned consumed = 0; |
3799 uint32_t c = unibrow::Utf8::ValueOf(stream, stream_length, &consumed); | 3801 uint32_t c = unibrow::Utf8::ValueOf(stream, stream_length, &consumed); |
(...skipping 2615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6415 static_cast<int>(object_counts_[index])); \ | 6417 static_cast<int>(object_counts_[index])); \ |
6416 counters->count_of_CODE_AGE_##name()->Decrement( \ | 6418 counters->count_of_CODE_AGE_##name()->Decrement( \ |
6417 static_cast<int>(object_counts_last_time_[index])); \ | 6419 static_cast<int>(object_counts_last_time_[index])); \ |
6418 counters->size_of_CODE_AGE_##name()->Increment( \ | 6420 counters->size_of_CODE_AGE_##name()->Increment( \ |
6419 static_cast<int>(object_sizes_[index])); \ | 6421 static_cast<int>(object_sizes_[index])); \ |
6420 counters->size_of_CODE_AGE_##name()->Decrement( \ | 6422 counters->size_of_CODE_AGE_##name()->Decrement( \ |
6421 static_cast<int>(object_sizes_last_time_[index])); | 6423 static_cast<int>(object_sizes_last_time_[index])); |
6422 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) | 6424 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) |
6423 #undef ADJUST_LAST_TIME_OBJECT_COUNT | 6425 #undef ADJUST_LAST_TIME_OBJECT_COUNT |
6424 | 6426 |
6425 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); | 6427 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); |
6426 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); | 6428 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); |
6427 ClearObjectStats(); | 6429 ClearObjectStats(); |
6428 } | 6430 } |
6429 | 6431 |
6430 } } // namespace v8::internal | 6432 } } // namespace v8::internal |
OLD | NEW |