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

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

Issue 19749004: With >= 64 non-string instance types, I removed an optimization (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Review comments Created 7 years, 5 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/objects.h ('k') | src/x64/code-stubs-x64.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 // 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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 bool Object::IsSpecFunction() { 214 bool Object::IsSpecFunction() {
215 if (!Object::IsHeapObject()) return false; 215 if (!Object::IsHeapObject()) return false;
216 InstanceType type = HeapObject::cast(this)->map()->instance_type(); 216 InstanceType type = HeapObject::cast(this)->map()->instance_type();
217 return type == JS_FUNCTION_TYPE || type == JS_FUNCTION_PROXY_TYPE; 217 return type == JS_FUNCTION_TYPE || type == JS_FUNCTION_PROXY_TYPE;
218 } 218 }
219 219
220 220
221 bool Object::IsInternalizedString() { 221 bool Object::IsInternalizedString() {
222 if (!this->IsHeapObject()) return false; 222 if (!this->IsHeapObject()) return false;
223 uint32_t type = HeapObject::cast(this)->map()->instance_type(); 223 uint32_t type = HeapObject::cast(this)->map()->instance_type();
224 STATIC_ASSERT(kInternalizedTag != 0); 224 STATIC_ASSERT(kNotInternalizedTag != 0);
225 return (type & (kIsNotStringMask | kIsInternalizedMask)) == 225 return (type & (kIsNotStringMask | kIsNotInternalizedMask)) ==
226 (kInternalizedTag | kStringTag); 226 (kStringTag | kInternalizedTag);
227 } 227 }
228 228
229 229
230 bool Object::IsConsString() { 230 bool Object::IsConsString() {
231 if (!IsString()) return false; 231 if (!IsString()) return false;
232 return StringShape(String::cast(this)).IsCons(); 232 return StringShape(String::cast(this)).IsCons();
233 } 233 }
234 234
235 235
236 bool Object::IsSlicedString() { 236 bool Object::IsSlicedString() {
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 312
313 StringShape::StringShape(InstanceType t) 313 StringShape::StringShape(InstanceType t)
314 : type_(static_cast<uint32_t>(t)) { 314 : type_(static_cast<uint32_t>(t)) {
315 set_valid(); 315 set_valid();
316 ASSERT((type_ & kIsNotStringMask) == kStringTag); 316 ASSERT((type_ & kIsNotStringMask) == kStringTag);
317 } 317 }
318 318
319 319
320 bool StringShape::IsInternalized() { 320 bool StringShape::IsInternalized() {
321 ASSERT(valid()); 321 ASSERT(valid());
322 STATIC_ASSERT(kInternalizedTag != 0); 322 STATIC_ASSERT(kNotInternalizedTag != 0);
323 return (type_ & (kIsNotStringMask | kIsInternalizedMask)) == 323 return (type_ & (kIsNotStringMask | kIsNotInternalizedMask)) ==
324 (kInternalizedTag | kStringTag); 324 (kStringTag | kInternalizedTag);
325 } 325 }
326 326
327 327
328 bool String::IsOneByteRepresentation() { 328 bool String::IsOneByteRepresentation() {
329 uint32_t type = map()->instance_type(); 329 uint32_t type = map()->instance_type();
330 return (type & kStringEncodingMask) == kOneByteStringTag; 330 return (type & kStringEncodingMask) == kOneByteStringTag;
331 } 331 }
332 332
333 333
334 bool String::IsTwoByteRepresentation() { 334 bool String::IsTwoByteRepresentation() {
(...skipping 5850 matching lines...) Expand 10 before | Expand all | Expand 10 after
6185 #undef WRITE_UINT32_FIELD 6185 #undef WRITE_UINT32_FIELD
6186 #undef READ_SHORT_FIELD 6186 #undef READ_SHORT_FIELD
6187 #undef WRITE_SHORT_FIELD 6187 #undef WRITE_SHORT_FIELD
6188 #undef READ_BYTE_FIELD 6188 #undef READ_BYTE_FIELD
6189 #undef WRITE_BYTE_FIELD 6189 #undef WRITE_BYTE_FIELD
6190 6190
6191 6191
6192 } } // namespace v8::internal 6192 } } // namespace v8::internal
6193 6193
6194 #endif // V8_OBJECTS_INL_H_ 6194 #endif // V8_OBJECTS_INL_H_
OLDNEW
« no previous file with comments | « src/objects.h ('k') | src/x64/code-stubs-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698