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 "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/api.h" | 8 #include "src/api.h" |
9 #include "src/base/platform/platform.h" | 9 #include "src/base/platform/platform.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 1916 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1927 while (current < end) { | 1927 while (current < end) { |
1928 while (current < end && (*current)->IsSmi()) current++; | 1928 while (current < end && (*current)->IsSmi()) current++; |
1929 if (current < end) OutputRawData(reinterpret_cast<Address>(current)); | 1929 if (current < end) OutputRawData(reinterpret_cast<Address>(current)); |
1930 | 1930 |
1931 while (current < end && !(*current)->IsSmi()) { | 1931 while (current < end && !(*current)->IsSmi()) { |
1932 HeapObject* current_contents = HeapObject::cast(*current); | 1932 HeapObject* current_contents = HeapObject::cast(*current); |
1933 int root_index = serializer_->root_index_map()->Lookup(current_contents); | 1933 int root_index = serializer_->root_index_map()->Lookup(current_contents); |
1934 // Repeats are not subject to the write barrier so we can only use | 1934 // Repeats are not subject to the write barrier so we can only use |
1935 // immortal immovable root members. They are never in new space. | 1935 // immortal immovable root members. They are never in new space. |
1936 if (current != start && root_index != RootIndexMap::kInvalidRootIndex && | 1936 if (current != start && root_index != RootIndexMap::kInvalidRootIndex && |
1937 Heap::RootIsImmortalImmovable( | 1937 Heap::RootIsImmortalImmovable(root_index) && |
1938 static_cast<Heap::RootListIndex>(root_index)) && | |
1939 current_contents == current[-1]) { | 1938 current_contents == current[-1]) { |
1940 DCHECK(!serializer_->isolate()->heap()->InNewSpace(current_contents)); | 1939 DCHECK(!serializer_->isolate()->heap()->InNewSpace(current_contents)); |
1941 int repeat_count = 1; | 1940 int repeat_count = 1; |
1942 while (¤t[repeat_count] < end - 1 && | 1941 while (¤t[repeat_count] < end - 1 && |
1943 current[repeat_count] == current_contents) { | 1942 current[repeat_count] == current_contents) { |
1944 repeat_count++; | 1943 repeat_count++; |
1945 } | 1944 } |
1946 current += repeat_count; | 1945 current += repeat_count; |
1947 bytes_processed_so_far_ += repeat_count * kPointerSize; | 1946 bytes_processed_so_far_ += repeat_count * kPointerSize; |
1948 if (repeat_count > kNumberOfFixedRepeat) { | 1947 if (repeat_count > kNumberOfFixedRepeat) { |
(...skipping 742 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2691 SerializedCodeData* scd = new SerializedCodeData(cached_data); | 2690 SerializedCodeData* scd = new SerializedCodeData(cached_data); |
2692 SanityCheckResult r = scd->SanityCheck(isolate, source); | 2691 SanityCheckResult r = scd->SanityCheck(isolate, source); |
2693 if (r == CHECK_SUCCESS) return scd; | 2692 if (r == CHECK_SUCCESS) return scd; |
2694 cached_data->Reject(); | 2693 cached_data->Reject(); |
2695 source->GetIsolate()->counters()->code_cache_reject_reason()->AddSample(r); | 2694 source->GetIsolate()->counters()->code_cache_reject_reason()->AddSample(r); |
2696 delete scd; | 2695 delete scd; |
2697 return NULL; | 2696 return NULL; |
2698 } | 2697 } |
2699 } // namespace internal | 2698 } // namespace internal |
2700 } // namespace v8 | 2699 } // namespace v8 |
OLD | NEW |