Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(620)

Side by Side Diff: src/x64/codegen-x64.cc

Issue 2801008: Port faster callbacks invocation to x64. (Closed)
Patch Set: Minor cosmetic changes Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/x64/assembler-x64.cc ('k') | src/x64/macro-assembler-x64.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 10872 matching lines...) Expand 10 before | Expand all | Expand 10 after
10883 Label skip; 10883 Label skip;
10884 __ cmpq(rbp, Immediate(0)); 10884 __ cmpq(rbp, Immediate(0));
10885 __ j(equal, &skip); 10885 __ j(equal, &skip);
10886 __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); 10886 __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset));
10887 __ bind(&skip); 10887 __ bind(&skip);
10888 __ ret(0); 10888 __ ret(0);
10889 } 10889 }
10890 10890
10891 10891
10892 void ApiGetterEntryStub::Generate(MacroAssembler* masm) { 10892 void ApiGetterEntryStub::Generate(MacroAssembler* masm) {
10893 UNREACHABLE(); 10893 Label empty_result;
10894 Label prologue;
10895 Label promote_scheduled_exception;
10896 __ EnterApiExitFrame(ExitFrame::MODE_NORMAL, kStackSpace, 0);
10897 ASSERT_EQ(kArgc, 4);
10898 #ifdef _WIN64
10899 // All the parameters should be set up by a caller.
10900 #else
10901 // Set 1st parameter register with property name.
10902 __ movq(rsi, rdx);
10903 // Second parameter register rdi should be set with pointer to AccessorInfo
10904 // by a caller.
10905 #endif
10906 // Call the api function!
10907 __ movq(rax,
10908 reinterpret_cast<int64_t>(fun()->address()),
10909 RelocInfo::RUNTIME_ENTRY);
10910 __ call(rax);
10911 // Check if the function scheduled an exception.
10912 ExternalReference scheduled_exception_address =
10913 ExternalReference::scheduled_exception_address();
10914 __ movq(rsi, scheduled_exception_address);
10915 __ Cmp(Operand(rsi, 0), Factory::the_hole_value());
10916 __ j(not_equal, &promote_scheduled_exception);
10917 #ifdef _WIN64
10918 // rax keeps a pointer to v8::Handle, unpack it.
10919 __ movq(rax, Operand(rax, 0));
10920 #endif
10921 // Check if the result handle holds 0.
10922 __ testq(rax, rax);
10923 __ j(zero, &empty_result);
10924 // It was non-zero. Dereference to get the result value.
10925 __ movq(rax, Operand(rax, 0));
10926 __ bind(&prologue);
10927 __ LeaveExitFrame(ExitFrame::MODE_NORMAL);
10928 __ ret(0);
10929 __ bind(&promote_scheduled_exception);
10930 __ TailCallRuntime(Runtime::kPromoteScheduledException, 0, 1);
10931 __ bind(&empty_result);
10932 // It was zero; the result is undefined.
10933 __ Move(rax, Factory::undefined_value());
10934 __ jmp(&prologue);
10894 } 10935 }
10895 10936
10896 10937
10897 void CEntryStub::GenerateCore(MacroAssembler* masm, 10938 void CEntryStub::GenerateCore(MacroAssembler* masm,
10898 Label* throw_normal_exception, 10939 Label* throw_normal_exception,
10899 Label* throw_termination_exception, 10940 Label* throw_termination_exception,
10900 Label* throw_out_of_memory_exception, 10941 Label* throw_out_of_memory_exception,
10901 bool do_gc, 10942 bool do_gc,
10902 bool always_allocate_scope, 10943 bool always_allocate_scope,
10903 int /* alignment_skew */) { 10944 int /* alignment_skew */) {
(...skipping 1578 matching lines...) Expand 10 before | Expand all | Expand 10 after
12482 #undef __ 12523 #undef __
12483 12524
12484 void RecordWriteStub::Generate(MacroAssembler* masm) { 12525 void RecordWriteStub::Generate(MacroAssembler* masm) {
12485 masm->RecordWriteHelper(object_, addr_, scratch_); 12526 masm->RecordWriteHelper(object_, addr_, scratch_);
12486 masm->ret(0); 12527 masm->ret(0);
12487 } 12528 }
12488 12529
12489 } } // namespace v8::internal 12530 } } // namespace v8::internal
12490 12531
12491 #endif // V8_TARGET_ARCH_X64 12532 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/assembler-x64.cc ('k') | src/x64/macro-assembler-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698