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

Side by Side Diff: src/x64/macro-assembler-x64.cc

Issue 91963003: Cleanup in the CallStubCompiler. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix check Created 7 years 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 | Annotate | Revision Log
OLDNEW
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 3579 matching lines...) Expand 10 before | Expand all | Expand 10 after
3590 FieldOperand(rdx, SharedFunctionInfo::kFormalParameterCountOffset)); 3590 FieldOperand(rdx, SharedFunctionInfo::kFormalParameterCountOffset));
3591 // Advances rdx to the end of the Code object header, to the start of 3591 // Advances rdx to the end of the Code object header, to the start of
3592 // the executable code. 3592 // the executable code.
3593 movq(rdx, FieldOperand(rdi, JSFunction::kCodeEntryOffset)); 3593 movq(rdx, FieldOperand(rdi, JSFunction::kCodeEntryOffset));
3594 3594
3595 ParameterCount expected(rbx); 3595 ParameterCount expected(rbx);
3596 InvokeCode(rdx, expected, actual, flag, call_wrapper, call_kind); 3596 InvokeCode(rdx, expected, actual, flag, call_wrapper, call_kind);
3597 } 3597 }
3598 3598
3599 3599
3600 void MacroAssembler::InvokeFunction(Handle<JSFunction> function, 3600 void MacroAssembler::InvokeFunction(Register function,
3601 const ParameterCount& expected, 3601 const ParameterCount& expected,
3602 const ParameterCount& actual, 3602 const ParameterCount& actual,
3603 InvokeFlag flag, 3603 InvokeFlag flag,
3604 const CallWrapper& call_wrapper, 3604 const CallWrapper& call_wrapper,
3605 CallKind call_kind) { 3605 CallKind call_kind) {
3606 // You can't call a function without a valid frame. 3606 // You can't call a function without a valid frame.
3607 ASSERT(flag == JUMP_FUNCTION || has_frame()); 3607 ASSERT(flag == JUMP_FUNCTION || has_frame());
3608 3608
3609 // Get the function and setup the context. 3609 ASSERT(function.is(rdi));
3610 movq(rsi, FieldOperand(function, JSFunction::kContextOffset));
3611 // Advances rdx to the end of the Code object header, to the start of
3612 // the executable code.
3613 movq(rdx, FieldOperand(rdi, JSFunction::kCodeEntryOffset));
Igor Sheludko 2013/11/28 13:06:08 rdi -> function?
3614
3615 InvokeCode(rdx, expected, actual, flag, call_wrapper, call_kind);
3616 }
3617
3618
3619 void MacroAssembler::InvokeFunction(Handle<JSFunction> function,
3620 const ParameterCount& expected,
3621 const ParameterCount& actual,
3622 InvokeFlag flag,
3623 const CallWrapper& call_wrapper,
3624 CallKind call_kind) {
3610 Move(rdi, function); 3625 Move(rdi, function);
3611 movq(rsi, FieldOperand(rdi, JSFunction::kContextOffset)); 3626 InvokeFunction(rdi, expected, actual, flag, call_wrapper, call_kind);
3612
3613 // We call indirectly through the code field in the function to
3614 // allow recompilation to take effect without changing any of the
3615 // call sites.
3616 movq(rdx, FieldOperand(rdi, JSFunction::kCodeEntryOffset));
3617 InvokeCode(rdx, expected, actual, flag, call_wrapper, call_kind);
3618 } 3627 }
3619 3628
3620 3629
3621 void MacroAssembler::InvokePrologue(const ParameterCount& expected, 3630 void MacroAssembler::InvokePrologue(const ParameterCount& expected,
3622 const ParameterCount& actual, 3631 const ParameterCount& actual,
3623 Handle<Code> code_constant, 3632 Handle<Code> code_constant,
3624 Register code_register, 3633 Register code_register,
3625 Label* done, 3634 Label* done,
3626 bool* definitely_mismatches, 3635 bool* definitely_mismatches,
3627 InvokeFlag flag, 3636 InvokeFlag flag,
(...skipping 1423 matching lines...) Expand 10 before | Expand all | Expand 10 after
5051 j(equal, found); 5060 j(equal, found);
5052 movq(current, FieldOperand(current, Map::kPrototypeOffset)); 5061 movq(current, FieldOperand(current, Map::kPrototypeOffset));
5053 CompareRoot(current, Heap::kNullValueRootIndex); 5062 CompareRoot(current, Heap::kNullValueRootIndex);
5054 j(not_equal, &loop_again); 5063 j(not_equal, &loop_again);
5055 } 5064 }
5056 5065
5057 5066
5058 } } // namespace v8::internal 5067 } } // namespace v8::internal
5059 5068
5060 #endif // V8_TARGET_ARCH_X64 5069 #endif // V8_TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698