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

Side by Side Diff: src/objects-inl.h

Issue 6759030: Microoptimizations to the way we get the current heap. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 years, 8 months 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
« src/objects.cc ('K') | « src/objects.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 2844 matching lines...) Expand 10 before | Expand all | Expand 10 after
2855 2855
2856 Heap* Map::heap() { 2856 Heap* Map::heap() {
2857 // NOTE: address() helper is not used to save one instruction. 2857 // NOTE: address() helper is not used to save one instruction.
2858 Heap* heap = Page::FromAddress(reinterpret_cast<Address>(this))->heap_; 2858 Heap* heap = Page::FromAddress(reinterpret_cast<Address>(this))->heap_;
2859 ASSERT(heap != NULL); 2859 ASSERT(heap != NULL);
2860 ASSERT(heap->isolate() == Isolate::Current()); 2860 ASSERT(heap->isolate() == Isolate::Current());
2861 return heap; 2861 return heap;
2862 } 2862 }
2863 2863
2864 2864
2865 Heap* Code::heap() {
2866 // NOTE: address() helper is not used to save one instruction.
2867 Heap* heap = Page::FromAddress(reinterpret_cast<Address>(this))->heap_;
2868 ASSERT(heap != NULL);
2869 ASSERT(heap->isolate() == Isolate::Current());
2870 return heap;
2871 }
2872
2873
2874 Isolate* Code::isolate() {
2875 return heap()->isolate();
2876 }
2877
2878
2879 Heap* JSGlobalPropertyCell::heap() {
2880 // NOTE: address() helper is not used to save one instruction.
2881 Heap* heap = Page::FromAddress(reinterpret_cast<Address>(this))->heap_;
2882 ASSERT(heap != NULL);
2883 ASSERT(heap->isolate() == Isolate::Current());
2884 return heap;
2885 }
2886
2887
2888 Isolate* JSGlobalPropertyCell::isolate() {
2889 return heap()->isolate();
2890 }
2891
2892
2865 Object* Code::GetObjectFromEntryAddress(Address location_of_address) { 2893 Object* Code::GetObjectFromEntryAddress(Address location_of_address) {
2866 return HeapObject:: 2894 return HeapObject::
2867 FromAddress(Memory::Address_at(location_of_address) - Code::kHeaderSize); 2895 FromAddress(Memory::Address_at(location_of_address) - Code::kHeaderSize);
2868 } 2896 }
2869 2897
2870 2898
2871 Object* Map::prototype() { 2899 Object* Map::prototype() {
2872 return READ_FIELD(this, kPrototypeOffset); 2900 return READ_FIELD(this, kPrototypeOffset);
2873 } 2901 }
2874 2902
(...skipping 1258 matching lines...) Expand 10 before | Expand all | Expand 10 after
4133 #undef WRITE_INT_FIELD 4161 #undef WRITE_INT_FIELD
4134 #undef READ_SHORT_FIELD 4162 #undef READ_SHORT_FIELD
4135 #undef WRITE_SHORT_FIELD 4163 #undef WRITE_SHORT_FIELD
4136 #undef READ_BYTE_FIELD 4164 #undef READ_BYTE_FIELD
4137 #undef WRITE_BYTE_FIELD 4165 #undef WRITE_BYTE_FIELD
4138 4166
4139 4167
4140 } } // namespace v8::internal 4168 } } // namespace v8::internal
4141 4169
4142 #endif // V8_OBJECTS_INL_H_ 4170 #endif // V8_OBJECTS_INL_H_
OLDNEW
« src/objects.cc ('K') | « src/objects.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698