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 1173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1184 } | 1184 } |
1185 } | 1185 } |
1186 | 1186 |
1187 | 1187 |
1188 Register BaseLoadStubCompiler::CallbackHandlerFrontend( | 1188 Register BaseLoadStubCompiler::CallbackHandlerFrontend( |
1189 Handle<JSObject> object, | 1189 Handle<JSObject> object, |
1190 Register object_reg, | 1190 Register object_reg, |
1191 Handle<JSObject> holder, | 1191 Handle<JSObject> holder, |
1192 Handle<Name> name, | 1192 Handle<Name> name, |
1193 Label* success, | 1193 Label* success, |
1194 Handle<Object> callback) { | 1194 Handle<ExecutableAccessorInfo> callback) { |
1195 Label miss; | 1195 Label miss; |
1196 | 1196 |
1197 Register reg = HandlerFrontendHeader(object, object_reg, holder, name, &miss); | 1197 Register reg = HandlerFrontendHeader(object, object_reg, holder, name, &miss); |
1198 | 1198 |
1199 if (!holder->HasFastProperties() && !holder->IsJSGlobalObject()) { | 1199 if (!holder->HasFastProperties() && !holder->IsJSGlobalObject()) { |
1200 ASSERT(!reg.is(scratch2())); | 1200 ASSERT(!reg.is(scratch2())); |
1201 ASSERT(!reg.is(scratch3())); | 1201 ASSERT(!reg.is(scratch3())); |
1202 ASSERT(!reg.is(scratch4())); | 1202 ASSERT(!reg.is(scratch4())); |
1203 | 1203 |
1204 // Load the properties dictionary. | 1204 // Load the properties dictionary. |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1269 } else { | 1269 } else { |
1270 KeyedLoadFieldStub stub(field.is_inobject(holder), | 1270 KeyedLoadFieldStub stub(field.is_inobject(holder), |
1271 field.translate(holder), | 1271 field.translate(holder), |
1272 representation); | 1272 representation); |
1273 GenerateTailCall(masm(), stub.GetCode(isolate())); | 1273 GenerateTailCall(masm(), stub.GetCode(isolate())); |
1274 } | 1274 } |
1275 } | 1275 } |
1276 | 1276 |
1277 | 1277 |
1278 void BaseLoadStubCompiler::GenerateLoadCallback( | 1278 void BaseLoadStubCompiler::GenerateLoadCallback( |
1279 const CallOptimization& call_optimization) { | |
1280 ASSERT(call_optimization.is_simple_api_call()); | |
1281 | |
1282 // Copy return value. | |
1283 __ movq(scratch3(), StackSpaceOperand(0)); | |
1284 // Assign stack space for the call arguments. | |
1285 __ subq(rsp, Immediate((kFastApiCallArguments + 1) * kPointerSize)); | |
1286 // Move the return address on top of the stack. | |
1287 __ movq(StackOperandForReturnAddress(0), scratch3()); | |
1288 | |
1289 int argc = 0; | |
1290 int api_call_argc = argc + kFastApiCallArguments; | |
1291 StackArgumentsAccessor args(rsp, api_call_argc); | |
1292 // Write holder to stack frame. | |
1293 __ movq(args.GetArgumentOperand(api_call_argc), receiver()); | |
1294 // Write receiver to stack frame. | |
1295 __ movq(args.GetArgumentOperand(api_call_argc - (argc + 6)), receiver()); | |
1296 | |
1297 GenerateFastApiCall(masm(), call_optimization, argc); | |
1298 } | |
1299 | |
1300 | |
1301 void BaseLoadStubCompiler::GenerateLoadCallback( | |
1302 Register reg, | 1279 Register reg, |
1303 Handle<ExecutableAccessorInfo> callback) { | 1280 Handle<ExecutableAccessorInfo> callback) { |
1304 // Insert additional parameters into the stack frame above return address. | 1281 // Insert additional parameters into the stack frame above return address. |
1305 ASSERT(!scratch4().is(reg)); | 1282 ASSERT(!scratch4().is(reg)); |
1306 __ PopReturnAddressTo(scratch4()); | 1283 __ PopReturnAddressTo(scratch4()); |
1307 | 1284 |
1308 __ push(receiver()); // receiver | 1285 __ push(receiver()); // receiver |
1309 __ push(reg); // holder | 1286 __ push(reg); // holder |
1310 if (heap()->InNewSpace(callback->data())) { | 1287 if (heap()->InNewSpace(callback->data())) { |
1311 __ Move(scratch1(), callback); | 1288 __ Move(scratch1(), callback); |
(...skipping 1852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3164 // ----------------------------------- | 3141 // ----------------------------------- |
3165 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_MissForceGeneric); | 3142 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_MissForceGeneric); |
3166 } | 3143 } |
3167 | 3144 |
3168 | 3145 |
3169 #undef __ | 3146 #undef __ |
3170 | 3147 |
3171 } } // namespace v8::internal | 3148 } } // namespace v8::internal |
3172 | 3149 |
3173 #endif // V8_TARGET_ARCH_X64 | 3150 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |