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 929 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
940 | 940 |
941 | 941 |
942 Handle<Code> LoadStubCompiler::CompileLoadCallback( | 942 Handle<Code> LoadStubCompiler::CompileLoadCallback( |
943 Handle<HeapType> type, | 943 Handle<HeapType> type, |
944 Handle<JSObject> holder, | 944 Handle<JSObject> holder, |
945 Handle<Name> name, | 945 Handle<Name> name, |
946 const CallOptimization& call_optimization) { | 946 const CallOptimization& call_optimization) { |
947 ASSERT(call_optimization.is_simple_api_call()); | 947 ASSERT(call_optimization.is_simple_api_call()); |
948 Handle<JSFunction> callback = call_optimization.constant_function(); | 948 Handle<JSFunction> callback = call_optimization.constant_function(); |
949 CallbackHandlerFrontend(type, receiver(), holder, name, callback); | 949 CallbackHandlerFrontend(type, receiver(), holder, name, callback); |
950 GenerateLoadCallback(call_optimization, IC::TypeToMap(*type, isolate())); | 950 Handle<Map>receiver_map = IC::TypeToMap(*type, isolate()); |
951 | 951 GenerateFastApiCall( |
| 952 masm(), call_optimization, receiver_map, |
| 953 receiver(), scratch1(), false, 0, NULL); |
952 // Return the generated code. | 954 // Return the generated code. |
953 return GetCode(kind(), Code::FAST, name); | 955 return GetCode(kind(), Code::FAST, name); |
954 } | 956 } |
955 | 957 |
956 | 958 |
957 Handle<Code> LoadStubCompiler::CompileLoadInterceptor( | 959 Handle<Code> LoadStubCompiler::CompileLoadInterceptor( |
958 Handle<HeapType> type, | 960 Handle<HeapType> type, |
959 Handle<JSObject> holder, | 961 Handle<JSObject> holder, |
960 Handle<Name> name) { | 962 Handle<Name> name) { |
961 LookupResult lookup(isolate()); | 963 LookupResult lookup(isolate()); |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1120 Handle<Name> name, | 1122 Handle<Name> name, |
1121 Handle<JSFunction> setter) { | 1123 Handle<JSFunction> setter) { |
1122 Handle<HeapType> type = IC::CurrentTypeOf(object, isolate()); | 1124 Handle<HeapType> type = IC::CurrentTypeOf(object, isolate()); |
1123 HandlerFrontend(type, receiver(), holder, name); | 1125 HandlerFrontend(type, receiver(), holder, name); |
1124 GenerateStoreViaSetter(masm(), type, setter); | 1126 GenerateStoreViaSetter(masm(), type, setter); |
1125 | 1127 |
1126 return GetCode(kind(), Code::FAST, name); | 1128 return GetCode(kind(), Code::FAST, name); |
1127 } | 1129 } |
1128 | 1130 |
1129 | 1131 |
| 1132 Handle<Code> StoreStubCompiler::CompileStoreCallback( |
| 1133 Handle<JSObject> object, |
| 1134 Handle<JSObject> holder, |
| 1135 Handle<Name> name, |
| 1136 const CallOptimization& call_optimization) { |
| 1137 HandlerFrontend(IC::CurrentTypeOf(object, isolate()), |
| 1138 receiver(), holder, name); |
| 1139 Register values[] = { value() }; |
| 1140 GenerateFastApiCall( |
| 1141 masm(), call_optimization, handle(object->map()), |
| 1142 receiver(), scratch1(), true, 1, values); |
| 1143 // Return the generated code. |
| 1144 return GetCode(kind(), Code::FAST, name); |
| 1145 } |
| 1146 |
| 1147 |
1130 Handle<Code> KeyedLoadStubCompiler::CompileLoadElement( | 1148 Handle<Code> KeyedLoadStubCompiler::CompileLoadElement( |
1131 Handle<Map> receiver_map) { | 1149 Handle<Map> receiver_map) { |
1132 ElementsKind elements_kind = receiver_map->elements_kind(); | 1150 ElementsKind elements_kind = receiver_map->elements_kind(); |
1133 if (receiver_map->has_fast_elements() || | 1151 if (receiver_map->has_fast_elements() || |
1134 receiver_map->has_external_array_elements() || | 1152 receiver_map->has_external_array_elements() || |
1135 receiver_map->has_fixed_typed_array_elements()) { | 1153 receiver_map->has_fixed_typed_array_elements()) { |
1136 Handle<Code> stub = KeyedLoadFastElementStub( | 1154 Handle<Code> stub = KeyedLoadFastElementStub( |
1137 receiver_map->instance_type() == JS_ARRAY_TYPE, | 1155 receiver_map->instance_type() == JS_ARRAY_TYPE, |
1138 elements_kind).GetCode(isolate()); | 1156 elements_kind).GetCode(isolate()); |
1139 __ DispatchMap(receiver(), scratch1(), receiver_map, stub, DO_SMI_CHECK); | 1157 __ DispatchMap(receiver(), scratch1(), receiver_map, stub, DO_SMI_CHECK); |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1442 Handle<FunctionTemplateInfo>( | 1460 Handle<FunctionTemplateInfo>( |
1443 FunctionTemplateInfo::cast(signature->receiver())); | 1461 FunctionTemplateInfo::cast(signature->receiver())); |
1444 } | 1462 } |
1445 } | 1463 } |
1446 | 1464 |
1447 is_simple_api_call_ = true; | 1465 is_simple_api_call_ = true; |
1448 } | 1466 } |
1449 | 1467 |
1450 | 1468 |
1451 } } // namespace v8::internal | 1469 } } // namespace v8::internal |
OLD | NEW |