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

Side by Side Diff: src/arm/lithium-codegen-arm.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: Reimplemented CheckHoistability with no recursive calls. 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 4293 matching lines...) Expand 10 before | Expand all | Expand 10 after
4304 4304
4305 // Name is always in r2. 4305 // Name is always in r2.
4306 __ mov(r2, Operand(instr->name())); 4306 __ mov(r2, Operand(instr->name()));
4307 Handle<Code> ic = (instr->strict_mode_flag() == kStrictMode) 4307 Handle<Code> ic = (instr->strict_mode_flag() == kStrictMode)
4308 ? isolate()->builtins()->StoreIC_Initialize_Strict() 4308 ? isolate()->builtins()->StoreIC_Initialize_Strict()
4309 : isolate()->builtins()->StoreIC_Initialize(); 4309 : isolate()->builtins()->StoreIC_Initialize();
4310 CallCode(ic, RelocInfo::CODE_TARGET, instr, NEVER_INLINE_TARGET_ADDRESS); 4310 CallCode(ic, RelocInfo::CODE_TARGET, instr, NEVER_INLINE_TARGET_ADDRESS);
4311 } 4311 }
4312 4312
4313 4313
4314 void LCodeGen::ApplyCheckIf(Condition cc, LBoundsCheck* check) {
4315 if (FLAG_debug_code && check->hydrogen()->skip_check()) {
4316 Label done;
4317 __ b(NegateCondition(cc), &done);
4318 __ stop("eliminated bounds check failed");
4319 __ bind(&done);
4320 } else {
4321 DeoptimizeIf(cc, check->environment());
4322 }
4323 }
4324
4325
4314 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { 4326 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) {
4315 if (instr->hydrogen()->skip_check()) return; 4327 if (instr->hydrogen()->skip_check()) return;
4316 4328
4317 if (instr->index()->IsConstantOperand()) { 4329 if (instr->index()->IsConstantOperand()) {
4318 int constant_index = 4330 int constant_index =
4319 ToInteger32(LConstantOperand::cast(instr->index())); 4331 ToInteger32(LConstantOperand::cast(instr->index()));
4320 if (instr->hydrogen()->length()->representation().IsSmi()) { 4332 if (instr->hydrogen()->length()->representation().IsSmi()) {
4321 __ mov(ip, Operand(Smi::FromInt(constant_index))); 4333 __ mov(ip, Operand(Smi::FromInt(constant_index)));
4322 } else { 4334 } else {
4323 __ mov(ip, Operand(constant_index)); 4335 __ mov(ip, Operand(constant_index));
4324 } 4336 }
4325 __ cmp(ip, ToRegister(instr->length())); 4337 __ cmp(ip, ToRegister(instr->length()));
4326 } else { 4338 } else {
4327 __ cmp(ToRegister(instr->index()), ToRegister(instr->length())); 4339 __ cmp(ToRegister(instr->index()), ToRegister(instr->length()));
4328 } 4340 }
4329 DeoptimizeIf(hs, instr->environment()); 4341 Condition condition = instr->hydrogen()->allow_equality() ? hi : hs;
4342 ApplyCheckIf(condition, instr);
4330 } 4343 }
4331 4344
4332 4345
4333 void LCodeGen::DoStoreKeyedExternalArray(LStoreKeyed* instr) { 4346 void LCodeGen::DoStoreKeyedExternalArray(LStoreKeyed* instr) {
4334 Register external_pointer = ToRegister(instr->elements()); 4347 Register external_pointer = ToRegister(instr->elements());
4335 Register key = no_reg; 4348 Register key = no_reg;
4336 ElementsKind elements_kind = instr->elements_kind(); 4349 ElementsKind elements_kind = instr->elements_kind();
4337 bool key_is_constant = instr->key()->IsConstantOperand(); 4350 bool key_is_constant = instr->key()->IsConstantOperand();
4338 int constant_key = 0; 4351 int constant_key = 0;
4339 if (key_is_constant) { 4352 if (key_is_constant) {
(...skipping 1540 matching lines...) Expand 10 before | Expand all | Expand 10 after
5880 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); 5893 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index));
5881 __ ldr(result, FieldMemOperand(scratch, 5894 __ ldr(result, FieldMemOperand(scratch,
5882 FixedArray::kHeaderSize - kPointerSize)); 5895 FixedArray::kHeaderSize - kPointerSize));
5883 __ bind(&done); 5896 __ bind(&done);
5884 } 5897 }
5885 5898
5886 5899
5887 #undef __ 5900 #undef __
5888 5901
5889 } } // namespace v8::internal 5902 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/lithium-codegen-arm.h ('k') | src/flag-definitions.h » ('j') | src/flag-definitions.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698