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

Side by Side Diff: src/ia32/full-codegen-ia32.cc

Issue 7869009: Remove in-loop tracking for call ICs. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « src/hydrogen.cc ('k') | src/ia32/ic-ia32.cc » ('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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 1995 matching lines...) Expand 10 before | Expand all | Expand 10 after
2006 ZoneList<Expression*>* args = expr->arguments(); 2006 ZoneList<Expression*>* args = expr->arguments();
2007 int arg_count = args->length(); 2007 int arg_count = args->length();
2008 { PreservePositionScope scope(masm()->positions_recorder()); 2008 { PreservePositionScope scope(masm()->positions_recorder());
2009 for (int i = 0; i < arg_count; i++) { 2009 for (int i = 0; i < arg_count; i++) {
2010 VisitForStackValue(args->at(i)); 2010 VisitForStackValue(args->at(i));
2011 } 2011 }
2012 __ Set(ecx, Immediate(name)); 2012 __ Set(ecx, Immediate(name));
2013 } 2013 }
2014 // Record source position of the IC call. 2014 // Record source position of the IC call.
2015 SetSourcePosition(expr->position()); 2015 SetSourcePosition(expr->position());
2016 InLoopFlag in_loop = (loop_depth() > 0) ? IN_LOOP : NOT_IN_LOOP;
2017 Handle<Code> ic = 2016 Handle<Code> ic =
2018 isolate()->stub_cache()->ComputeCallInitialize(arg_count, in_loop, mode); 2017 isolate()->stub_cache()->ComputeCallInitialize(arg_count, mode);
2019 __ call(ic, mode, expr->id()); 2018 __ call(ic, mode, expr->id());
2020 RecordJSReturnSite(expr); 2019 RecordJSReturnSite(expr);
2021 // Restore context register. 2020 // Restore context register.
2022 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); 2021 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset));
2023 decrement_stack_height(arg_count + 1); 2022 decrement_stack_height(arg_count + 1);
2024 context()->Plug(eax); 2023 context()->Plug(eax);
2025 } 2024 }
2026 2025
2027 2026
2028 void FullCodeGenerator::EmitKeyedCallWithIC(Call* expr, 2027 void FullCodeGenerator::EmitKeyedCallWithIC(Call* expr,
(...skipping 11 matching lines...) Expand all
2040 // Load the arguments. 2039 // Load the arguments.
2041 ZoneList<Expression*>* args = expr->arguments(); 2040 ZoneList<Expression*>* args = expr->arguments();
2042 int arg_count = args->length(); 2041 int arg_count = args->length();
2043 { PreservePositionScope scope(masm()->positions_recorder()); 2042 { PreservePositionScope scope(masm()->positions_recorder());
2044 for (int i = 0; i < arg_count; i++) { 2043 for (int i = 0; i < arg_count; i++) {
2045 VisitForStackValue(args->at(i)); 2044 VisitForStackValue(args->at(i));
2046 } 2045 }
2047 } 2046 }
2048 // Record source position of the IC call. 2047 // Record source position of the IC call.
2049 SetSourcePosition(expr->position()); 2048 SetSourcePosition(expr->position());
2050 InLoopFlag in_loop = (loop_depth() > 0) ? IN_LOOP : NOT_IN_LOOP; 2049 Handle<Code> ic =
2051 Handle<Code> ic = isolate()->stub_cache()->ComputeKeyedCallInitialize( 2050 isolate()->stub_cache()->ComputeKeyedCallInitialize(arg_count);
2052 arg_count, in_loop);
2053 __ mov(ecx, Operand(esp, (arg_count + 1) * kPointerSize)); // Key. 2051 __ mov(ecx, Operand(esp, (arg_count + 1) * kPointerSize)); // Key.
2054 __ call(ic, RelocInfo::CODE_TARGET, expr->id()); 2052 __ call(ic, RelocInfo::CODE_TARGET, expr->id());
2055 RecordJSReturnSite(expr); 2053 RecordJSReturnSite(expr);
2056 // Restore context register. 2054 // Restore context register.
2057 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); 2055 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset));
2058 decrement_stack_height(arg_count + 1); 2056 decrement_stack_height(arg_count + 1);
2059 context()->DropAndPlug(1, eax); // Drop the key still on the stack. 2057 context()->DropAndPlug(1, eax); // Drop the key still on the stack.
2060 } 2058 }
2061 2059
2062 2060
2063 void FullCodeGenerator::EmitCallWithStub(Call* expr, CallFunctionFlags flags) { 2061 void FullCodeGenerator::EmitCallWithStub(Call* expr, CallFunctionFlags flags) {
2064 // Code common for calls using the call stub. 2062 // Code common for calls using the call stub.
2065 ZoneList<Expression*>* args = expr->arguments(); 2063 ZoneList<Expression*>* args = expr->arguments();
2066 int arg_count = args->length(); 2064 int arg_count = args->length();
2067 { PreservePositionScope scope(masm()->positions_recorder()); 2065 { PreservePositionScope scope(masm()->positions_recorder());
2068 for (int i = 0; i < arg_count; i++) { 2066 for (int i = 0; i < arg_count; i++) {
2069 VisitForStackValue(args->at(i)); 2067 VisitForStackValue(args->at(i));
2070 } 2068 }
2071 } 2069 }
2072 // Record source position for debugger. 2070 // Record source position for debugger.
2073 SetSourcePosition(expr->position()); 2071 SetSourcePosition(expr->position());
2074 InLoopFlag in_loop = (loop_depth() > 0) ? IN_LOOP : NOT_IN_LOOP; 2072 CallFunctionStub stub(arg_count, flags);
2075 CallFunctionStub stub(arg_count, in_loop, flags);
2076 __ CallStub(&stub); 2073 __ CallStub(&stub);
2077 RecordJSReturnSite(expr); 2074 RecordJSReturnSite(expr);
2078 // Restore context register. 2075 // Restore context register.
2079 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); 2076 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset));
2080 2077
2081 decrement_stack_height(arg_count + 1); 2078 decrement_stack_height(arg_count + 1);
2082 context()->DropAndPlug(1, eax); 2079 context()->DropAndPlug(1, eax);
2083 } 2080 }
2084 2081
2085 2082
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
2159 EmitResolvePossiblyDirectEval(PERFORM_CONTEXT_LOOKUP, arg_count); 2156 EmitResolvePossiblyDirectEval(PERFORM_CONTEXT_LOOKUP, arg_count);
2160 __ bind(&done); 2157 __ bind(&done);
2161 2158
2162 // The runtime call returns a pair of values in eax (function) and 2159 // The runtime call returns a pair of values in eax (function) and
2163 // edx (receiver). Touch up the stack with the right values. 2160 // edx (receiver). Touch up the stack with the right values.
2164 __ mov(Operand(esp, (arg_count + 0) * kPointerSize), edx); 2161 __ mov(Operand(esp, (arg_count + 0) * kPointerSize), edx);
2165 __ mov(Operand(esp, (arg_count + 1) * kPointerSize), eax); 2162 __ mov(Operand(esp, (arg_count + 1) * kPointerSize), eax);
2166 } 2163 }
2167 // Record source position for debugger. 2164 // Record source position for debugger.
2168 SetSourcePosition(expr->position()); 2165 SetSourcePosition(expr->position());
2169 InLoopFlag in_loop = (loop_depth() > 0) ? IN_LOOP : NOT_IN_LOOP; 2166 CallFunctionStub stub(arg_count, RECEIVER_MIGHT_BE_IMPLICIT);
2170 CallFunctionStub stub(arg_count, in_loop, RECEIVER_MIGHT_BE_IMPLICIT);
2171 __ CallStub(&stub); 2167 __ CallStub(&stub);
2172 RecordJSReturnSite(expr); 2168 RecordJSReturnSite(expr);
2173 // Restore context register. 2169 // Restore context register.
2174 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); 2170 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset));
2175 decrement_stack_height(arg_count + 1); // Function is left on the stack. 2171 decrement_stack_height(arg_count + 1); // Function is left on the stack.
2176 context()->DropAndPlug(1, eax); 2172 context()->DropAndPlug(1, eax);
2177 2173
2178 } else if (proxy != NULL && proxy->var()->IsUnallocated()) { 2174 } else if (proxy != NULL && proxy->var()->IsUnallocated()) {
2179 // Push global object as receiver for the call IC. 2175 // Push global object as receiver for the call IC.
2180 __ push(GlobalObjectOperand()); 2176 __ push(GlobalObjectOperand());
(...skipping 1394 matching lines...) Expand 10 before | Expand all | Expand 10 after
3575 3571
3576 // Push the arguments ("left-to-right"). 3572 // Push the arguments ("left-to-right").
3577 int arg_count = args->length(); 3573 int arg_count = args->length();
3578 for (int i = 0; i < arg_count; i++) { 3574 for (int i = 0; i < arg_count; i++) {
3579 VisitForStackValue(args->at(i)); 3575 VisitForStackValue(args->at(i));
3580 } 3576 }
3581 3577
3582 if (expr->is_jsruntime()) { 3578 if (expr->is_jsruntime()) {
3583 // Call the JS runtime function via a call IC. 3579 // Call the JS runtime function via a call IC.
3584 __ Set(ecx, Immediate(expr->name())); 3580 __ Set(ecx, Immediate(expr->name()));
3585 InLoopFlag in_loop = (loop_depth() > 0) ? IN_LOOP : NOT_IN_LOOP;
3586 RelocInfo::Mode mode = RelocInfo::CODE_TARGET; 3581 RelocInfo::Mode mode = RelocInfo::CODE_TARGET;
3587 Handle<Code> ic = isolate()->stub_cache()->ComputeCallInitialize( 3582 Handle<Code> ic =
3588 arg_count, in_loop, mode); 3583 isolate()->stub_cache()->ComputeCallInitialize(arg_count, mode);
3589 __ call(ic, mode, expr->id()); 3584 __ call(ic, mode, expr->id());
3590 // Restore context register. 3585 // Restore context register.
3591 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); 3586 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset));
3592 } else { 3587 } else {
3593 // Call the C runtime function. 3588 // Call the C runtime function.
3594 __ CallRuntime(expr->function(), arg_count); 3589 __ CallRuntime(expr->function(), arg_count);
3595 } 3590 }
3596 decrement_stack_height(arg_count); 3591 decrement_stack_height(arg_count);
3597 if (expr->is_jsruntime()) { 3592 if (expr->is_jsruntime()) {
3598 decrement_stack_height(); 3593 decrement_stack_height();
(...skipping 682 matching lines...) Expand 10 before | Expand all | Expand 10 after
4281 *context_length = 0; 4276 *context_length = 0;
4282 return previous_; 4277 return previous_;
4283 } 4278 }
4284 4279
4285 4280
4286 #undef __ 4281 #undef __
4287 4282
4288 } } // namespace v8::internal 4283 } } // namespace v8::internal
4289 4284
4290 #endif // V8_TARGET_ARCH_IA32 4285 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/hydrogen.cc ('k') | src/ia32/ic-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698