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 863 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
874 // but that may change. | 874 // but that may change. |
875 bool write_barrier_needed = (current_object_address != NULL && | 875 bool write_barrier_needed = (current_object_address != NULL && |
876 source_space != NEW_SPACE && | 876 source_space != NEW_SPACE && |
877 source_space != CELL_SPACE && | 877 source_space != CELL_SPACE && |
878 source_space != PROPERTY_CELL_SPACE && | 878 source_space != PROPERTY_CELL_SPACE && |
879 source_space != CODE_SPACE && | 879 source_space != CODE_SPACE && |
880 source_space != OLD_DATA_SPACE); | 880 source_space != OLD_DATA_SPACE); |
881 while (current < limit) { | 881 while (current < limit) { |
882 int data = source_->Get(); | 882 int data = source_->Get(); |
883 switch (data) { | 883 switch (data) { |
884 #define CASE_STATEMENT(where, how, within, space_number) \ | 884 #define CASE_STATEMENT(where, how, within, space_number) \ |
885 case where + how + within + space_number: \ | 885 case where + how + within + space_number: \ |
886 ASSERT((where & ~kPointedToMask) == 0); \ | 886 STATIC_ASSERT((where & ~kPointedToMask) == 0); \ |
887 ASSERT((how & ~kHowToCodeMask) == 0); \ | 887 STATIC_ASSERT((how & ~kHowToCodeMask) == 0); \ |
888 ASSERT((within & ~kWhereToPointMask) == 0); \ | 888 STATIC_ASSERT((within & ~kWhereToPointMask) == 0); \ |
889 ASSERT((space_number & ~kSpaceMask) == 0); | 889 STATIC_ASSERT((space_number & ~kSpaceMask) == 0); |
890 | 890 |
891 #define CASE_BODY(where, how, within, space_number_if_any) \ | 891 #define CASE_BODY(where, how, within, space_number_if_any) \ |
892 { \ | 892 { \ |
893 bool emit_write_barrier = false; \ | 893 bool emit_write_barrier = false; \ |
894 bool current_was_incremented = false; \ | 894 bool current_was_incremented = false; \ |
895 int space_number = space_number_if_any == kAnyOldSpace ? \ | 895 int space_number = space_number_if_any == kAnyOldSpace ? \ |
896 (data & kSpaceMask) : space_number_if_any; \ | 896 (data & kSpaceMask) : space_number_if_any; \ |
897 if (where == kNewObject && how == kPlain && within == kStartOfObject) {\ | 897 if (where == kNewObject && how == kPlain && within == kStartOfObject) {\ |
898 ReadObject(space_number, current); \ | 898 ReadObject(space_number, current); \ |
899 emit_write_barrier = (space_number == NEW_SPACE); \ | 899 emit_write_barrier = (space_number == NEW_SPACE); \ |
(...skipping 1005 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1905 SetHeaderValue(kReservationsOffset + i, cs->CurrentAllocationAddress(i)); | 1905 SetHeaderValue(kReservationsOffset + i, cs->CurrentAllocationAddress(i)); |
1906 } | 1906 } |
1907 } | 1907 } |
1908 | 1908 |
1909 | 1909 |
1910 bool SerializedCodeData::IsSane() { | 1910 bool SerializedCodeData::IsSane() { |
1911 return GetHeaderValue(kVersionHashOffset) == Version::Hash() && | 1911 return GetHeaderValue(kVersionHashOffset) == Version::Hash() && |
1912 PayloadLength() >= SharedFunctionInfo::kSize; | 1912 PayloadLength() >= SharedFunctionInfo::kSize; |
1913 } | 1913 } |
1914 } } // namespace v8::internal | 1914 } } // namespace v8::internal |
OLD | NEW |