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

Side by Side Diff: src/type-info.cc

Issue 8373029: [hydrogen] optimize switch with string clauses (Closed) Base URL: gh:v8/v8@master
Patch Set: fix lint errors, improved test Created 9 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
« no previous file with comments | « src/type-info.h ('k') | src/x64/lithium-codegen-x64.h » ('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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 if (!code->is_compare_ic_stub()) return unknown; 353 if (!code->is_compare_ic_stub()) return unknown;
354 354
355 CompareIC::State state = static_cast<CompareIC::State>(code->compare_state()); 355 CompareIC::State state = static_cast<CompareIC::State>(code->compare_state());
356 switch (state) { 356 switch (state) {
357 case CompareIC::UNINITIALIZED: 357 case CompareIC::UNINITIALIZED:
358 // Uninitialized means never executed. 358 // Uninitialized means never executed.
359 // TODO(fschneider): Introduce a separate value for never-executed ICs. 359 // TODO(fschneider): Introduce a separate value for never-executed ICs.
360 return unknown; 360 return unknown;
361 case CompareIC::SMIS: 361 case CompareIC::SMIS:
362 return TypeInfo::Smi(); 362 return TypeInfo::Smi();
363 case CompareIC::STRINGS:
364 return TypeInfo::String();
365 case CompareIC::SYMBOLS:
366 return TypeInfo::Symbol();
363 case CompareIC::HEAP_NUMBERS: 367 case CompareIC::HEAP_NUMBERS:
364 return TypeInfo::Number(); 368 return TypeInfo::Number();
365 case CompareIC::OBJECTS: 369 case CompareIC::OBJECTS:
366 // TODO(kasperl): We really need a type for JS objects here. 370 // TODO(kasperl): We really need a type for JS objects here.
367 return TypeInfo::NonPrimitive(); 371 return TypeInfo::NonPrimitive();
368 case CompareIC::GENERIC: 372 case CompareIC::GENERIC:
369 default: 373 default:
370 return unknown; 374 return unknown;
371 } 375 }
372 } 376 }
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
564 USE(maybe_result); 568 USE(maybe_result);
565 #ifdef DEBUG 569 #ifdef DEBUG
566 Object* result = NULL; 570 Object* result = NULL;
567 // Dictionary has been allocated with sufficient size for all elements. 571 // Dictionary has been allocated with sufficient size for all elements.
568 ASSERT(maybe_result->ToObject(&result)); 572 ASSERT(maybe_result->ToObject(&result));
569 ASSERT(*dictionary_ == result); 573 ASSERT(*dictionary_ == result);
570 #endif 574 #endif
571 } 575 }
572 576
573 } } // namespace v8::internal 577 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/type-info.h ('k') | src/x64/lithium-codegen-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698