| 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 1908 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1919 | 1919 |
| 1920 // We cannot serialize typed array objects correctly. | 1920 // We cannot serialize typed array objects correctly. |
| 1921 DCHECK(!object_->IsJSTypedArray()); | 1921 DCHECK(!object_->IsJSTypedArray()); |
| 1922 | 1922 |
| 1923 // We don't expect fillers. | 1923 // We don't expect fillers. |
| 1924 DCHECK(!object_->IsFiller()); | 1924 DCHECK(!object_->IsFiller()); |
| 1925 | 1925 |
| 1926 if (object_->IsPrototypeInfo()) { | 1926 if (object_->IsPrototypeInfo()) { |
| 1927 Object* prototype_users = PrototypeInfo::cast(object_)->prototype_users(); | 1927 Object* prototype_users = PrototypeInfo::cast(object_)->prototype_users(); |
| 1928 if (prototype_users->IsWeakFixedArray()) { | 1928 if (prototype_users->IsWeakFixedArray()) { |
| 1929 WeakFixedArray::cast(prototype_users)->Compact(); | 1929 WeakFixedArray::cast(prototype_users)->CompactPrototypeUserList(); |
| 1930 } | 1930 } |
| 1931 } | 1931 } |
| 1932 | 1932 |
| 1933 if (object_->IsScript()) { | 1933 if (object_->IsScript()) { |
| 1934 // Clear cached line ends. | 1934 // Clear cached line ends. |
| 1935 Object* undefined = serializer_->isolate()->heap()->undefined_value(); | 1935 Object* undefined = serializer_->isolate()->heap()->undefined_value(); |
| 1936 Script::cast(object_)->set_line_ends(undefined); | 1936 Script::cast(object_)->set_line_ends(undefined); |
| 1937 Object* shared_list = Script::cast(object_)->shared_function_infos(); | 1937 Object* shared_list = Script::cast(object_)->shared_function_infos(); |
| 1938 if (shared_list->IsWeakFixedArray()) { | 1938 if (shared_list->IsWeakFixedArray()) { |
| 1939 WeakFixedArray::cast(shared_list)->Compact(); | 1939 WeakFixedArray::cast(shared_list)->Compact(); |
| (...skipping 843 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2783 SerializedCodeData* scd = new SerializedCodeData(cached_data); | 2783 SerializedCodeData* scd = new SerializedCodeData(cached_data); |
| 2784 SanityCheckResult r = scd->SanityCheck(isolate, source); | 2784 SanityCheckResult r = scd->SanityCheck(isolate, source); |
| 2785 if (r == CHECK_SUCCESS) return scd; | 2785 if (r == CHECK_SUCCESS) return scd; |
| 2786 cached_data->Reject(); | 2786 cached_data->Reject(); |
| 2787 source->GetIsolate()->counters()->code_cache_reject_reason()->AddSample(r); | 2787 source->GetIsolate()->counters()->code_cache_reject_reason()->AddSample(r); |
| 2788 delete scd; | 2788 delete scd; |
| 2789 return NULL; | 2789 return NULL; |
| 2790 } | 2790 } |
| 2791 } // namespace internal | 2791 } // namespace internal |
| 2792 } // namespace v8 | 2792 } // namespace v8 |
| OLD | NEW |