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

Side by Side Diff: src/ia32/lithium-codegen-ia32.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/hydrogen.cc ('k') | src/ia32/lithium-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 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 2724 matching lines...) Expand 10 before | Expand all | Expand 10 after
2735 __ mov(result, FieldOperand(input, 2735 __ mov(result, FieldOperand(input,
2736 ExternalArray::kExternalPointerOffset)); 2736 ExternalArray::kExternalPointerOffset));
2737 } 2737 }
2738 2738
2739 2739
2740 void LCodeGen::DoAccessArgumentsAt(LAccessArgumentsAt* instr) { 2740 void LCodeGen::DoAccessArgumentsAt(LAccessArgumentsAt* instr) {
2741 Register arguments = ToRegister(instr->arguments()); 2741 Register arguments = ToRegister(instr->arguments());
2742 Register length = ToRegister(instr->length()); 2742 Register length = ToRegister(instr->length());
2743 Operand index = ToOperand(instr->index()); 2743 Operand index = ToOperand(instr->index());
2744 Register result = ToRegister(instr->result()); 2744 Register result = ToRegister(instr->result());
2745
2746 __ sub(length, index);
2747 DeoptimizeIf(below_equal, instr->environment());
2748
2749 // There are two words between the frame pointer and the last argument. 2745 // There are two words between the frame pointer and the last argument.
2750 // Subtracting from length accounts for one of them add one more. 2746 // Subtracting from length accounts for one of them add one more.
2747 __ sub(length, index);
2751 __ mov(result, Operand(arguments, length, times_4, kPointerSize)); 2748 __ mov(result, Operand(arguments, length, times_4, kPointerSize));
2752 } 2749 }
2753 2750
2754 2751
2755 void LCodeGen::DoLoadKeyedFastElement(LLoadKeyedFastElement* instr) { 2752 void LCodeGen::DoLoadKeyedFastElement(LLoadKeyedFastElement* instr) {
2756 Register result = ToRegister(instr->result()); 2753 Register result = ToRegister(instr->result());
2757 2754
2758 // Load the result. 2755 // Load the result.
2759 __ mov(result, 2756 __ mov(result,
2760 BuildFastArrayOperand(instr->elements(), 2757 BuildFastArrayOperand(instr->elements(),
(...skipping 2779 matching lines...) Expand 10 before | Expand all | Expand 10 after
5540 FixedArray::kHeaderSize - kPointerSize)); 5537 FixedArray::kHeaderSize - kPointerSize));
5541 __ bind(&done); 5538 __ bind(&done);
5542 } 5539 }
5543 5540
5544 5541
5545 #undef __ 5542 #undef __
5546 5543
5547 } } // namespace v8::internal 5544 } } // namespace v8::internal
5548 5545
5549 #endif // V8_TARGET_ARCH_IA32 5546 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/hydrogen.cc ('k') | src/ia32/lithium-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698