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

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

Issue 8551006: Version 3.7.9. (Closed) Base URL: http://v8.googlecode.com/svn/trunk/
Patch Set: 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 | Annotate | Revision Log
« no previous file with comments | « src/type-info.h ('k') | src/version.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 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 Handle<Object> object = GetInfo(ast_id); 412 Handle<Object> object = GetInfo(ast_id);
409 if (object->IsUndefined() || object->IsSmi()) return; 413 if (object->IsUndefined() || object->IsSmi()) return;
410 414
411 if (*object == 415 if (*object ==
412 isolate_->builtins()->builtin(Builtins::kStoreIC_GlobalProxy)) { 416 isolate_->builtins()->builtin(Builtins::kStoreIC_GlobalProxy)) {
413 // TODO(fschneider): We could collect the maps and signal that 417 // TODO(fschneider): We could collect the maps and signal that
414 // we need a generic store (or load) here. 418 // we need a generic store (or load) here.
415 ASSERT(Handle<Code>::cast(object)->ic_state() == MEGAMORPHIC); 419 ASSERT(Handle<Code>::cast(object)->ic_state() == MEGAMORPHIC);
416 } else if (object->IsMap()) { 420 } else if (object->IsMap()) {
417 types->Add(Handle<Map>::cast(object)); 421 types->Add(Handle<Map>::cast(object));
418 } else if (Handle<Code>::cast(object)->ic_state() == MEGAMORPHIC) { 422 } else if (FLAG_collect_megamorphic_maps_from_stub_cache &&
423 Handle<Code>::cast(object)->ic_state() == MEGAMORPHIC) {
419 types->Reserve(4); 424 types->Reserve(4);
420 ASSERT(object->IsCode()); 425 ASSERT(object->IsCode());
421 isolate_->stub_cache()->CollectMatchingMaps(types, *name, flags); 426 isolate_->stub_cache()->CollectMatchingMaps(types, *name, flags);
422 } 427 }
423 } 428 }
424 429
425 430
426 static void AddMapIfMissing(Handle<Map> map, SmallMapList* list) { 431 static void AddMapIfMissing(Handle<Map> map, SmallMapList* list) {
427 for (int i = 0; i < list->length(); ++i) { 432 for (int i = 0; i < list->length(); ++i) {
428 if (list->at(i).is_identical_to(map)) return; 433 if (list->at(i).is_identical_to(map)) return;
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
564 USE(maybe_result); 569 USE(maybe_result);
565 #ifdef DEBUG 570 #ifdef DEBUG
566 Object* result = NULL; 571 Object* result = NULL;
567 // Dictionary has been allocated with sufficient size for all elements. 572 // Dictionary has been allocated with sufficient size for all elements.
568 ASSERT(maybe_result->ToObject(&result)); 573 ASSERT(maybe_result->ToObject(&result));
569 ASSERT(*dictionary_ == result); 574 ASSERT(*dictionary_ == result);
570 #endif 575 #endif
571 } 576 }
572 577
573 } } // namespace v8::internal 578 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/type-info.h ('k') | src/version.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698