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

Side by Side Diff: src/code-stubs-hydrogen.cc

Issue 12208013: Separated smi check from HBoundsCheck. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Removed platform specific code. Created 7 years, 10 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/arm/lithium-codegen-arm.cc ('k') | src/hydrogen.h » ('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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 HType::Smi())); 170 HType::Smi()));
171 171
172 Heap* heap = isolate()->heap(); 172 Heap* heap = isolate()->heap();
173 const int kMinFreeNewSpaceAfterGC = 173 const int kMinFreeNewSpaceAfterGC =
174 ((heap->InitialSemiSpaceSize() - sizeof(FixedArrayBase)) / 2) / 174 ((heap->InitialSemiSpaceSize() - sizeof(FixedArrayBase)) / 2) /
175 kDoubleSize; 175 kDoubleSize;
176 176
177 HConstant* max_alloc_size = 177 HConstant* max_alloc_size =
178 new(zone) HConstant(kMinFreeNewSpaceAfterGC, Representation::Integer32()); 178 new(zone) HConstant(kMinFreeNewSpaceAfterGC, Representation::Integer32());
179 AddInstruction(max_alloc_size); 179 AddInstruction(max_alloc_size);
180 AddInstruction(new(zone) HBoundsCheck(array_length, max_alloc_size)); 180 // Since we're forcing Integer32 representation for this HBoundsCheck,
181 // there's no need to Smi-check the index.
182 AddInstruction(
183 new(zone) HBoundsCheck(array_length, max_alloc_size,
184 DONT_ALLOW_SMI_KEY, Representation::Integer32()));
181 185
182 current_block()->UpdateEnvironment(new(zone) HEnvironment(zone)); 186 current_block()->UpdateEnvironment(new(zone) HEnvironment(zone));
183 187
184 IfBuilder if_builder(this); 188 IfBuilder if_builder(this);
185 189
186 if_builder.BeginTrue(array_length, graph()->GetConstant0(), Token::EQ); 190 if_builder.BeginTrue(array_length, graph()->GetConstant0(), Token::EQ);
187 191
188 // Nothing to do, just change the map. 192 // Nothing to do, just change the map.
189 193
190 if_builder.BeginFalse(); 194 if_builder.BeginFalse();
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 248
245 249
246 Handle<Code> TransitionElementsKindStub::GenerateCode() { 250 Handle<Code> TransitionElementsKindStub::GenerateCode() {
247 CodeStubGraphBuilder<TransitionElementsKindStub> builder(this); 251 CodeStubGraphBuilder<TransitionElementsKindStub> builder(this);
248 LChunk* chunk = OptimizeGraph(builder.CreateGraph()); 252 LChunk* chunk = OptimizeGraph(builder.CreateGraph());
249 return chunk->Codegen(Code::COMPILED_STUB); 253 return chunk->Codegen(Code::COMPILED_STUB);
250 } 254 }
251 255
252 256
253 } } // namespace v8::internal 257 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/lithium-codegen-arm.cc ('k') | src/hydrogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698