Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(141)

Side by Side Diff: src/hydrogen-instructions.cc

Issue 696783005: harmony-scoping: Implement LoadIC handler for loads from global contexts. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Finished/rebased Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/hydrogen-instructions.h ('k') | src/ic/ic.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 4623 matching lines...) Expand 10 before | Expand all | Expand 10 after
4634 4634
4635 HObjectAccess HObjectAccess::ForContextSlot(int index) { 4635 HObjectAccess HObjectAccess::ForContextSlot(int index) {
4636 DCHECK(index >= 0); 4636 DCHECK(index >= 0);
4637 Portion portion = kInobject; 4637 Portion portion = kInobject;
4638 int offset = Context::kHeaderSize + index * kPointerSize; 4638 int offset = Context::kHeaderSize + index * kPointerSize;
4639 DCHECK_EQ(offset, Context::SlotOffset(index) + kHeapObjectTag); 4639 DCHECK_EQ(offset, Context::SlotOffset(index) + kHeapObjectTag);
4640 return HObjectAccess(portion, offset, Representation::Tagged()); 4640 return HObjectAccess(portion, offset, Representation::Tagged());
4641 } 4641 }
4642 4642
4643 4643
4644 HObjectAccess HObjectAccess::ForGlobalContext(int index) {
4645 DCHECK(index >= 0);
4646 Portion portion = kInobject;
4647 int offset = GlobalContextTable::kHeaderSize + (index + 1) * kPointerSize;
adamk 2014/11/07 16:57:03 Here's that "+ 1" again. Now that it's leaking out
4648 return HObjectAccess(portion, offset, Representation::Tagged());
4649 }
4650
4651
4644 HObjectAccess HObjectAccess::ForJSArrayOffset(int offset) { 4652 HObjectAccess HObjectAccess::ForJSArrayOffset(int offset) {
4645 DCHECK(offset >= 0); 4653 DCHECK(offset >= 0);
4646 Portion portion = kInobject; 4654 Portion portion = kInobject;
4647 4655
4648 if (offset == JSObject::kElementsOffset) { 4656 if (offset == JSObject::kElementsOffset) {
4649 portion = kElementsPointer; 4657 portion = kElementsPointer;
4650 } else if (offset == JSArray::kLengthOffset) { 4658 } else if (offset == JSArray::kLengthOffset) {
4651 portion = kArrayLengths; 4659 portion = kArrayLengths;
4652 } else if (offset == JSObject::kMapOffset) { 4660 } else if (offset == JSObject::kMapOffset) {
4653 portion = kMaps; 4661 portion = kMaps;
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
4789 break; 4797 break;
4790 case HObjectAccess::kExternalMemory: 4798 case HObjectAccess::kExternalMemory:
4791 os << "[external-memory]"; 4799 os << "[external-memory]";
4792 break; 4800 break;
4793 } 4801 }
4794 4802
4795 return os << "@" << access.offset(); 4803 return os << "@" << access.offset();
4796 } 4804 }
4797 4805
4798 } } // namespace v8::internal 4806 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/hydrogen-instructions.h ('k') | src/ic/ic.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698