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

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

Issue 14862009: Encapsulating Type information in the CompareICStub (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 7 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/stub-cache.cc ('k') | src/utils.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 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 619 matching lines...) Expand 10 before | Expand all | Expand 10 after
630 byte TypeFeedbackOracle::ToBooleanTypes(TypeFeedbackId id) { 630 byte TypeFeedbackOracle::ToBooleanTypes(TypeFeedbackId id) {
631 Handle<Object> object = GetInfo(id); 631 Handle<Object> object = GetInfo(id);
632 return object->IsCode() ? Handle<Code>::cast(object)->to_boolean_state() : 0; 632 return object->IsCode() ? Handle<Code>::cast(object)->to_boolean_state() : 0;
633 } 633 }
634 634
635 635
636 byte TypeFeedbackOracle::CompareNilTypes(TypeFeedbackId id) { 636 byte TypeFeedbackOracle::CompareNilTypes(TypeFeedbackId id) {
637 Handle<Object> object = GetInfo(id); 637 Handle<Object> object = GetInfo(id);
638 if (object->IsCode() && 638 if (object->IsCode() &&
639 Handle<Code>::cast(object)->is_compare_nil_ic_stub()) { 639 Handle<Code>::cast(object)->is_compare_nil_ic_stub()) {
640 return Handle<Code>::cast(object)->compare_nil_state(); 640 return Handle<Code>::cast(object)->compare_nil_types();
641 } else { 641 } else {
642 return CompareNilICStub::kFullCompare; 642 return CompareNilICStub::Types::FullCompare().ToIntegral();
643 } 643 }
644 } 644 }
645 645
646 646
647 // Things are a bit tricky here: The iterator for the RelocInfos and the infos 647 // Things are a bit tricky here: The iterator for the RelocInfos and the infos
648 // themselves are not GC-safe, so we first get all infos, then we create the 648 // themselves are not GC-safe, so we first get all infos, then we create the
649 // dictionary (possibly triggering GC), and finally we relocate the collected 649 // dictionary (possibly triggering GC), and finally we relocate the collected
650 // infos before we process them. 650 // infos before we process them.
651 void TypeFeedbackOracle::BuildDictionary(Handle<Code> code) { 651 void TypeFeedbackOracle::BuildDictionary(Handle<Code> code) {
652 AssertNoAllocation no_allocation; 652 AssertNoAllocation no_allocation;
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
773 USE(maybe_result); 773 USE(maybe_result);
774 #ifdef DEBUG 774 #ifdef DEBUG
775 Object* result = NULL; 775 Object* result = NULL;
776 // Dictionary has been allocated with sufficient size for all elements. 776 // Dictionary has been allocated with sufficient size for all elements.
777 ASSERT(maybe_result->ToObject(&result)); 777 ASSERT(maybe_result->ToObject(&result));
778 ASSERT(*dictionary_ == result); 778 ASSERT(*dictionary_ == result);
779 #endif 779 #endif
780 } 780 }
781 781
782 } } // namespace v8::internal 782 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/stub-cache.cc ('k') | src/utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698