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

Side by Side Diff: src/x64/lithium-codegen-x64.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 4054 matching lines...) Expand 10 before | Expand all | Expand 10 after
4065 ASSERT(ToRegister(instr->value()).is(rax)); 4065 ASSERT(ToRegister(instr->value()).is(rax));
4066 4066
4067 __ Move(rcx, instr->hydrogen()->name()); 4067 __ Move(rcx, instr->hydrogen()->name());
4068 Handle<Code> ic = (instr->strict_mode_flag() == kStrictMode) 4068 Handle<Code> ic = (instr->strict_mode_flag() == kStrictMode)
4069 ? isolate()->builtins()->StoreIC_Initialize_Strict() 4069 ? isolate()->builtins()->StoreIC_Initialize_Strict()
4070 : isolate()->builtins()->StoreIC_Initialize(); 4070 : isolate()->builtins()->StoreIC_Initialize();
4071 CallCode(ic, RelocInfo::CODE_TARGET, instr); 4071 CallCode(ic, RelocInfo::CODE_TARGET, instr);
4072 } 4072 }
4073 4073
4074 4074
4075 void LCodeGen::ApplyCheckIf(Condition cc, LBoundsCheck* check) {
4076 if (FLAG_debug_code && check->hydrogen()->skip_check()) {
4077 Label done;
4078 __ j(NegateCondition(cc), &done, Label::kNear);
4079 __ int3();
4080 __ bind(&done);
4081 } else {
4082 DeoptimizeIf(cc, check->environment());
4083 }
4084 }
4085
4086
4075 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { 4087 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) {
4076 if (instr->hydrogen()->skip_check()) return; 4088 if (instr->hydrogen()->skip_check()) return;
4077 4089
4078 if (instr->length()->IsRegister()) { 4090 if (instr->length()->IsRegister()) {
4079 Register reg = ToRegister(instr->length()); 4091 Register reg = ToRegister(instr->length());
4080 if (!instr->hydrogen()->length()->representation().IsSmi()) { 4092 if (!instr->hydrogen()->length()->representation().IsSmi()) {
4081 __ AssertZeroExtended(reg); 4093 __ AssertZeroExtended(reg);
4082 } 4094 }
4083 if (instr->index()->IsConstantOperand()) { 4095 if (instr->index()->IsConstantOperand()) {
4084 int constant_index = 4096 int constant_index =
(...skipping 17 matching lines...) Expand all
4102 ToInteger32(LConstantOperand::cast(instr->index())); 4114 ToInteger32(LConstantOperand::cast(instr->index()));
4103 if (instr->hydrogen()->length()->representation().IsSmi()) { 4115 if (instr->hydrogen()->length()->representation().IsSmi()) {
4104 __ Cmp(length, Smi::FromInt(constant_index)); 4116 __ Cmp(length, Smi::FromInt(constant_index));
4105 } else { 4117 } else {
4106 __ cmpq(length, Immediate(constant_index)); 4118 __ cmpq(length, Immediate(constant_index));
4107 } 4119 }
4108 } else { 4120 } else {
4109 __ cmpq(length, ToRegister(instr->index())); 4121 __ cmpq(length, ToRegister(instr->index()));
4110 } 4122 }
4111 } 4123 }
4112 DeoptimizeIf(below_equal, instr->environment()); 4124 Condition condition =
4125 instr->hydrogen()->allow_equality() ? below : below_equal;
4126 ApplyCheckIf(condition, instr);
4113 } 4127 }
4114 4128
4115 4129
4116 void LCodeGen::DoStoreKeyedExternalArray(LStoreKeyed* instr) { 4130 void LCodeGen::DoStoreKeyedExternalArray(LStoreKeyed* instr) {
4117 ElementsKind elements_kind = instr->elements_kind(); 4131 ElementsKind elements_kind = instr->elements_kind();
4118 LOperand* key = instr->key(); 4132 LOperand* key = instr->key();
4119 if (!key->IsConstantOperand()) { 4133 if (!key->IsConstantOperand()) {
4120 Register key_reg = ToRegister(key); 4134 Register key_reg = ToRegister(key);
4121 // Even though the HLoad/StoreKeyedFastElement instructions force 4135 // Even though the HLoad/StoreKeyedFastElement instructions force
4122 // the input representation for the key to be an integer, the input 4136 // the input representation for the key to be an integer, the input
(...skipping 1482 matching lines...) Expand 10 before | Expand all | Expand 10 after
5605 FixedArray::kHeaderSize - kPointerSize)); 5619 FixedArray::kHeaderSize - kPointerSize));
5606 __ bind(&done); 5620 __ bind(&done);
5607 } 5621 }
5608 5622
5609 5623
5610 #undef __ 5624 #undef __
5611 5625
5612 } } // namespace v8::internal 5626 } } // namespace v8::internal
5613 5627
5614 #endif // V8_TARGET_ARCH_X64 5628 #endif // V8_TARGET_ARCH_X64
OLDNEW
« src/flag-definitions.h ('K') | « src/x64/lithium-codegen-x64.h ('k') | tools/gyp/v8.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698