OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |