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 11 matching lines...) Expand all Loading... |
22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | 27 |
28 #include "v8.h" | 28 #include "v8.h" |
29 | 29 |
30 #if V8_TARGET_ARCH_X64 | 30 #if V8_TARGET_ARCH_X64 |
31 | 31 |
| 32 #include "arguments.h" |
32 #include "ic-inl.h" | 33 #include "ic-inl.h" |
33 #include "codegen.h" | 34 #include "codegen.h" |
34 #include "stub-cache.h" | 35 #include "stub-cache.h" |
35 | 36 |
36 namespace v8 { | 37 namespace v8 { |
37 namespace internal { | 38 namespace internal { |
38 | 39 |
39 #define __ ACCESS_MASM(masm) | 40 #define __ ACCESS_MASM(masm) |
40 | 41 |
41 | 42 |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 static void PushInterceptorArguments(MacroAssembler* masm, | 365 static void PushInterceptorArguments(MacroAssembler* masm, |
365 Register receiver, | 366 Register receiver, |
366 Register holder, | 367 Register holder, |
367 Register name, | 368 Register name, |
368 Handle<JSObject> holder_obj) { | 369 Handle<JSObject> holder_obj) { |
369 __ push(name); | 370 __ push(name); |
370 Handle<InterceptorInfo> interceptor(holder_obj->GetNamedInterceptor()); | 371 Handle<InterceptorInfo> interceptor(holder_obj->GetNamedInterceptor()); |
371 ASSERT(!masm->isolate()->heap()->InNewSpace(*interceptor)); | 372 ASSERT(!masm->isolate()->heap()->InNewSpace(*interceptor)); |
372 __ Move(kScratchRegister, interceptor); | 373 __ Move(kScratchRegister, interceptor); |
373 __ push(kScratchRegister); | 374 __ push(kScratchRegister); |
| 375 STATIC_ASSERT(PropertyCallbackArguments::kThisIndex == 0); |
| 376 STATIC_ASSERT(PropertyCallbackArguments::kDataIndex == -1); |
| 377 STATIC_ASSERT(PropertyCallbackArguments::kIsolateIndex == -4); |
| 378 STATIC_ASSERT(PropertyCallbackArguments::kHolderIndex == -5); |
374 __ push(receiver); | 379 __ push(receiver); |
375 __ push(holder); | |
376 __ push(FieldOperand(kScratchRegister, InterceptorInfo::kDataOffset)); | 380 __ push(FieldOperand(kScratchRegister, InterceptorInfo::kDataOffset)); |
377 __ PushAddress(ExternalReference::isolate_address(masm->isolate())); | 381 __ PushAddress(ExternalReference::isolate_address(masm->isolate())); |
| 382 __ push(holder); |
378 } | 383 } |
379 | 384 |
380 | 385 |
381 static void CompileCallLoadPropertyWithInterceptor( | 386 static void CompileCallLoadPropertyWithInterceptor( |
382 MacroAssembler* masm, | 387 MacroAssembler* masm, |
383 Register receiver, | 388 Register receiver, |
384 Register holder, | 389 Register holder, |
385 Register name, | 390 Register name, |
386 Handle<JSObject> holder_obj) { | 391 Handle<JSObject> holder_obj) { |
387 PushInterceptorArguments(masm, receiver, holder, name, holder_obj); | 392 PushInterceptorArguments(masm, receiver, holder, name, holder_obj); |
(...skipping 927 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1315 } | 1320 } |
1316 | 1321 |
1317 | 1322 |
1318 void BaseLoadStubCompiler::GenerateLoadCallback( | 1323 void BaseLoadStubCompiler::GenerateLoadCallback( |
1319 Register reg, | 1324 Register reg, |
1320 Handle<ExecutableAccessorInfo> callback) { | 1325 Handle<ExecutableAccessorInfo> callback) { |
1321 // Insert additional parameters into the stack frame above return address. | 1326 // Insert additional parameters into the stack frame above return address. |
1322 ASSERT(!scratch4().is(reg)); | 1327 ASSERT(!scratch4().is(reg)); |
1323 __ PopReturnAddressTo(scratch4()); | 1328 __ PopReturnAddressTo(scratch4()); |
1324 | 1329 |
| 1330 STATIC_ASSERT(PropertyCallbackArguments::kThisIndex == 0); |
| 1331 STATIC_ASSERT(PropertyCallbackArguments::kDataIndex == -1); |
| 1332 STATIC_ASSERT(PropertyCallbackArguments::kReturnValueOffset == -2); |
| 1333 STATIC_ASSERT(PropertyCallbackArguments::kReturnValueDefaultValueIndex == -3); |
| 1334 STATIC_ASSERT(PropertyCallbackArguments::kIsolateIndex == -4); |
| 1335 STATIC_ASSERT(PropertyCallbackArguments::kHolderIndex == -5); |
1325 __ push(receiver()); // receiver | 1336 __ push(receiver()); // receiver |
1326 __ push(reg); // holder | |
1327 if (heap()->InNewSpace(callback->data())) { | 1337 if (heap()->InNewSpace(callback->data())) { |
| 1338 ASSERT(!scratch1().is(reg)); |
1328 __ Move(scratch1(), callback); | 1339 __ Move(scratch1(), callback); |
1329 __ push(FieldOperand(scratch1(), | 1340 __ push(FieldOperand(scratch1(), |
1330 ExecutableAccessorInfo::kDataOffset)); // data | 1341 ExecutableAccessorInfo::kDataOffset)); // data |
1331 } else { | 1342 } else { |
1332 __ Push(Handle<Object>(callback->data(), isolate())); | 1343 __ Push(Handle<Object>(callback->data(), isolate())); |
1333 } | 1344 } |
| 1345 ASSERT(!kScratchRegister.is(reg)); |
1334 __ LoadRoot(kScratchRegister, Heap::kUndefinedValueRootIndex); | 1346 __ LoadRoot(kScratchRegister, Heap::kUndefinedValueRootIndex); |
1335 __ push(kScratchRegister); // return value | 1347 __ push(kScratchRegister); // return value |
1336 __ push(kScratchRegister); // return value default | 1348 __ push(kScratchRegister); // return value default |
1337 __ PushAddress(ExternalReference::isolate_address(isolate())); | 1349 __ PushAddress(ExternalReference::isolate_address(isolate())); |
| 1350 __ push(reg); // holder |
1338 __ push(name()); // name | 1351 __ push(name()); // name |
1339 // Save a pointer to where we pushed the arguments pointer. This will be | 1352 // Save a pointer to where we pushed the arguments pointer. This will be |
1340 // passed as the const ExecutableAccessorInfo& to the C++ callback. | 1353 // passed as the const ExecutableAccessorInfo& to the C++ callback. |
1341 | 1354 |
1342 Address getter_address = v8::ToCData<Address>(callback->getter()); | 1355 Address getter_address = v8::ToCData<Address>(callback->getter()); |
1343 | 1356 |
1344 #if defined(__MINGW64__) || defined(_WIN64) | 1357 #if defined(__MINGW64__) || defined(_WIN64) |
1345 Register getter_arg = r8; | 1358 Register getter_arg = r8; |
1346 Register accessor_info_arg = rdx; | 1359 Register accessor_info_arg = rdx; |
1347 Register name_arg = rcx; | 1360 Register name_arg = rcx; |
(...skipping 23 matching lines...) Expand all Loading... |
1371 // The context register (rsi) has been saved in PrepareCallApiFunction and | 1384 // The context register (rsi) has been saved in PrepareCallApiFunction and |
1372 // could be used to pass arguments. | 1385 // could be used to pass arguments. |
1373 __ lea(accessor_info_arg, StackSpaceOperand(0)); | 1386 __ lea(accessor_info_arg, StackSpaceOperand(0)); |
1374 | 1387 |
1375 Address thunk_address = FUNCTION_ADDR(&InvokeAccessorGetterCallback); | 1388 Address thunk_address = FUNCTION_ADDR(&InvokeAccessorGetterCallback); |
1376 | 1389 |
1377 __ CallApiFunctionAndReturn(getter_address, | 1390 __ CallApiFunctionAndReturn(getter_address, |
1378 thunk_address, | 1391 thunk_address, |
1379 getter_arg, | 1392 getter_arg, |
1380 kStackSpace, | 1393 kStackSpace, |
1381 5); | 1394 6); |
1382 } | 1395 } |
1383 | 1396 |
1384 | 1397 |
1385 void BaseLoadStubCompiler::GenerateLoadConstant(Handle<Object> value) { | 1398 void BaseLoadStubCompiler::GenerateLoadConstant(Handle<Object> value) { |
1386 // Return the constant value. | 1399 // Return the constant value. |
1387 __ LoadObject(rax, value); | 1400 __ LoadObject(rax, value); |
1388 __ ret(0); | 1401 __ ret(0); |
1389 } | 1402 } |
1390 | 1403 |
1391 | 1404 |
(...skipping 1807 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3199 // ----------------------------------- | 3212 // ----------------------------------- |
3200 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_MissForceGeneric); | 3213 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_MissForceGeneric); |
3201 } | 3214 } |
3202 | 3215 |
3203 | 3216 |
3204 #undef __ | 3217 #undef __ |
3205 | 3218 |
3206 } } // namespace v8::internal | 3219 } } // namespace v8::internal |
3207 | 3220 |
3208 #endif // V8_TARGET_ARCH_X64 | 3221 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |