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

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: 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
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 HBoundsCheck::AddToGraph(this, array_length, max_alloc_size,
181 DONT_ALLOW_SMI_KEY, Representation::Integer32());
181 182
182 current_block()->UpdateEnvironment(new(zone) HEnvironment(zone)); 183 current_block()->UpdateEnvironment(new(zone) HEnvironment(zone));
183 184
184 IfBuilder if_builder(this); 185 IfBuilder if_builder(this);
185 186
186 if_builder.BeginTrue(array_length, graph()->GetConstant0(), Token::EQ); 187 if_builder.BeginTrue(array_length, graph()->GetConstant0(), Token::EQ);
187 188
188 // Nothing to do, just change the map. 189 // Nothing to do, just change the map.
189 190
190 if_builder.BeginFalse(); 191 if_builder.BeginFalse();
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 245
245 246
246 Handle<Code> TransitionElementsKindStub::GenerateCode() { 247 Handle<Code> TransitionElementsKindStub::GenerateCode() {
247 CodeStubGraphBuilder<TransitionElementsKindStub> builder(this); 248 CodeStubGraphBuilder<TransitionElementsKindStub> builder(this);
248 LChunk* chunk = OptimizeGraph(builder.CreateGraph()); 249 LChunk* chunk = OptimizeGraph(builder.CreateGraph());
249 return chunk->Codegen(Code::COMPILED_STUB); 250 return chunk->Codegen(Code::COMPILED_STUB);
250 } 251 }
251 252
252 253
253 } } // namespace v8::internal 254 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/lithium-codegen-arm.cc ('k') | src/hydrogen.cc » ('j') | src/hydrogen-instructions.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698