Commit 422b0271 authored by sgjesse@chromium.org's avatar sgjesse@chromium.org

Change the updating of the counters for global stub use to be consistent. Now...

Change the updating of the counters for global stub use to be consistent. Now counters are updated when they are sure to count to avoid decrementing them when there is a miss.
Review URL: http://codereview.chromium.org/160265

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2554 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent c41447f2
...@@ -746,8 +746,6 @@ Object* CallStubCompiler::CompileCallGlobal(JSObject* object, ...@@ -746,8 +746,6 @@ Object* CallStubCompiler::CompileCallGlobal(JSObject* object,
// ----------------------------------- // -----------------------------------
Label miss; Label miss;
__ IncrementCounter(&Counters::call_global_inline, 1, r1, r3);
// Get the number of arguments. // Get the number of arguments.
const int argc = arguments().immediate(); const int argc = arguments().immediate();
...@@ -784,6 +782,7 @@ Object* CallStubCompiler::CompileCallGlobal(JSObject* object, ...@@ -784,6 +782,7 @@ Object* CallStubCompiler::CompileCallGlobal(JSObject* object,
__ ldr(cp, FieldMemOperand(r1, JSFunction::kContextOffset)); __ ldr(cp, FieldMemOperand(r1, JSFunction::kContextOffset));
// Jump to the cached code (tail call). // Jump to the cached code (tail call).
__ IncrementCounter(&Counters::call_global_inline, 1, r1, r3);
ASSERT(function->is_compiled()); ASSERT(function->is_compiled());
Handle<Code> code(function->code()); Handle<Code> code(function->code());
ParameterCount expected(function->shared()->formal_parameter_count()); ParameterCount expected(function->shared()->formal_parameter_count());
...@@ -792,7 +791,6 @@ Object* CallStubCompiler::CompileCallGlobal(JSObject* object, ...@@ -792,7 +791,6 @@ Object* CallStubCompiler::CompileCallGlobal(JSObject* object,
// Handle call cache miss. // Handle call cache miss.
__ bind(&miss); __ bind(&miss);
__ DecrementCounter(&Counters::call_global_inline, 1, r1, r3);
__ IncrementCounter(&Counters::call_global_inline_miss, 1, r1, r3); __ IncrementCounter(&Counters::call_global_inline_miss, 1, r1, r3);
Handle<Code> ic = ComputeCallMiss(arguments().immediate()); Handle<Code> ic = ComputeCallMiss(arguments().immediate());
__ Jump(ic, RelocInfo::CODE_TARGET); __ Jump(ic, RelocInfo::CODE_TARGET);
...@@ -953,8 +951,6 @@ Object* StoreStubCompiler::CompileStoreGlobal(GlobalObject* object, ...@@ -953,8 +951,6 @@ Object* StoreStubCompiler::CompileStoreGlobal(GlobalObject* object,
// ----------------------------------- // -----------------------------------
Label miss; Label miss;
__ IncrementCounter(&Counters::named_store_global_inline, 1, r1, r3);
// Check that the map of the global has not changed. // Check that the map of the global has not changed.
__ ldr(r1, MemOperand(sp, 0 * kPointerSize)); __ ldr(r1, MemOperand(sp, 0 * kPointerSize));
__ ldr(r3, FieldMemOperand(r1, HeapObject::kMapOffset)); __ ldr(r3, FieldMemOperand(r1, HeapObject::kMapOffset));
...@@ -965,11 +961,11 @@ Object* StoreStubCompiler::CompileStoreGlobal(GlobalObject* object, ...@@ -965,11 +961,11 @@ Object* StoreStubCompiler::CompileStoreGlobal(GlobalObject* object,
__ mov(r2, Operand(Handle<JSGlobalPropertyCell>(cell))); __ mov(r2, Operand(Handle<JSGlobalPropertyCell>(cell)));
__ str(r0, FieldMemOperand(r2, JSGlobalPropertyCell::kValueOffset)); __ str(r0, FieldMemOperand(r2, JSGlobalPropertyCell::kValueOffset));
__ IncrementCounter(&Counters::named_store_global_inline, 1, r1, r3);
__ Ret(); __ Ret();
// Handle store cache miss. // Handle store cache miss.
__ bind(&miss); __ bind(&miss);
__ DecrementCounter(&Counters::named_store_global_inline, 1, r1, r3);
__ IncrementCounter(&Counters::named_store_global_inline_miss, 1, r1, r3); __ IncrementCounter(&Counters::named_store_global_inline_miss, 1, r1, r3);
Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Miss)); Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Miss));
__ Jump(ic, RelocInfo::CODE_TARGET); __ Jump(ic, RelocInfo::CODE_TARGET);
...@@ -1085,8 +1081,6 @@ Object* LoadStubCompiler::CompileLoadGlobal(JSObject* object, ...@@ -1085,8 +1081,6 @@ Object* LoadStubCompiler::CompileLoadGlobal(JSObject* object,
// ----------------------------------- // -----------------------------------
Label miss; Label miss;
__ IncrementCounter(&Counters::named_load_global_inline, 1, r1, r3);
// Get the receiver from the stack. // Get the receiver from the stack.
__ ldr(r1, MemOperand(sp, 0 * kPointerSize)); __ ldr(r1, MemOperand(sp, 0 * kPointerSize));
...@@ -1111,10 +1105,10 @@ Object* LoadStubCompiler::CompileLoadGlobal(JSObject* object, ...@@ -1111,10 +1105,10 @@ Object* LoadStubCompiler::CompileLoadGlobal(JSObject* object,
__ b(eq, &miss); __ b(eq, &miss);
} }
__ IncrementCounter(&Counters::named_load_global_inline, 1, r1, r3);
__ Ret(); __ Ret();
__ bind(&miss); __ bind(&miss);
__ DecrementCounter(&Counters::named_load_global_inline, 1, r1, r3);
__ IncrementCounter(&Counters::named_load_global_inline_miss, 1, r1, r3); __ IncrementCounter(&Counters::named_load_global_inline_miss, 1, r1, r3);
GenerateLoadMiss(masm(), Code::LOAD_IC); GenerateLoadMiss(masm(), Code::LOAD_IC);
......
...@@ -800,8 +800,6 @@ Object* CallStubCompiler::CompileCallGlobal(JSObject* object, ...@@ -800,8 +800,6 @@ Object* CallStubCompiler::CompileCallGlobal(JSObject* object,
// ----------------------------------- // -----------------------------------
Label miss; Label miss;
__ IncrementCounter(&Counters::call_global_inline, 1);
// Get the number of arguments. // Get the number of arguments.
const int argc = arguments().immediate(); const int argc = arguments().immediate();
...@@ -837,6 +835,7 @@ Object* CallStubCompiler::CompileCallGlobal(JSObject* object, ...@@ -837,6 +835,7 @@ Object* CallStubCompiler::CompileCallGlobal(JSObject* object,
__ mov(esi, FieldOperand(edi, JSFunction::kContextOffset)); __ mov(esi, FieldOperand(edi, JSFunction::kContextOffset));
// Jump to the cached code (tail call). // Jump to the cached code (tail call).
__ IncrementCounter(&Counters::call_global_inline, 1);
ASSERT(function->is_compiled()); ASSERT(function->is_compiled());
Handle<Code> code(function->code()); Handle<Code> code(function->code());
ParameterCount expected(function->shared()->formal_parameter_count()); ParameterCount expected(function->shared()->formal_parameter_count());
...@@ -845,7 +844,6 @@ Object* CallStubCompiler::CompileCallGlobal(JSObject* object, ...@@ -845,7 +844,6 @@ Object* CallStubCompiler::CompileCallGlobal(JSObject* object,
// Handle call cache miss. // Handle call cache miss.
__ bind(&miss); __ bind(&miss);
__ DecrementCounter(&Counters::call_global_inline, 1);
__ IncrementCounter(&Counters::call_global_inline_miss, 1); __ IncrementCounter(&Counters::call_global_inline_miss, 1);
Handle<Code> ic = ComputeCallMiss(arguments().immediate()); Handle<Code> ic = ComputeCallMiss(arguments().immediate());
__ jmp(ic, RelocInfo::CODE_TARGET); __ jmp(ic, RelocInfo::CODE_TARGET);
...@@ -1009,8 +1007,6 @@ Object* StoreStubCompiler::CompileStoreGlobal(GlobalObject* object, ...@@ -1009,8 +1007,6 @@ Object* StoreStubCompiler::CompileStoreGlobal(GlobalObject* object,
// ----------------------------------- // -----------------------------------
Label miss; Label miss;
__ IncrementCounter(&Counters::named_store_global_inline, 1);
// Check that the map of the global has not changed. // Check that the map of the global has not changed.
__ mov(ebx, Operand(esp, kPointerSize)); __ mov(ebx, Operand(esp, kPointerSize));
__ cmp(FieldOperand(ebx, HeapObject::kMapOffset), __ cmp(FieldOperand(ebx, HeapObject::kMapOffset),
...@@ -1022,11 +1018,11 @@ Object* StoreStubCompiler::CompileStoreGlobal(GlobalObject* object, ...@@ -1022,11 +1018,11 @@ Object* StoreStubCompiler::CompileStoreGlobal(GlobalObject* object,
__ mov(FieldOperand(ecx, JSGlobalPropertyCell::kValueOffset), eax); __ mov(FieldOperand(ecx, JSGlobalPropertyCell::kValueOffset), eax);
// Return the value (register eax). // Return the value (register eax).
__ IncrementCounter(&Counters::named_store_global_inline, 1);
__ ret(0); __ ret(0);
// Handle store cache miss. // Handle store cache miss.
__ bind(&miss); __ bind(&miss);
__ DecrementCounter(&Counters::named_store_global_inline, 1);
__ IncrementCounter(&Counters::named_store_global_inline_miss, 1); __ IncrementCounter(&Counters::named_store_global_inline_miss, 1);
Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Miss)); Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Miss));
__ jmp(ic, RelocInfo::CODE_TARGET); __ jmp(ic, RelocInfo::CODE_TARGET);
...@@ -1187,8 +1183,6 @@ Object* LoadStubCompiler::CompileLoadGlobal(JSObject* object, ...@@ -1187,8 +1183,6 @@ Object* LoadStubCompiler::CompileLoadGlobal(JSObject* object,
// ----------------------------------- // -----------------------------------
Label miss; Label miss;
__ IncrementCounter(&Counters::named_load_global_inline, 1);
// Get the receiver from the stack. // Get the receiver from the stack.
__ mov(eax, Operand(esp, kPointerSize)); __ mov(eax, Operand(esp, kPointerSize));
...@@ -1216,10 +1210,10 @@ Object* LoadStubCompiler::CompileLoadGlobal(JSObject* object, ...@@ -1216,10 +1210,10 @@ Object* LoadStubCompiler::CompileLoadGlobal(JSObject* object,
__ Check(not_equal, "DontDelete cells can't contain the hole"); __ Check(not_equal, "DontDelete cells can't contain the hole");
} }
__ IncrementCounter(&Counters::named_load_global_inline, 1);
__ ret(0); __ ret(0);
__ bind(&miss); __ bind(&miss);
__ DecrementCounter(&Counters::named_load_global_inline, 1);
__ IncrementCounter(&Counters::named_load_global_inline_miss, 1); __ IncrementCounter(&Counters::named_load_global_inline_miss, 1);
GenerateLoadMiss(masm(), Code::LOAD_IC); GenerateLoadMiss(masm(), Code::LOAD_IC);
......
...@@ -252,8 +252,6 @@ Object* CallStubCompiler::CompileCallGlobal(JSObject* object, ...@@ -252,8 +252,6 @@ Object* CallStubCompiler::CompileCallGlobal(JSObject* object,
// rsp[(argc + 2) * 8] function name // rsp[(argc + 2) * 8] function name
Label miss; Label miss;
__ IncrementCounter(&Counters::call_global_inline, 1);
// Get the number of arguments. // Get the number of arguments.
const int argc = arguments().immediate(); const int argc = arguments().immediate();
...@@ -289,6 +287,7 @@ Object* CallStubCompiler::CompileCallGlobal(JSObject* object, ...@@ -289,6 +287,7 @@ Object* CallStubCompiler::CompileCallGlobal(JSObject* object,
__ movq(rsi, FieldOperand(rdi, JSFunction::kContextOffset)); __ movq(rsi, FieldOperand(rdi, JSFunction::kContextOffset));
// Jump to the cached code (tail call). // Jump to the cached code (tail call).
__ IncrementCounter(&Counters::call_global_inline, 1);
ASSERT(function->is_compiled()); ASSERT(function->is_compiled());
Handle<Code> code(function->code()); Handle<Code> code(function->code());
ParameterCount expected(function->shared()->formal_parameter_count()); ParameterCount expected(function->shared()->formal_parameter_count());
...@@ -297,7 +296,6 @@ Object* CallStubCompiler::CompileCallGlobal(JSObject* object, ...@@ -297,7 +296,6 @@ Object* CallStubCompiler::CompileCallGlobal(JSObject* object,
// Handle call cache miss. // Handle call cache miss.
__ bind(&miss); __ bind(&miss);
__ DecrementCounter(&Counters::call_global_inline, 1);
__ IncrementCounter(&Counters::call_global_inline_miss, 1); __ IncrementCounter(&Counters::call_global_inline_miss, 1);
Handle<Code> ic = ComputeCallMiss(arguments().immediate()); Handle<Code> ic = ComputeCallMiss(arguments().immediate());
__ Jump(ic, RelocInfo::CODE_TARGET); __ Jump(ic, RelocInfo::CODE_TARGET);
...@@ -378,8 +376,6 @@ Object* LoadStubCompiler::CompileLoadGlobal(JSObject* object, ...@@ -378,8 +376,6 @@ Object* LoadStubCompiler::CompileLoadGlobal(JSObject* object,
// ----------------------------------- // -----------------------------------
Label miss; Label miss;
__ IncrementCounter(&Counters::named_load_global_inline, 1);
// Get the receiver from the stack. // Get the receiver from the stack.
__ movq(rax, Operand(rsp, kPointerSize)); __ movq(rax, Operand(rsp, kPointerSize));
...@@ -407,10 +403,10 @@ Object* LoadStubCompiler::CompileLoadGlobal(JSObject* object, ...@@ -407,10 +403,10 @@ Object* LoadStubCompiler::CompileLoadGlobal(JSObject* object,
__ Check(not_equal, "DontDelete cells can't contain the hole"); __ Check(not_equal, "DontDelete cells can't contain the hole");
} }
__ IncrementCounter(&Counters::named_load_global_inline, 1);
__ ret(0); __ ret(0);
__ bind(&miss); __ bind(&miss);
__ DecrementCounter(&Counters::named_load_global_inline, 1);
__ IncrementCounter(&Counters::named_load_global_inline_miss, 1); __ IncrementCounter(&Counters::named_load_global_inline_miss, 1);
GenerateLoadMiss(masm(), Code::LOAD_IC); GenerateLoadMiss(masm(), Code::LOAD_IC);
...@@ -534,8 +530,8 @@ Object* StoreStubCompiler::CompileStoreGlobal(GlobalObject* object, ...@@ -534,8 +530,8 @@ Object* StoreStubCompiler::CompileStoreGlobal(GlobalObject* object,
__ Move(rcx, Handle<JSGlobalPropertyCell>(cell)); __ Move(rcx, Handle<JSGlobalPropertyCell>(cell));
__ movq(FieldOperand(rcx, JSGlobalPropertyCell::kValueOffset), rax); __ movq(FieldOperand(rcx, JSGlobalPropertyCell::kValueOffset), rax);
__ IncrementCounter(&Counters::named_store_global_inline, 1);
// Return the value (register rax). // Return the value (register rax).
__ IncrementCounter(&Counters::named_store_global_inline, 1);
__ ret(0); __ ret(0);
// Handle store cache miss. // Handle store cache miss.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment