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 4249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4260 Handle<Map> receiver_map = | 4260 Handle<Map> receiver_map = |
4261 (types == NULL) ? Handle<Map>::null() : types->first(); | 4261 (types == NULL) ? Handle<Map>::null() : types->first(); |
4262 if (TryInlineBuiltinFunction(expr, | 4262 if (TryInlineBuiltinFunction(expr, |
4263 receiver, | 4263 receiver, |
4264 receiver_map, | 4264 receiver_map, |
4265 expr->check_type())) { | 4265 expr->check_type())) { |
4266 return; | 4266 return; |
4267 } | 4267 } |
4268 | 4268 |
4269 if (HasCustomCallGenerator(expr->target()) || | 4269 if (HasCustomCallGenerator(expr->target()) || |
| 4270 CallOptimization(*expr->target()).is_simple_api_call() || |
4270 expr->check_type() != RECEIVER_MAP_CHECK) { | 4271 expr->check_type() != RECEIVER_MAP_CHECK) { |
4271 // When the target has a custom call IC generator, use the IC, | 4272 // When the target has a custom call IC generator, use the IC, |
4272 // because it is likely to generate better code. Also use the | 4273 // because it is likely to generate better code. Similarly, we |
4273 // IC when a primitive receiver check is required. | 4274 // generate better call stubs for some API functions. |
| 4275 // Also use the IC when a primitive receiver check is required. |
4274 HContext* context = new HContext; | 4276 HContext* context = new HContext; |
4275 AddInstruction(context); | 4277 AddInstruction(context); |
4276 call = PreProcessCall(new HCallNamed(context, name, argument_count)); | 4278 call = PreProcessCall(new HCallNamed(context, name, argument_count)); |
4277 } else { | 4279 } else { |
4278 AddCheckConstantFunction(expr, receiver, receiver_map, true); | 4280 AddCheckConstantFunction(expr, receiver, receiver_map, true); |
4279 | 4281 |
4280 if (TryInline(expr)) { | 4282 if (TryInline(expr)) { |
4281 return; | 4283 return; |
4282 } else { | 4284 } else { |
4283 // Check for bailout, as the TryInline call in the if condition above | 4285 // Check for bailout, as the TryInline call in the if condition above |
(...skipping 1620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5904 } | 5906 } |
5905 } | 5907 } |
5906 | 5908 |
5907 #ifdef DEBUG | 5909 #ifdef DEBUG |
5908 if (graph_ != NULL) graph_->Verify(); | 5910 if (graph_ != NULL) graph_->Verify(); |
5909 if (allocator_ != NULL) allocator_->Verify(); | 5911 if (allocator_ != NULL) allocator_->Verify(); |
5910 #endif | 5912 #endif |
5911 } | 5913 } |
5912 | 5914 |
5913 } } // namespace v8::internal | 5915 } } // namespace v8::internal |
OLD | NEW |