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 3984 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3995 | 3995 |
3996 if (offset == JSObject::kElementsOffset) { | 3996 if (offset == JSObject::kElementsOffset) { |
3997 portion = kElementsPointer; | 3997 portion = kElementsPointer; |
3998 } else if (offset == JSObject::kMapOffset) { | 3998 } else if (offset == JSObject::kMapOffset) { |
3999 portion = kMaps; | 3999 portion = kMaps; |
4000 } | 4000 } |
4001 return HObjectAccess(portion, offset, representation); | 4001 return HObjectAccess(portion, offset, representation); |
4002 } | 4002 } |
4003 | 4003 |
4004 | 4004 |
| 4005 HObjectAccess HObjectAccess::ForContextSlot(int index) { |
| 4006 ASSERT(index >= 0); |
| 4007 Portion portion = kInobject; |
| 4008 // Context::SlotOffset(index) |
| 4009 int offset = Context::kHeaderSize + index * kPointerSize; |
| 4010 return HObjectAccess(portion, offset, Representation::Tagged()); |
| 4011 } |
| 4012 |
| 4013 |
4005 HObjectAccess HObjectAccess::ForJSArrayOffset(int offset) { | 4014 HObjectAccess HObjectAccess::ForJSArrayOffset(int offset) { |
4006 ASSERT(offset >= 0); | 4015 ASSERT(offset >= 0); |
4007 Portion portion = kInobject; | 4016 Portion portion = kInobject; |
4008 | 4017 |
4009 if (offset == JSObject::kElementsOffset) { | 4018 if (offset == JSObject::kElementsOffset) { |
4010 portion = kElementsPointer; | 4019 portion = kElementsPointer; |
4011 } else if (offset == JSArray::kLengthOffset) { | 4020 } else if (offset == JSArray::kLengthOffset) { |
4012 portion = kArrayLengths; | 4021 portion = kArrayLengths; |
4013 } else if (offset == JSObject::kMapOffset) { | 4022 } else if (offset == JSObject::kMapOffset) { |
4014 portion = kMaps; | 4023 portion = kMaps; |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4135 break; | 4144 break; |
4136 case kExternalMemory: | 4145 case kExternalMemory: |
4137 stream->Add("[external-memory]"); | 4146 stream->Add("[external-memory]"); |
4138 break; | 4147 break; |
4139 } | 4148 } |
4140 | 4149 |
4141 stream->Add("@%d", offset()); | 4150 stream->Add("@%d", offset()); |
4142 } | 4151 } |
4143 | 4152 |
4144 } } // namespace v8::internal | 4153 } } // namespace v8::internal |
OLD | NEW |