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

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

Issue 17568015: New array bounds check elimination pass (focused on induction variables and bitwise operations). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Recursive traversal implementation. Created 7 years, 5 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 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 4186 matching lines...) Expand 10 before | Expand all | Expand 10 after
4197 Handle<Code> ic = (instr->strict_mode_flag() == kStrictMode) 4197 Handle<Code> ic = (instr->strict_mode_flag() == kStrictMode)
4198 ? isolate()->builtins()->StoreIC_Initialize_Strict() 4198 ? isolate()->builtins()->StoreIC_Initialize_Strict()
4199 : isolate()->builtins()->StoreIC_Initialize(); 4199 : isolate()->builtins()->StoreIC_Initialize();
4200 CallCode(ic, RelocInfo::CODE_TARGET, instr); 4200 CallCode(ic, RelocInfo::CODE_TARGET, instr);
4201 } 4201 }
4202 4202
4203 4203
4204 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { 4204 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) {
4205 if (instr->hydrogen()->skip_check()) return; 4205 if (instr->hydrogen()->skip_check()) return;
4206 4206
4207 Condition condition = instr->hydrogen()->allow_equality() ? hi : hs;
4207 if (instr->index()->IsConstantOperand()) { 4208 if (instr->index()->IsConstantOperand()) {
4208 int constant_index = 4209 int constant_index =
4209 ToInteger32(LConstantOperand::cast(instr->index())); 4210 ToInteger32(LConstantOperand::cast(instr->index()));
4210 if (instr->hydrogen()->length()->representation().IsSmi()) { 4211 if (instr->hydrogen()->length()->representation().IsSmi()) {
4211 __ li(at, Operand(Smi::FromInt(constant_index))); 4212 __ li(at, Operand(Smi::FromInt(constant_index)));
4212 } else { 4213 } else {
4213 __ li(at, Operand(constant_index)); 4214 __ li(at, Operand(constant_index));
4214 } 4215 }
4215 DeoptimizeIf(hs, 4216 DeoptimizeIf(condition,
4216 instr->environment(), 4217 instr->environment(),
4217 at, 4218 at,
4218 Operand(ToRegister(instr->length()))); 4219 Operand(ToRegister(instr->length())));
4219 } else { 4220 } else {
4220 DeoptimizeIf(hs, 4221 DeoptimizeIf(condition,
4221 instr->environment(), 4222 instr->environment(),
4222 ToRegister(instr->index()), 4223 ToRegister(instr->index()),
4223 Operand(ToRegister(instr->length()))); 4224 Operand(ToRegister(instr->length())));
4224 } 4225 }
4225 } 4226 }
4226 4227
4227 4228
4228 void LCodeGen::DoStoreKeyedExternalArray(LStoreKeyed* instr) { 4229 void LCodeGen::DoStoreKeyedExternalArray(LStoreKeyed* instr) {
4229 Register external_pointer = ToRegister(instr->elements()); 4230 Register external_pointer = ToRegister(instr->elements());
4230 Register key = no_reg; 4231 Register key = no_reg;
(...skipping 1617 matching lines...) Expand 10 before | Expand all | Expand 10 after
5848 __ Subu(scratch, result, scratch); 5849 __ Subu(scratch, result, scratch);
5849 __ lw(result, FieldMemOperand(scratch, 5850 __ lw(result, FieldMemOperand(scratch,
5850 FixedArray::kHeaderSize - kPointerSize)); 5851 FixedArray::kHeaderSize - kPointerSize));
5851 __ bind(&done); 5852 __ bind(&done);
5852 } 5853 }
5853 5854
5854 5855
5855 #undef __ 5856 #undef __
5856 5857
5857 } } // namespace v8::internal 5858 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698