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 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
509 // address of the callback as additional parameter, always allocate | 509 // address of the callback as additional parameter, always allocate |
510 // space for it. | 510 // space for it. |
511 const int kApiArgc = 1 + 1; | 511 const int kApiArgc = 1 + 1; |
512 | 512 |
513 // Allocate the v8::Arguments structure in the arguments' space since | 513 // Allocate the v8::Arguments structure in the arguments' space since |
514 // it's not controlled by GC. | 514 // it's not controlled by GC. |
515 const int kApiStackSpace = 4; | 515 const int kApiStackSpace = 4; |
516 | 516 |
517 // Function address is a foreign pointer outside V8's heap. | 517 // Function address is a foreign pointer outside V8's heap. |
518 Address function_address = v8::ToCData<Address>(api_call_info->callback()); | 518 Address function_address = v8::ToCData<Address>(api_call_info->callback()); |
519 bool returns_handle = | 519 // TODO(dcarney): fix signatures using returns_handle |
520 !CallbackTable::ReturnsVoid(masm->isolate(), | 520 const bool returns_handle = false; |
521 reinterpret_cast<void*>(function_address)); | |
522 __ PrepareCallApiFunction(kApiArgc + kApiStackSpace, returns_handle); | 521 __ PrepareCallApiFunction(kApiArgc + kApiStackSpace, returns_handle); |
523 | 522 |
524 // v8::Arguments::implicit_args_. | 523 // v8::Arguments::implicit_args_. |
525 __ mov(ApiParameterOperand(2, returns_handle), eax); | 524 __ mov(ApiParameterOperand(2, returns_handle), eax); |
526 __ add(eax, Immediate(argc * kPointerSize)); | 525 __ add(eax, Immediate(argc * kPointerSize)); |
527 // v8::Arguments::values_. | 526 // v8::Arguments::values_. |
528 __ mov(ApiParameterOperand(3, returns_handle), eax); | 527 __ mov(ApiParameterOperand(3, returns_handle), eax); |
529 // v8::Arguments::length_. | 528 // v8::Arguments::length_. |
530 __ Set(ApiParameterOperand(4, returns_handle), Immediate(argc)); | 529 __ Set(ApiParameterOperand(4, returns_handle), Immediate(argc)); |
531 // v8::Arguments::is_construct_call_. | 530 // v8::Arguments::is_construct_call_. |
532 __ Set(ApiParameterOperand(5, returns_handle), Immediate(0)); | 531 __ Set(ApiParameterOperand(5, returns_handle), Immediate(0)); |
533 | 532 |
534 // v8::InvocationCallback's argument. | 533 // v8::InvocationCallback's argument. |
535 __ lea(eax, ApiParameterOperand(2, returns_handle)); | 534 __ lea(eax, ApiParameterOperand(2, returns_handle)); |
536 __ mov(ApiParameterOperand(0, returns_handle), eax); | 535 __ mov(ApiParameterOperand(0, returns_handle), eax); |
537 | 536 |
538 Address thunk_address = returns_handle | 537 Address thunk_address = FUNCTION_ADDR(&InvokeFunctionCallback); |
539 ? FUNCTION_ADDR(&InvokeInvocationCallback) | |
540 : FUNCTION_ADDR(&InvokeFunctionCallback); | |
541 | 538 |
542 __ CallApiFunctionAndReturn(function_address, | 539 __ CallApiFunctionAndReturn(function_address, |
543 thunk_address, | 540 thunk_address, |
544 ApiParameterOperand(1, returns_handle), | 541 ApiParameterOperand(1, returns_handle), |
545 argc + kFastApiCallArguments + 1, | 542 argc + kFastApiCallArguments + 1, |
546 returns_handle, | 543 returns_handle, |
547 kFastApiCallArguments + 1); | 544 kFastApiCallArguments + 1); |
548 } | 545 } |
549 | 546 |
550 | 547 |
(...skipping 842 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1393 __ push(scratch3()); // Restore return address. | 1390 __ push(scratch3()); // Restore return address. |
1394 | 1391 |
1395 // array for v8::Arguments::values_, handler for name and pointer | 1392 // array for v8::Arguments::values_, handler for name and pointer |
1396 // to the values (it considered as smi in GC). | 1393 // to the values (it considered as smi in GC). |
1397 const int kStackSpace = PropertyCallbackArguments::kArgsLength + 2; | 1394 const int kStackSpace = PropertyCallbackArguments::kArgsLength + 2; |
1398 // Allocate space for opional callback address parameter in case | 1395 // Allocate space for opional callback address parameter in case |
1399 // CPU profiler is active. | 1396 // CPU profiler is active. |
1400 const int kApiArgc = 2 + 1; | 1397 const int kApiArgc = 2 + 1; |
1401 | 1398 |
1402 Address getter_address = v8::ToCData<Address>(callback->getter()); | 1399 Address getter_address = v8::ToCData<Address>(callback->getter()); |
1403 bool returns_handle = | 1400 // TODO(dcarney): fix signatures using returns_handle |
1404 !CallbackTable::ReturnsVoid(isolate(), | 1401 const bool returns_handle = false; |
1405 reinterpret_cast<void*>(getter_address)); | |
1406 __ PrepareCallApiFunction(kApiArgc, returns_handle); | 1402 __ PrepareCallApiFunction(kApiArgc, returns_handle); |
1407 __ mov(ApiParameterOperand(0, returns_handle), ebx); // name. | 1403 __ mov(ApiParameterOperand(0, returns_handle), ebx); // name. |
1408 __ add(ebx, Immediate(kPointerSize)); | 1404 __ add(ebx, Immediate(kPointerSize)); |
1409 __ mov(ApiParameterOperand(1, returns_handle), ebx); // arguments pointer. | 1405 __ mov(ApiParameterOperand(1, returns_handle), ebx); // arguments pointer. |
1410 | 1406 |
1411 // Emitting a stub call may try to allocate (if the code is not | 1407 // Emitting a stub call may try to allocate (if the code is not |
1412 // already generated). Do not allow the assembler to perform a | 1408 // already generated). Do not allow the assembler to perform a |
1413 // garbage collection but instead return the allocation failure | 1409 // garbage collection but instead return the allocation failure |
1414 // object. | 1410 // object. |
1415 | 1411 |
1416 Address thunk_address = returns_handle | 1412 Address thunk_address = FUNCTION_ADDR(&InvokeAccessorGetterCallback); |
1417 ? FUNCTION_ADDR(&InvokeAccessorGetter) | |
1418 : FUNCTION_ADDR(&InvokeAccessorGetterCallback); | |
1419 | 1413 |
1420 __ CallApiFunctionAndReturn(getter_address, | 1414 __ CallApiFunctionAndReturn(getter_address, |
1421 thunk_address, | 1415 thunk_address, |
1422 ApiParameterOperand(2, returns_handle), | 1416 ApiParameterOperand(2, returns_handle), |
1423 kStackSpace, | 1417 kStackSpace, |
1424 returns_handle, | 1418 returns_handle, |
1425 6); | 1419 6); |
1426 } | 1420 } |
1427 | 1421 |
1428 | 1422 |
(...skipping 1825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3254 // ----------------------------------- | 3248 // ----------------------------------- |
3255 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_MissForceGeneric); | 3249 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_MissForceGeneric); |
3256 } | 3250 } |
3257 | 3251 |
3258 | 3252 |
3259 #undef __ | 3253 #undef __ |
3260 | 3254 |
3261 } } // namespace v8::internal | 3255 } } // namespace v8::internal |
3262 | 3256 |
3263 #endif // V8_TARGET_ARCH_IA32 | 3257 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |