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

Unified Diff: src/ia32/macro-assembler-ia32.cc

Issue 6909026: Additional minor cleanup regarding CallWrapper: Use the null object pattern. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ia32/macro-assembler-ia32.h ('k') | src/mips/macro-assembler-mips.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ia32/macro-assembler-ia32.cc
===================================================================
--- src/ia32/macro-assembler-ia32.cc (revision 7766)
+++ src/ia32/macro-assembler-ia32.cc (working copy)
@@ -1435,7 +1435,7 @@
const Operand& code_operand,
NearLabel* done,
InvokeFlag flag,
- CallWrapper* call_wrapper) {
+ const CallWrapper& call_wrapper) {
bool definitely_matches = false;
Label invoke;
if (expected.is_immediate()) {
@@ -1485,11 +1485,9 @@
}
if (flag == CALL_FUNCTION) {
- if (call_wrapper != NULL) {
- call_wrapper->BeforeCall(CallSize(adaptor, RelocInfo::CODE_TARGET));
- }
+ call_wrapper.BeforeCall(CallSize(adaptor, RelocInfo::CODE_TARGET));
call(adaptor, RelocInfo::CODE_TARGET);
- if (call_wrapper != NULL) call_wrapper->AfterCall();
+ call_wrapper.AfterCall();
jmp(done);
} else {
jmp(adaptor, RelocInfo::CODE_TARGET);
@@ -1503,14 +1501,14 @@
const ParameterCount& expected,
const ParameterCount& actual,
InvokeFlag flag,
- CallWrapper* call_wrapper) {
+ const CallWrapper& call_wrapper) {
NearLabel done;
InvokePrologue(expected, actual, Handle<Code>::null(), code,
&done, flag, call_wrapper);
if (flag == CALL_FUNCTION) {
- if (call_wrapper != NULL) call_wrapper->BeforeCall(CallSize(code));
+ call_wrapper.BeforeCall(CallSize(code));
call(code);
- if (call_wrapper != NULL) call_wrapper->AfterCall();
+ call_wrapper.AfterCall();
} else {
ASSERT(flag == JUMP_FUNCTION);
jmp(code);
@@ -1524,14 +1522,14 @@
const ParameterCount& actual,
RelocInfo::Mode rmode,
InvokeFlag flag,
- CallWrapper* call_wrapper) {
+ const CallWrapper& call_wrapper) {
NearLabel done;
Operand dummy(eax);
InvokePrologue(expected, actual, code, dummy, &done, flag, call_wrapper);
if (flag == CALL_FUNCTION) {
- if (call_wrapper != NULL) call_wrapper->BeforeCall(CallSize(code, rmode));
+ call_wrapper.BeforeCall(CallSize(code, rmode));
call(code, rmode);
- if (call_wrapper != NULL) call_wrapper->AfterCall();
+ call_wrapper.AfterCall();
} else {
ASSERT(flag == JUMP_FUNCTION);
jmp(code, rmode);
@@ -1543,7 +1541,7 @@
void MacroAssembler::InvokeFunction(Register fun,
const ParameterCount& actual,
InvokeFlag flag,
- CallWrapper* call_wrapper) {
+ const CallWrapper& call_wrapper) {
ASSERT(fun.is(edi));
mov(edx, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset));
mov(esi, FieldOperand(edi, JSFunction::kContextOffset));
@@ -1559,7 +1557,7 @@
void MacroAssembler::InvokeFunction(JSFunction* function,
const ParameterCount& actual,
InvokeFlag flag,
- CallWrapper* call_wrapper) {
+ const CallWrapper& call_wrapper) {
ASSERT(function->is_compiled());
// Get the function and setup the context.
mov(edi, Immediate(Handle<JSFunction>(function)));
@@ -1582,7 +1580,7 @@
void MacroAssembler::InvokeBuiltin(Builtins::JavaScript id,
InvokeFlag flag,
- CallWrapper* call_wrapper) {
+ const CallWrapper& call_wrapper) {
// Calls are not allowed in some stubs.
ASSERT(flag == JUMP_FUNCTION || allow_stub_calls());
« no previous file with comments | « src/ia32/macro-assembler-ia32.h ('k') | src/mips/macro-assembler-mips.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698