| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 2466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2477 NearLabel skip; | 2477 NearLabel skip; |
| 2478 __ cmpq(rbp, Immediate(0)); | 2478 __ cmpq(rbp, Immediate(0)); |
| 2479 __ j(equal, &skip); | 2479 __ j(equal, &skip); |
| 2480 __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); | 2480 __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); |
| 2481 __ bind(&skip); | 2481 __ bind(&skip); |
| 2482 __ ret(0); | 2482 __ ret(0); |
| 2483 } | 2483 } |
| 2484 | 2484 |
| 2485 | 2485 |
| 2486 void ApiGetterEntryStub::Generate(MacroAssembler* masm) { | 2486 void ApiGetterEntryStub::Generate(MacroAssembler* masm) { |
| 2487 Label empty_result; | 2487 __ PrepareCallApiFunction(kStackSpace); |
| 2488 Label prologue; | |
| 2489 Label promote_scheduled_exception; | |
| 2490 __ EnterApiExitFrame(kStackSpace, 0); | |
| 2491 ASSERT_EQ(kArgc, 4); | |
| 2492 #ifdef _WIN64 | 2488 #ifdef _WIN64 |
| 2493 // All the parameters should be set up by a caller. | 2489 // All the parameters should be set up by a caller. |
| 2494 #else | 2490 #else |
| 2495 // Set 1st parameter register with property name. | 2491 // Set 1st parameter register with property name. |
| 2496 __ movq(rsi, rdx); | 2492 __ movq(rsi, rdx); |
| 2497 // Second parameter register rdi should be set with pointer to AccessorInfo | 2493 // Second parameter register rdi should be set with pointer to AccessorInfo |
| 2498 // by a caller. | 2494 // by a caller. |
| 2499 #endif | 2495 #endif |
| 2500 // Call the api function! | 2496 __ CallApiFunctionAndReturn(fun()); |
| 2501 __ movq(rax, | |
| 2502 reinterpret_cast<int64_t>(fun()->address()), | |
| 2503 RelocInfo::RUNTIME_ENTRY); | |
| 2504 __ call(rax); | |
| 2505 // Check if the function scheduled an exception. | |
| 2506 ExternalReference scheduled_exception_address = | |
| 2507 ExternalReference::scheduled_exception_address(); | |
| 2508 __ movq(rsi, scheduled_exception_address); | |
| 2509 __ Cmp(Operand(rsi, 0), Factory::the_hole_value()); | |
| 2510 __ j(not_equal, &promote_scheduled_exception); | |
| 2511 #ifdef _WIN64 | |
| 2512 // rax keeps a pointer to v8::Handle, unpack it. | |
| 2513 __ movq(rax, Operand(rax, 0)); | |
| 2514 #endif | |
| 2515 // Check if the result handle holds 0. | |
| 2516 __ testq(rax, rax); | |
| 2517 __ j(zero, &empty_result); | |
| 2518 // It was non-zero. Dereference to get the result value. | |
| 2519 __ movq(rax, Operand(rax, 0)); | |
| 2520 __ bind(&prologue); | |
| 2521 __ LeaveExitFrame(); | |
| 2522 __ ret(0); | |
| 2523 __ bind(&promote_scheduled_exception); | |
| 2524 __ TailCallRuntime(Runtime::kPromoteScheduledException, 0, 1); | |
| 2525 __ bind(&empty_result); | |
| 2526 // It was zero; the result is undefined. | |
| 2527 __ Move(rax, Factory::undefined_value()); | |
| 2528 __ jmp(&prologue); | |
| 2529 } | 2497 } |
| 2530 | 2498 |
| 2531 | 2499 |
| 2532 void CEntryStub::GenerateCore(MacroAssembler* masm, | 2500 void CEntryStub::GenerateCore(MacroAssembler* masm, |
| 2533 Label* throw_normal_exception, | 2501 Label* throw_normal_exception, |
| 2534 Label* throw_termination_exception, | 2502 Label* throw_termination_exception, |
| 2535 Label* throw_out_of_memory_exception, | 2503 Label* throw_out_of_memory_exception, |
| 2536 bool do_gc, | 2504 bool do_gc, |
| 2537 bool always_allocate_scope, | 2505 bool always_allocate_scope, |
| 2538 int /* alignment_skew */) { | 2506 int /* alignment_skew */) { |
| (...skipping 1485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4024 // tagged as a small integer. | 3992 // tagged as a small integer. |
| 4025 __ bind(&runtime); | 3993 __ bind(&runtime); |
| 4026 __ TailCallRuntime(Runtime::kStringCompare, 2, 1); | 3994 __ TailCallRuntime(Runtime::kStringCompare, 2, 1); |
| 4027 } | 3995 } |
| 4028 | 3996 |
| 4029 #undef __ | 3997 #undef __ |
| 4030 | 3998 |
| 4031 } } // namespace v8::internal | 3999 } } // namespace v8::internal |
| 4032 | 4000 |
| 4033 #endif // V8_TARGET_ARCH_X64 | 4001 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |