OLD | NEW |
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 3777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3788 Handle<Map> receiver_map, | 3788 Handle<Map> receiver_map, |
3789 bool smi_and_map_check) { | 3789 bool smi_and_map_check) { |
3790 // Constant functions have the nice property that the map will change if they | 3790 // Constant functions have the nice property that the map will change if they |
3791 // are overwritten. Therefore it is enough to check the map of the holder and | 3791 // are overwritten. Therefore it is enough to check the map of the holder and |
3792 // its prototypes. | 3792 // its prototypes. |
3793 if (smi_and_map_check) { | 3793 if (smi_and_map_check) { |
3794 AddInstruction(new HCheckNonSmi(receiver)); | 3794 AddInstruction(new HCheckNonSmi(receiver)); |
3795 AddInstruction(new HCheckMap(receiver, receiver_map)); | 3795 AddInstruction(new HCheckMap(receiver, receiver_map)); |
3796 } | 3796 } |
3797 if (!expr->holder().is_null()) { | 3797 if (!expr->holder().is_null()) { |
3798 AddInstruction(new HCheckPrototypeMaps(receiver, | 3798 AddInstruction(new HCheckPrototypeMaps( |
3799 expr->holder(), | 3799 Handle<JSObject>(JSObject::cast(receiver_map->prototype())), |
3800 receiver_map)); | 3800 expr->holder())); |
3801 } | 3801 } |
3802 } | 3802 } |
3803 | 3803 |
3804 | 3804 |
3805 void HGraphBuilder::HandlePolymorphicCallNamed(Call* expr, | 3805 void HGraphBuilder::HandlePolymorphicCallNamed(Call* expr, |
3806 HValue* receiver, | 3806 HValue* receiver, |
3807 ZoneMapList* types, | 3807 ZoneMapList* types, |
3808 Handle<String> name) { | 3808 Handle<String> name) { |
3809 int argument_count = expr->arguments()->length() + 1; // Plus receiver. | 3809 int argument_count = expr->arguments()->length() + 1; // Plus receiver. |
3810 int number_of_types = Min(types->length(), kMaxCallPolymorphism); | 3810 int number_of_types = Min(types->length(), kMaxCallPolymorphism); |
(...skipping 1975 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5786 } | 5786 } |
5787 } | 5787 } |
5788 | 5788 |
5789 #ifdef DEBUG | 5789 #ifdef DEBUG |
5790 if (graph_ != NULL) graph_->Verify(); | 5790 if (graph_ != NULL) graph_->Verify(); |
5791 if (allocator_ != NULL) allocator_->Verify(); | 5791 if (allocator_ != NULL) allocator_->Verify(); |
5792 #endif | 5792 #endif |
5793 } | 5793 } |
5794 | 5794 |
5795 } } // namespace v8::internal | 5795 } } // namespace v8::internal |
OLD | NEW |