Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 1372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1383 case EXTERNAL_PIXEL_ARRAY_TYPE: | 1383 case EXTERNAL_PIXEL_ARRAY_TYPE: |
| 1384 case EXTERNAL_BYTE_ARRAY_TYPE: | 1384 case EXTERNAL_BYTE_ARRAY_TYPE: |
| 1385 case EXTERNAL_UNSIGNED_BYTE_ARRAY_TYPE: | 1385 case EXTERNAL_UNSIGNED_BYTE_ARRAY_TYPE: |
| 1386 case EXTERNAL_SHORT_ARRAY_TYPE: | 1386 case EXTERNAL_SHORT_ARRAY_TYPE: |
| 1387 case EXTERNAL_UNSIGNED_SHORT_ARRAY_TYPE: | 1387 case EXTERNAL_UNSIGNED_SHORT_ARRAY_TYPE: |
| 1388 case EXTERNAL_INT_ARRAY_TYPE: | 1388 case EXTERNAL_INT_ARRAY_TYPE: |
| 1389 case EXTERNAL_UNSIGNED_INT_ARRAY_TYPE: | 1389 case EXTERNAL_UNSIGNED_INT_ARRAY_TYPE: |
| 1390 case EXTERNAL_FLOAT_ARRAY_TYPE: | 1390 case EXTERNAL_FLOAT_ARRAY_TYPE: |
| 1391 case EXTERNAL_DOUBLE_ARRAY_TYPE: | 1391 case EXTERNAL_DOUBLE_ARRAY_TYPE: |
| 1392 break; | 1392 break; |
| 1393 case SHARED_FUNCTION_INFO_TYPE: | 1393 case SHARED_FUNCTION_INFO_TYPE: { |
| 1394 SharedFunctionInfo::BodyDescriptor::IterateBody(this, v); | 1394 SharedFunctionInfo* shared = reinterpret_cast<SharedFunctionInfo*>(this); |
| 1395 shared->SharedFunctionInfoIterateBody(v); | |
| 1395 break; | 1396 break; |
| 1397 } | |
| 1396 | 1398 |
| 1397 #define MAKE_STRUCT_CASE(NAME, Name, name) \ | 1399 #define MAKE_STRUCT_CASE(NAME, Name, name) \ |
| 1398 case NAME##_TYPE: | 1400 case NAME##_TYPE: |
| 1399 STRUCT_LIST(MAKE_STRUCT_CASE) | 1401 STRUCT_LIST(MAKE_STRUCT_CASE) |
| 1400 #undef MAKE_STRUCT_CASE | 1402 #undef MAKE_STRUCT_CASE |
| 1401 StructBodyDescriptor::IterateBody(this, object_size, v); | 1403 StructBodyDescriptor::IterateBody(this, object_size, v); |
| 1402 break; | 1404 break; |
| 1403 default: | 1405 default: |
| 1404 PrintF("Unknown type: %d\n", type); | 1406 PrintF("Unknown type: %d\n", type); |
| 1405 UNREACHABLE(); | 1407 UNREACHABLE(); |
| (...skipping 6513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 7919 // Resize the initial map and all maps in its transition tree. | 7921 // Resize the initial map and all maps in its transition tree. |
| 7920 map->TraverseTransitionTree(&ShrinkInstanceSize, &slack); | 7922 map->TraverseTransitionTree(&ShrinkInstanceSize, &slack); |
| 7921 | 7923 |
| 7922 // Give the correct expected_nof_properties to initial maps created later. | 7924 // Give the correct expected_nof_properties to initial maps created later. |
| 7923 ASSERT(expected_nof_properties() >= slack); | 7925 ASSERT(expected_nof_properties() >= slack); |
| 7924 set_expected_nof_properties(expected_nof_properties() - slack); | 7926 set_expected_nof_properties(expected_nof_properties() - slack); |
| 7925 } | 7927 } |
| 7926 } | 7928 } |
| 7927 | 7929 |
| 7928 | 7930 |
| 7931 void SharedFunctionInfo::SharedFunctionInfoIterateBody(ObjectVisitor* v) { | |
| 7932 v->VisitSharedFunctionInfo(this); | |
| 7933 SharedFunctionInfo::BodyDescriptor::IterateBody(this, v); | |
| 7934 } | |
| 7935 | |
| 7936 | |
| 7929 #define DECLARE_TAG(ignore1, name, ignore2) name, | 7937 #define DECLARE_TAG(ignore1, name, ignore2) name, |
| 7930 const char* const VisitorSynchronization::kTags[ | 7938 const char* const VisitorSynchronization::kTags[ |
| 7931 VisitorSynchronization::kNumberOfSyncTags] = { | 7939 VisitorSynchronization::kNumberOfSyncTags] = { |
| 7932 VISITOR_SYNCHRONIZATION_TAGS_LIST(DECLARE_TAG) | 7940 VISITOR_SYNCHRONIZATION_TAGS_LIST(DECLARE_TAG) |
| 7933 }; | 7941 }; |
| 7934 #undef DECLARE_TAG | 7942 #undef DECLARE_TAG |
| 7935 | 7943 |
| 7936 | 7944 |
| 7937 #define DECLARE_TAG(ignore1, ignore2, name) name, | 7945 #define DECLARE_TAG(ignore1, ignore2, name) name, |
| 7938 const char* const VisitorSynchronization::kTagNames[ | 7946 const char* const VisitorSynchronization::kTagNames[ |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 7976 ASSERT((RelocInfo::IsJSReturn(rinfo->rmode()) && | 7984 ASSERT((RelocInfo::IsJSReturn(rinfo->rmode()) && |
| 7977 rinfo->IsPatchedReturnSequence()) || | 7985 rinfo->IsPatchedReturnSequence()) || |
| 7978 (RelocInfo::IsDebugBreakSlot(rinfo->rmode()) && | 7986 (RelocInfo::IsDebugBreakSlot(rinfo->rmode()) && |
| 7979 rinfo->IsPatchedDebugBreakSlotSequence())); | 7987 rinfo->IsPatchedDebugBreakSlotSequence())); |
| 7980 Object* target = Code::GetCodeFromTargetAddress(rinfo->call_address()); | 7988 Object* target = Code::GetCodeFromTargetAddress(rinfo->call_address()); |
| 7981 Object* old_target = target; | 7989 Object* old_target = target; |
| 7982 VisitPointer(&target); | 7990 VisitPointer(&target); |
| 7983 CHECK_EQ(target, old_target); // VisitPointer doesn't change Code* *target. | 7991 CHECK_EQ(target, old_target); // VisitPointer doesn't change Code* *target. |
| 7984 } | 7992 } |
| 7985 | 7993 |
| 7994 void ObjectVisitor::VisitSharedFunctionInfo(SharedFunctionInfo* shared) { | |
|
Michael Starzinger
2012/04/03 16:38:13
You could move that to the header file.
| |
| 7995 } | |
| 7986 | 7996 |
| 7987 void ObjectVisitor::VisitEmbeddedPointer(RelocInfo* rinfo) { | 7997 void ObjectVisitor::VisitEmbeddedPointer(RelocInfo* rinfo) { |
| 7988 ASSERT(rinfo->rmode() == RelocInfo::EMBEDDED_OBJECT); | 7998 ASSERT(rinfo->rmode() == RelocInfo::EMBEDDED_OBJECT); |
| 7989 VisitPointer(rinfo->target_object_address()); | 7999 VisitPointer(rinfo->target_object_address()); |
| 7990 } | 8000 } |
| 7991 | 8001 |
| 7992 void ObjectVisitor::VisitExternalReference(RelocInfo* rinfo) { | 8002 void ObjectVisitor::VisitExternalReference(RelocInfo* rinfo) { |
| 7993 Address* p = rinfo->target_reference_address(); | 8003 Address* p = rinfo->target_reference_address(); |
| 7994 VisitExternalReferences(p, p + 1); | 8004 VisitExternalReferences(p, p + 1); |
| 7995 } | 8005 } |
| (...skipping 4970 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 12966 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); | 12976 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); |
| 12967 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); | 12977 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); |
| 12968 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); | 12978 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); |
| 12969 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); | 12979 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); |
| 12970 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); | 12980 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); |
| 12971 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); | 12981 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); |
| 12972 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); | 12982 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); |
| 12973 } | 12983 } |
| 12974 | 12984 |
| 12975 } } // namespace v8::internal | 12985 } } // namespace v8::internal |
| OLD | NEW |