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

Side by Side Diff: src/mips/lithium-codegen-mips.cc

Issue 11106012: Consistently make the bounds check for AccessArgumentsAt explicit. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 2 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/ia32/lithium-ia32.cc ('k') | src/mips/lithium-mips.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 2594 matching lines...) Expand 10 before | Expand all | Expand 10 after
2605 __ lw(to_reg, FieldMemOperand(from_reg, 2605 __ lw(to_reg, FieldMemOperand(from_reg,
2606 ExternalArray::kExternalPointerOffset)); 2606 ExternalArray::kExternalPointerOffset));
2607 } 2607 }
2608 2608
2609 2609
2610 void LCodeGen::DoAccessArgumentsAt(LAccessArgumentsAt* instr) { 2610 void LCodeGen::DoAccessArgumentsAt(LAccessArgumentsAt* instr) {
2611 Register arguments = ToRegister(instr->arguments()); 2611 Register arguments = ToRegister(instr->arguments());
2612 Register length = ToRegister(instr->length()); 2612 Register length = ToRegister(instr->length());
2613 Register index = ToRegister(instr->index()); 2613 Register index = ToRegister(instr->index());
2614 Register result = ToRegister(instr->result()); 2614 Register result = ToRegister(instr->result());
2615
2616 // Bailout index is not a valid argument index. Use unsigned check to get
2617 // negative check for free.
2618
2619 // TODO(plind): Shoud be optimized to do the sub before the DeoptimizeIf(),
2620 // as they do in Arm. It will save us an instruction.
2621 DeoptimizeIf(ls, instr->environment(), length, Operand(index));
2622
2623 // There are two words between the frame pointer and the last argument. 2615 // There are two words between the frame pointer and the last argument.
2624 // Subtracting from length accounts for one of them, add one more. 2616 // Subtracting from length accounts for one of them, add one more.
2625 __ subu(length, length, index); 2617 __ subu(length, length, index);
2626 __ Addu(length, length, Operand(1)); 2618 __ Addu(length, length, Operand(1));
2627 __ sll(length, length, kPointerSizeLog2); 2619 __ sll(length, length, kPointerSizeLog2);
2628 __ Addu(at, arguments, Operand(length)); 2620 __ Addu(at, arguments, Operand(length));
2629 __ lw(result, MemOperand(at, 0)); 2621 __ lw(result, MemOperand(at, 0));
2630 } 2622 }
2631 2623
2632 2624
(...skipping 2815 matching lines...) Expand 10 before | Expand all | Expand 10 after
5448 __ Subu(scratch, result, scratch); 5440 __ Subu(scratch, result, scratch);
5449 __ lw(result, FieldMemOperand(scratch, 5441 __ lw(result, FieldMemOperand(scratch,
5450 FixedArray::kHeaderSize - kPointerSize)); 5442 FixedArray::kHeaderSize - kPointerSize));
5451 __ bind(&done); 5443 __ bind(&done);
5452 } 5444 }
5453 5445
5454 5446
5455 #undef __ 5447 #undef __
5456 5448
5457 } } // namespace v8::internal 5449 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ia32/lithium-ia32.cc ('k') | src/mips/lithium-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698