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 4251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4262 | 4262 |
| 4263 if (offset == JSObject::kElementsOffset) { | 4263 if (offset == JSObject::kElementsOffset) { |
| 4264 portion = kElementsPointer; | 4264 portion = kElementsPointer; |
| 4265 } else if (offset == JSObject::kMapOffset) { | 4265 } else if (offset == JSObject::kMapOffset) { |
| 4266 portion = kMaps; | 4266 portion = kMaps; |
| 4267 } | 4267 } |
| 4268 return HObjectAccess(portion, offset, representation); | 4268 return HObjectAccess(portion, offset, representation); |
| 4269 } | 4269 } |
| 4270 | 4270 |
| 4271 | 4271 |
| 4272 HObjectAccess HObjectAccess::ForAllocationSiteOffset(int offset) { | |
|
Benedikt Meurer
2013/12/04 06:05:07
I'd prefer to have one method per allocation site
Hannes Payer (out of office)
2013/12/04 07:25:50
Breaking is intended. Michael, wdyt?
| |
| 4273 switch (offset) { | |
| 4274 case AllocationSite::kTransitionInfoOffset: | |
| 4275 return HObjectAccess(kInobject, offset, Representation::Tagged()); | |
| 4276 case AllocationSite::kNestedSiteOffset: | |
| 4277 return HObjectAccess(kInobject, offset, Representation::Tagged()); | |
| 4278 case AllocationSite::kMementoFoundCountOffset: | |
| 4279 return HObjectAccess(kInobject, offset, Representation::Smi()); | |
| 4280 case AllocationSite::kMementoCreateCountOffset: | |
| 4281 return HObjectAccess(kInobject, offset, Representation::Smi()); | |
| 4282 case AllocationSite::kPretenureDecisionOffset: | |
| 4283 return HObjectAccess(kInobject, offset, Representation::Smi()); | |
| 4284 case AllocationSite::kDependentCodeOffset: | |
| 4285 return HObjectAccess(kInobject, offset, Representation::Tagged()); | |
| 4286 case AllocationSite::kWeakNextOffset: | |
| 4287 return HObjectAccess(kInobject, offset, Representation::Tagged()); | |
| 4288 default: | |
| 4289 UNREACHABLE(); | |
| 4290 } | |
| 4291 return HObjectAccess(kInobject, offset); | |
| 4292 } | |
| 4293 | |
| 4294 | |
| 4272 HObjectAccess HObjectAccess::ForContextSlot(int index) { | 4295 HObjectAccess HObjectAccess::ForContextSlot(int index) { |
| 4273 ASSERT(index >= 0); | 4296 ASSERT(index >= 0); |
| 4274 Portion portion = kInobject; | 4297 Portion portion = kInobject; |
| 4275 int offset = Context::kHeaderSize + index * kPointerSize; | 4298 int offset = Context::kHeaderSize + index * kPointerSize; |
| 4276 ASSERT_EQ(offset, Context::SlotOffset(index) + kHeapObjectTag); | 4299 ASSERT_EQ(offset, Context::SlotOffset(index) + kHeapObjectTag); |
| 4277 return HObjectAccess(portion, offset, Representation::Tagged()); | 4300 return HObjectAccess(portion, offset, Representation::Tagged()); |
| 4278 } | 4301 } |
| 4279 | 4302 |
| 4280 | 4303 |
| 4281 HObjectAccess HObjectAccess::ForJSArrayOffset(int offset) { | 4304 HObjectAccess HObjectAccess::ForJSArrayOffset(int offset) { |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4411 break; | 4434 break; |
| 4412 case kExternalMemory: | 4435 case kExternalMemory: |
| 4413 stream->Add("[external-memory]"); | 4436 stream->Add("[external-memory]"); |
| 4414 break; | 4437 break; |
| 4415 } | 4438 } |
| 4416 | 4439 |
| 4417 stream->Add("@%d", offset()); | 4440 stream->Add("@%d", offset()); |
| 4418 } | 4441 } |
| 4419 | 4442 |
| 4420 } } // namespace v8::internal | 4443 } } // namespace v8::internal |
| OLD | NEW |