| 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/base/bits.h" | 7 #include "src/base/bits.h" |
| 8 #include "src/double.h" | 8 #include "src/double.h" |
| 9 #include "src/factory.h" | 9 #include "src/factory.h" |
| 10 #include "src/hydrogen-infer-representation.h" | 10 #include "src/hydrogen-infer-representation.h" |
| (...skipping 4627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4638 | 4638 |
| 4639 HObjectAccess HObjectAccess::ForContextSlot(int index) { | 4639 HObjectAccess HObjectAccess::ForContextSlot(int index) { |
| 4640 DCHECK(index >= 0); | 4640 DCHECK(index >= 0); |
| 4641 Portion portion = kInobject; | 4641 Portion portion = kInobject; |
| 4642 int offset = Context::kHeaderSize + index * kPointerSize; | 4642 int offset = Context::kHeaderSize + index * kPointerSize; |
| 4643 DCHECK_EQ(offset, Context::SlotOffset(index) + kHeapObjectTag); | 4643 DCHECK_EQ(offset, Context::SlotOffset(index) + kHeapObjectTag); |
| 4644 return HObjectAccess(portion, offset, Representation::Tagged()); | 4644 return HObjectAccess(portion, offset, Representation::Tagged()); |
| 4645 } | 4645 } |
| 4646 | 4646 |
| 4647 | 4647 |
| 4648 HObjectAccess HObjectAccess::ForGlobalContext(int index) { | 4648 HObjectAccess HObjectAccess::ForScriptContext(int index) { |
| 4649 DCHECK(index >= 0); | 4649 DCHECK(index >= 0); |
| 4650 Portion portion = kInobject; | 4650 Portion portion = kInobject; |
| 4651 int offset = GlobalContextTable::GetContextOffset(index); | 4651 int offset = ScriptContextTable::GetContextOffset(index); |
| 4652 return HObjectAccess(portion, offset, Representation::Tagged()); | 4652 return HObjectAccess(portion, offset, Representation::Tagged()); |
| 4653 } | 4653 } |
| 4654 | 4654 |
| 4655 | 4655 |
| 4656 HObjectAccess HObjectAccess::ForJSArrayOffset(int offset) { | 4656 HObjectAccess HObjectAccess::ForJSArrayOffset(int offset) { |
| 4657 DCHECK(offset >= 0); | 4657 DCHECK(offset >= 0); |
| 4658 Portion portion = kInobject; | 4658 Portion portion = kInobject; |
| 4659 | 4659 |
| 4660 if (offset == JSObject::kElementsOffset) { | 4660 if (offset == JSObject::kElementsOffset) { |
| 4661 portion = kElementsPointer; | 4661 portion = kElementsPointer; |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4801 break; | 4801 break; |
| 4802 case HObjectAccess::kExternalMemory: | 4802 case HObjectAccess::kExternalMemory: |
| 4803 os << "[external-memory]"; | 4803 os << "[external-memory]"; |
| 4804 break; | 4804 break; |
| 4805 } | 4805 } |
| 4806 | 4806 |
| 4807 return os << "@" << access.offset(); | 4807 return os << "@" << access.offset(); |
| 4808 } | 4808 } |
| 4809 | 4809 |
| 4810 } } // namespace v8::internal | 4810 } } // namespace v8::internal |
| OLD | NEW |