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

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

Issue 1606019: Make binary op stubs in both r0-r1 and r1-r0 versions to reduce... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 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 unified diff | Download patch | Annotate | Revision Log
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 995 matching lines...) Expand 10 before | Expand all | Expand 10 after
1006 void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) { 1006 void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) {
1007 SetSourcePosition(prop->position()); 1007 SetSourcePosition(prop->position());
1008 Handle<Code> ic(Builtins::builtin(Builtins::KeyedLoadIC_Initialize)); 1008 Handle<Code> ic(Builtins::builtin(Builtins::KeyedLoadIC_Initialize));
1009 __ Call(ic, RelocInfo::CODE_TARGET); 1009 __ Call(ic, RelocInfo::CODE_TARGET);
1010 } 1010 }
1011 1011
1012 1012
1013 void FullCodeGenerator::EmitBinaryOp(Token::Value op, 1013 void FullCodeGenerator::EmitBinaryOp(Token::Value op,
1014 Expression::Context context) { 1014 Expression::Context context) {
1015 __ pop(r1); 1015 __ pop(r1);
1016 GenericBinaryOpStub stub(op, NO_OVERWRITE); 1016 GenericBinaryOpStub stub(op, NO_OVERWRITE, r1, r0);
1017 __ CallStub(&stub); 1017 __ CallStub(&stub);
1018 Apply(context, r0); 1018 Apply(context, r0);
1019 } 1019 }
1020 1020
1021 1021
1022 void FullCodeGenerator::EmitVariableAssignment(Variable* var, 1022 void FullCodeGenerator::EmitVariableAssignment(Variable* var,
1023 Expression::Context context) { 1023 Expression::Context context) {
1024 // Three main cases: global variables, lookup slots, and all other 1024 // Three main cases: global variables, lookup slots, and all other
1025 // types of slots. Left-hand-side parameters that rewrite to 1025 // types of slots. Left-hand-side parameters that rewrite to
1026 // explicit property accesses do not reach here. 1026 // explicit property accesses do not reach here.
(...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after
1602 // the first smi check before calling ToNumber. 1602 // the first smi check before calling ToNumber.
1603 __ tst(r0, Operand(kSmiTagMask)); 1603 __ tst(r0, Operand(kSmiTagMask));
1604 __ b(eq, &done); 1604 __ b(eq, &done);
1605 __ bind(&stub_call); 1605 __ bind(&stub_call);
1606 // Call stub. Undo operation first. 1606 // Call stub. Undo operation first.
1607 __ sub(r0, r0, Operand(r1)); 1607 __ sub(r0, r0, Operand(r1));
1608 } 1608 }
1609 __ mov(r1, Operand(expr->op() == Token::INC 1609 __ mov(r1, Operand(expr->op() == Token::INC
1610 ? Smi::FromInt(1) 1610 ? Smi::FromInt(1)
1611 : Smi::FromInt(-1))); 1611 : Smi::FromInt(-1)));
1612 GenericBinaryOpStub stub(Token::ADD, NO_OVERWRITE); 1612 GenericBinaryOpStub stub(Token::ADD, NO_OVERWRITE, r1, r0);
1613 __ CallStub(&stub); 1613 __ CallStub(&stub);
1614 __ bind(&done); 1614 __ bind(&done);
1615 1615
1616 // Store the value returned in r0. 1616 // Store the value returned in r0.
1617 switch (assign_type) { 1617 switch (assign_type) {
1618 case VARIABLE: 1618 case VARIABLE:
1619 if (expr->is_postfix()) { 1619 if (expr->is_postfix()) {
1620 EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(), 1620 EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(),
1621 Expression::kEffect); 1621 Expression::kEffect);
1622 // For all contexts except kEffect: We have the result on 1622 // For all contexts except kEffect: We have the result on
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
1857 __ pop(result_register()); 1857 __ pop(result_register());
1858 ASSERT_EQ(1, kSmiTagSize + kSmiShiftSize); 1858 ASSERT_EQ(1, kSmiTagSize + kSmiShiftSize);
1859 __ mov(r1, Operand(r1, ASR, 1)); // Un-smi-tag value. 1859 __ mov(r1, Operand(r1, ASR, 1)); // Un-smi-tag value.
1860 __ add(pc, r1, Operand(masm_->CodeObject())); 1860 __ add(pc, r1, Operand(masm_->CodeObject()));
1861 } 1861 }
1862 1862
1863 1863
1864 #undef __ 1864 #undef __
1865 1865
1866 } } // namespace v8::internal 1866 } } // namespace v8::internal
OLDNEW
« src/arm/codegen-arm.cc ('K') | « src/arm/codegen-arm.cc ('k') | src/arm/simulator-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698