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

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

Issue 5161002: Change the order of evaluation of sub-expressions for keyed call... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 1 month 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/arm/codegen-arm.cc ('k') | src/ia32/codegen-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 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 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 1692 matching lines...) Expand 10 before | Expand all | Expand 10 after
1703 EmitCallIC(ic, mode); 1703 EmitCallIC(ic, mode);
1704 // Restore context register. 1704 // Restore context register.
1705 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); 1705 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
1706 context()->Plug(r0); 1706 context()->Plug(r0);
1707 } 1707 }
1708 1708
1709 1709
1710 void FullCodeGenerator::EmitKeyedCallWithIC(Call* expr, 1710 void FullCodeGenerator::EmitKeyedCallWithIC(Call* expr,
1711 Expression* key, 1711 Expression* key,
1712 RelocInfo::Mode mode) { 1712 RelocInfo::Mode mode) {
1713 // Load the key.
1714 VisitForAccumulatorValue(key);
1715
1716 // Swap the name of the function and the receiver on the stack to follow
1717 // the calling convention for call ICs.
1718 __ pop(r1);
1719 __ push(r0);
1720 __ push(r1);
1721
1713 // Code common for calls using the IC. 1722 // Code common for calls using the IC.
1714 ZoneList<Expression*>* args = expr->arguments(); 1723 ZoneList<Expression*>* args = expr->arguments();
1715 int arg_count = args->length(); 1724 int arg_count = args->length();
1716 { PreserveStatementPositionScope scope(masm()->positions_recorder()); 1725 { PreserveStatementPositionScope scope(masm()->positions_recorder());
1717 for (int i = 0; i < arg_count; i++) { 1726 for (int i = 0; i < arg_count; i++) {
1718 VisitForStackValue(args->at(i)); 1727 VisitForStackValue(args->at(i));
1719 } 1728 }
1720 VisitForAccumulatorValue(key);
1721 __ mov(r2, r0);
1722 } 1729 }
1723 // Record source position for debugger. 1730 // Record source position for debugger.
1724 SetSourcePosition(expr->position(), FORCED_POSITION); 1731 SetSourcePosition(expr->position(), FORCED_POSITION);
1725 // Call the IC initialization code. 1732 // Call the IC initialization code.
1726 InLoopFlag in_loop = (loop_depth() > 0) ? IN_LOOP : NOT_IN_LOOP; 1733 InLoopFlag in_loop = (loop_depth() > 0) ? IN_LOOP : NOT_IN_LOOP;
1727 Handle<Code> ic = StubCache::ComputeKeyedCallInitialize(arg_count, in_loop); 1734 Handle<Code> ic = StubCache::ComputeKeyedCallInitialize(arg_count, in_loop);
1735 __ ldr(r2, MemOperand(sp, (arg_count + 1) * kPointerSize)); // Key.
1728 EmitCallIC(ic, mode); 1736 EmitCallIC(ic, mode);
1729 // Restore context register. 1737 // Restore context register.
1730 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); 1738 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
1731 context()->Plug(r0); 1739 context()->DropAndPlug(1, r0); // Drop the key still on the stack.
1732 } 1740 }
1733 1741
1734 1742
1735 void FullCodeGenerator::EmitCallWithStub(Call* expr) { 1743 void FullCodeGenerator::EmitCallWithStub(Call* expr) {
1736 // Code common for calls using the call stub. 1744 // Code common for calls using the call stub.
1737 ZoneList<Expression*>* args = expr->arguments(); 1745 ZoneList<Expression*>* args = expr->arguments();
1738 int arg_count = args->length(); 1746 int arg_count = args->length();
1739 { PreserveStatementPositionScope scope(masm()->positions_recorder()); 1747 { PreserveStatementPositionScope scope(masm()->positions_recorder());
1740 for (int i = 0; i < arg_count; i++) { 1748 for (int i = 0; i < arg_count; i++) {
1741 VisitForStackValue(args->at(i)); 1749 VisitForStackValue(args->at(i));
(...skipping 1679 matching lines...) Expand 10 before | Expand all | Expand 10 after
3421 __ mov(r1, Operand(r1, ASR, 1)); // Un-smi-tag value. 3429 __ mov(r1, Operand(r1, ASR, 1)); // Un-smi-tag value.
3422 __ add(pc, r1, Operand(masm_->CodeObject())); 3430 __ add(pc, r1, Operand(masm_->CodeObject()));
3423 } 3431 }
3424 3432
3425 3433
3426 #undef __ 3434 #undef __
3427 3435
3428 } } // namespace v8::internal 3436 } } // namespace v8::internal
3429 3437
3430 #endif // V8_TARGET_ARCH_ARM 3438 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/codegen-arm.cc ('k') | src/ia32/codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698