OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |