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 1014 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1025 CallOptimization call_optimization(function); | 1025 CallOptimization call_optimization(function); |
1026 if (call_optimization.is_simple_api_call() && | 1026 if (call_optimization.is_simple_api_call() && |
1027 call_optimization.IsCompatibleReceiver(object, holder)) { | 1027 call_optimization.IsCompatibleReceiver(object, holder)) { |
1028 return compiler.CompileLoadCallback( | 1028 return compiler.CompileLoadCallback( |
1029 type, holder, name, call_optimization); | 1029 type, holder, name, call_optimization); |
1030 } | 1030 } |
1031 return compiler.CompileLoadViaGetter(type, holder, name, function); | 1031 return compiler.CompileLoadViaGetter(type, holder, name, function); |
1032 } | 1032 } |
1033 // TODO(dcarney): Handle correctly. | 1033 // TODO(dcarney): Handle correctly. |
1034 if (callback->IsDeclaredAccessorInfo()) break; | 1034 if (callback->IsDeclaredAccessorInfo()) break; |
1035 ASSERT(callback->IsForeign()); | 1035 UNREACHABLE(); |
Yang
2014/04/29 10:43:12
We could also just ASSERT(callback->IsDeclaredAcce
| |
1036 // No IC support for old-style native accessors. | |
1037 break; | 1036 break; |
1038 } | 1037 } |
1039 case INTERCEPTOR: | 1038 case INTERCEPTOR: |
1040 ASSERT(HasInterceptorGetter(*holder)); | 1039 ASSERT(HasInterceptorGetter(*holder)); |
1041 return compiler.CompileLoadInterceptor(type, holder, name); | 1040 return compiler.CompileLoadInterceptor(type, holder, name); |
1042 default: | 1041 default: |
1043 break; | 1042 break; |
1044 } | 1043 } |
1045 | 1044 |
1046 return slow_stub(); | 1045 return slow_stub(); |
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1450 if (call_optimization.is_simple_api_call() && | 1449 if (call_optimization.is_simple_api_call() && |
1451 call_optimization.IsCompatibleReceiver(receiver, holder)) { | 1450 call_optimization.IsCompatibleReceiver(receiver, holder)) { |
1452 return compiler.CompileStoreCallback( | 1451 return compiler.CompileStoreCallback( |
1453 receiver, holder, name, call_optimization); | 1452 receiver, holder, name, call_optimization); |
1454 } | 1453 } |
1455 return compiler.CompileStoreViaSetter( | 1454 return compiler.CompileStoreViaSetter( |
1456 receiver, holder, name, Handle<JSFunction>::cast(setter)); | 1455 receiver, holder, name, Handle<JSFunction>::cast(setter)); |
1457 } | 1456 } |
1458 // TODO(dcarney): Handle correctly. | 1457 // TODO(dcarney): Handle correctly. |
1459 if (callback->IsDeclaredAccessorInfo()) break; | 1458 if (callback->IsDeclaredAccessorInfo()) break; |
1460 ASSERT(callback->IsForeign()); | 1459 UNREACHABLE(); |
Yang
2014/04/29 10:43:12
Ditto.
| |
1461 | |
1462 // Use specialized code for setting the length of arrays with fast | |
1463 // properties. Slow properties might indicate redefinition of the length | |
1464 // property. | |
1465 if (receiver->IsJSArray() && | |
1466 String::Equals(isolate()->factory()->length_string(), name) && | |
1467 Handle<JSArray>::cast(receiver)->AllowsSetElementsLength() && | |
1468 receiver->HasFastProperties()) { | |
1469 return compiler.CompileStoreArrayLength(receiver, lookup, name); | |
1470 } | |
1471 | |
1472 // No IC support for old-style native accessors. | |
1473 break; | 1460 break; |
1474 } | 1461 } |
1475 case INTERCEPTOR: | 1462 case INTERCEPTOR: |
1476 if (kind() == Code::KEYED_STORE_IC) break; | 1463 if (kind() == Code::KEYED_STORE_IC) break; |
1477 ASSERT(HasInterceptorSetter(*holder)); | 1464 ASSERT(HasInterceptorSetter(*holder)); |
1478 return compiler.CompileStoreInterceptor(receiver, name); | 1465 return compiler.CompileStoreInterceptor(receiver, name); |
1479 case CONSTANT: | 1466 case CONSTANT: |
1480 break; | 1467 break; |
1481 case NONEXISTENT: | 1468 case NONEXISTENT: |
1482 case HANDLER: | 1469 case HANDLER: |
(...skipping 1464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2947 #undef ADDR | 2934 #undef ADDR |
2948 }; | 2935 }; |
2949 | 2936 |
2950 | 2937 |
2951 Address IC::AddressFromUtilityId(IC::UtilityId id) { | 2938 Address IC::AddressFromUtilityId(IC::UtilityId id) { |
2952 return IC_utilities[id]; | 2939 return IC_utilities[id]; |
2953 } | 2940 } |
2954 | 2941 |
2955 | 2942 |
2956 } } // namespace v8::internal | 2943 } } // namespace v8::internal |
OLD | NEW |