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

Side by Side Diff: test/cctest/test-types.cc

Issue 186743002: Types: cache lub bitset to avoid heap access (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Comment Created 6 years, 9 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
« no previous file with comments | « src/types.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 static bool IsConstant(Type* t) { return IsTagged(t, 1); } 183 static bool IsConstant(Type* t) { return IsTagged(t, 1); }
184 static bool IsUnion(Type* t) { return IsTagged(t, 2); } 184 static bool IsUnion(Type* t) { return IsTagged(t, 2); }
185 185
186 static ZoneList<void*>* AsTagged(Type* t) { 186 static ZoneList<void*>* AsTagged(Type* t) {
187 return reinterpret_cast<ZoneList<void*>*>(t); 187 return reinterpret_cast<ZoneList<void*>*>(t);
188 } 188 }
189 static int AsBitset(Type* t) { 189 static int AsBitset(Type* t) {
190 return static_cast<int>(reinterpret_cast<intptr_t>(t) >> 1); 190 return static_cast<int>(reinterpret_cast<intptr_t>(t) >> 1);
191 } 191 }
192 static Map* AsClass(Type* t) { 192 static Map* AsClass(Type* t) {
193 return *reinterpret_cast<Map**>(AsTagged(t)->at(1)); 193 return *reinterpret_cast<Map**>(AsTagged(t)->at(2));
194 } 194 }
195 static Object* AsConstant(Type* t) { 195 static Object* AsConstant(Type* t) {
196 return *reinterpret_cast<Object**>(AsTagged(t)->at(1)); 196 return *reinterpret_cast<Object**>(AsTagged(t)->at(2));
197 } 197 }
198 static ZoneList<Type*>* AsUnion(Type* t) { 198 static ZoneList<Type*>* AsUnion(Type* t) {
199 return reinterpret_cast<ZoneList<Type*>*>(AsTagged(t)); 199 return reinterpret_cast<ZoneList<Type*>*>(AsTagged(t));
200 } 200 }
201 201
202 static Zone* ToRegion(Zone* zone, Isolate* isolate) { return zone; } 202 static Zone* ToRegion(Zone* zone, Isolate* isolate) { return zone; }
203 }; 203 };
204 204
205 205
206 struct HeapRep { 206 struct HeapRep {
(...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after
868 ZoneTests().Intersect(); 868 ZoneTests().Intersect();
869 HeapTests().Intersect(); 869 HeapTests().Intersect();
870 } 870 }
871 871
872 872
873 TEST(Convert) { 873 TEST(Convert) {
874 CcTest::InitializeVM(); 874 CcTest::InitializeVM();
875 ZoneTests().Convert<HeapType, Handle<HeapType>, Isolate, HeapRep>(); 875 ZoneTests().Convert<HeapType, Handle<HeapType>, Isolate, HeapRep>();
876 HeapTests().Convert<Type, Type*, Zone, ZoneRep>(); 876 HeapTests().Convert<Type, Type*, Zone, ZoneRep>();
877 } 877 }
OLDNEW
« no previous file with comments | « src/types.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698