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

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

Issue 13693004: Refactoring BuildAllocateElements. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 8 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 | « no previous file | 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 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 302
303 if_builder.BeginElse(); 303 if_builder.BeginElse();
304 304
305 HInstruction* elements = 305 HInstruction* elements =
306 AddInstruction(new(zone) HLoadElements(js_array, js_array)); 306 AddInstruction(new(zone) HLoadElements(js_array, js_array));
307 307
308 HInstruction* elements_length = 308 HInstruction* elements_length =
309 AddInstruction(new(zone) HFixedArrayBaseLength(elements)); 309 AddInstruction(new(zone) HFixedArrayBaseLength(elements));
310 310
311 HValue* new_elements = 311 HValue* new_elements =
312 BuildAllocateElements(context(), to_kind, elements_length); 312 BuildAllocateAndInitializeElements(context(), to_kind, elements_length);
313 313
314 BuildCopyElements(context(), elements, 314 BuildCopyElements(context(), elements,
315 casted_stub()->from_kind(), new_elements, 315 casted_stub()->from_kind(), new_elements,
316 to_kind, array_length, elements_length); 316 to_kind, array_length, elements_length);
317 317
318 Factory* factory = isolate()->factory(); 318 Factory* factory = isolate()->factory();
319 319
320 AddInstruction(new(zone) HStoreNamedField(js_array, 320 AddInstruction(new(zone) HStoreNamedField(js_array,
321 factory->elements_field_string(), 321 factory->elements_field_string(),
322 new_elements, true, 322 new_elements, true,
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 current_block()->MarkAsDeoptimizing(); 373 current_block()->MarkAsDeoptimizing();
374 return GetParameter(0); 374 return GetParameter(0);
375 } 375 }
376 376
377 377
378 Handle<Code> ArrayNArgumentsConstructorStub::GenerateCode() { 378 Handle<Code> ArrayNArgumentsConstructorStub::GenerateCode() {
379 return DoGenerateCode(this); 379 return DoGenerateCode(this);
380 } 380 }
381 381
382 } } // namespace v8::internal 382 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/hydrogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698