Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 |
| 11 // with the distribution. | 11 // with the distribution. |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 45 | 45 |
| 46 // Base class for all static visitors. | 46 // Base class for all static visitors. |
| 47 class StaticVisitorBase : public AllStatic { | 47 class StaticVisitorBase : public AllStatic { |
| 48 public: | 48 public: |
| 49 enum VisitorId { | 49 enum VisitorId { |
| 50 kVisitSeqAsciiString = 0, | 50 kVisitSeqAsciiString = 0, |
| 51 kVisitSeqTwoByteString, | 51 kVisitSeqTwoByteString, |
| 52 kVisitShortcutCandidate, | 52 kVisitShortcutCandidate, |
| 53 kVisitByteArray, | 53 kVisitByteArray, |
| 54 kVisitFixedArray, | 54 kVisitFixedArray, |
| 55 kVisitFixedDoubleArray, | |
| 55 kVisitGlobalContext, | 56 kVisitGlobalContext, |
| 56 | 57 |
| 57 // For data objects, JS objects and structs along with generic visitor which | 58 // For data objects, JS objects and structs along with generic visitor which |
| 58 // can visit object of any size we provide visitors specialized by | 59 // can visit object of any size we provide visitors specialized by |
| 59 // object size in words. | 60 // object size in words. |
| 60 // Ids of specialized visitors are declared in a linear order (without | 61 // Ids of specialized visitors are declared in a linear order (without |
| 61 // holes) starting from the id of visitor specialized for 2 words objects | 62 // holes) starting from the id of visitor specialized for 2 words objects |
| 62 // (base visitor id) and ending with the id of generic visitor. | 63 // (base visitor id) and ending with the id of generic visitor. |
| 63 // Method GetVisitorIdForSize depends on this ordering to calculate visitor | 64 // Method GetVisitorIdForSize depends on this ordering to calculate visitor |
| 64 // id of specialized visitor from given instance size, base visitor id and | 65 // id of specialized visitor from given instance size, base visitor id and |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 283 table_.Register(kVisitFixedArray, | 284 table_.Register(kVisitFixedArray, |
| 284 &FlexibleBodyVisitor<StaticVisitor, | 285 &FlexibleBodyVisitor<StaticVisitor, |
| 285 FixedArray::BodyDescriptor, | 286 FixedArray::BodyDescriptor, |
| 286 int>::Visit); | 287 int>::Visit); |
| 287 | 288 |
| 288 table_.Register(kVisitGlobalContext, | 289 table_.Register(kVisitGlobalContext, |
| 289 &FixedBodyVisitor<StaticVisitor, | 290 &FixedBodyVisitor<StaticVisitor, |
| 290 Context::ScavengeBodyDescriptor, | 291 Context::ScavengeBodyDescriptor, |
| 291 int>::Visit); | 292 int>::Visit); |
| 292 | 293 |
| 293 table_.Register(kVisitByteArray, &VisitByteArray); | 294 table_.Register(kVisitByteArray, &VisitByteArray); |
|
Vyacheslav Egorov (Chromium)
2011/06/08 12:31:16
If FixedDoubleArray can be in a new space you need
danno
2011/06/09 09:45:40
Done.
| |
| 294 | 295 |
| 295 table_.Register(kVisitSharedFunctionInfo, | 296 table_.Register(kVisitSharedFunctionInfo, |
| 296 &FixedBodyVisitor<StaticVisitor, | 297 &FixedBodyVisitor<StaticVisitor, |
| 297 SharedFunctionInfo::BodyDescriptor, | 298 SharedFunctionInfo::BodyDescriptor, |
| 298 int>::Visit); | 299 int>::Visit); |
| 299 | 300 |
| 300 table_.Register(kVisitSeqAsciiString, &VisitSeqAsciiString); | 301 table_.Register(kVisitSeqAsciiString, &VisitSeqAsciiString); |
| 301 | 302 |
| 302 table_.Register(kVisitSeqTwoByteString, &VisitSeqTwoByteString); | 303 table_.Register(kVisitSeqTwoByteString, &VisitSeqTwoByteString); |
| 303 | 304 |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 415 | 416 |
| 416 for (; !it.done(); it.next()) { | 417 for (; !it.done(); it.next()) { |
| 417 it.rinfo()->template Visit<StaticVisitor>(heap); | 418 it.rinfo()->template Visit<StaticVisitor>(heap); |
| 418 } | 419 } |
| 419 } | 420 } |
| 420 | 421 |
| 421 | 422 |
| 422 } } // namespace v8::internal | 423 } } // namespace v8::internal |
| 423 | 424 |
| 424 #endif // V8_OBJECTS_VISITING_H_ | 425 #endif // V8_OBJECTS_VISITING_H_ |
| OLD | NEW |