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

Side by Side Diff: src/ic.cc

Issue 227473002: Use distinct maps for oddballs with special handling in the type system. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Put kInternal last. Created 6 years, 8 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/heap.cc ('k') | src/objects-debug.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 674 matching lines...) Expand 10 before | Expand all | Expand 10 after
685 Handle<HeapType> IC::CurrentTypeOf(Handle<Object> object, Isolate* isolate) { 685 Handle<HeapType> IC::CurrentTypeOf(Handle<Object> object, Isolate* isolate) {
686 return object->IsJSGlobalObject() 686 return object->IsJSGlobalObject()
687 ? HeapType::Constant(Handle<JSGlobalObject>::cast(object), isolate) 687 ? HeapType::Constant(Handle<JSGlobalObject>::cast(object), isolate)
688 : HeapType::NowOf(object, isolate); 688 : HeapType::NowOf(object, isolate);
689 } 689 }
690 690
691 691
692 Handle<Map> IC::TypeToMap(HeapType* type, Isolate* isolate) { 692 Handle<Map> IC::TypeToMap(HeapType* type, Isolate* isolate) {
693 if (type->Is(HeapType::Number())) 693 if (type->Is(HeapType::Number()))
694 return isolate->factory()->heap_number_map(); 694 return isolate->factory()->heap_number_map();
695 if (type->Is(HeapType::Boolean())) return isolate->factory()->oddball_map(); 695 if (type->Is(HeapType::Boolean())) return isolate->factory()->boolean_map();
696 if (type->IsConstant()) { 696 if (type->IsConstant()) {
697 return handle(Handle<JSGlobalObject>::cast(type->AsConstant())->map()); 697 return handle(Handle<JSGlobalObject>::cast(type->AsConstant())->map());
698 } 698 }
699 ASSERT(type->IsClass()); 699 ASSERT(type->IsClass());
700 return type->AsClass(); 700 return type->AsClass();
701 } 701 }
702 702
703 703
704 template <class T> 704 template <class T>
705 typename T::TypeHandle IC::MapToType(Handle<Map> map, 705 typename T::TypeHandle IC::MapToType(Handle<Map> map,
(...skipping 2131 matching lines...) Expand 10 before | Expand all | Expand 10 after
2837 #undef ADDR 2837 #undef ADDR
2838 }; 2838 };
2839 2839
2840 2840
2841 Address IC::AddressFromUtilityId(IC::UtilityId id) { 2841 Address IC::AddressFromUtilityId(IC::UtilityId id) {
2842 return IC_utilities[id]; 2842 return IC_utilities[id];
2843 } 2843 }
2844 2844
2845 2845
2846 } } // namespace v8::internal 2846 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap.cc ('k') | src/objects-debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698