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 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 Label* allocation_site_info_found) { | 255 Label* allocation_site_info_found) { |
256 // ----------- S t a t e ------------- | 256 // ----------- S t a t e ------------- |
257 // -- rax : value | 257 // -- rax : value |
258 // -- rbx : target map | 258 // -- rbx : target map |
259 // -- rcx : key | 259 // -- rcx : key |
260 // -- rdx : receiver | 260 // -- rdx : receiver |
261 // -- rsp[0] : return address | 261 // -- rsp[0] : return address |
262 // ----------------------------------- | 262 // ----------------------------------- |
263 if (mode == TRACK_ALLOCATION_SITE) { | 263 if (mode == TRACK_ALLOCATION_SITE) { |
264 ASSERT(allocation_site_info_found != NULL); | 264 ASSERT(allocation_site_info_found != NULL); |
265 masm->TestJSArrayForAllocationSiteInfo(rdx, rdi, | 265 __ TestJSArrayForAllocationSiteInfo(rdx, rdi); |
266 allocation_site_info_found); | 266 __ j(equal, allocation_site_info_found); |
267 } | 267 } |
268 | 268 |
269 // Set transitioned map. | 269 // Set transitioned map. |
270 __ movq(FieldOperand(rdx, HeapObject::kMapOffset), rbx); | 270 __ movq(FieldOperand(rdx, HeapObject::kMapOffset), rbx); |
271 __ RecordWriteField(rdx, | 271 __ RecordWriteField(rdx, |
272 HeapObject::kMapOffset, | 272 HeapObject::kMapOffset, |
273 rbx, | 273 rbx, |
274 rdi, | 274 rdi, |
275 kDontSaveFPRegs, | 275 kDontSaveFPRegs, |
276 EMIT_REMEMBERED_SET, | 276 EMIT_REMEMBERED_SET, |
277 OMIT_SMI_CHECK); | 277 OMIT_SMI_CHECK); |
278 } | 278 } |
279 | 279 |
280 | 280 |
281 void ElementsTransitionGenerator::GenerateSmiToDouble( | 281 void ElementsTransitionGenerator::GenerateSmiToDouble( |
282 MacroAssembler* masm, AllocationSiteMode mode, Label* fail) { | 282 MacroAssembler* masm, AllocationSiteMode mode, Label* fail) { |
283 // ----------- S t a t e ------------- | 283 // ----------- S t a t e ------------- |
284 // -- rax : value | 284 // -- rax : value |
285 // -- rbx : target map | 285 // -- rbx : target map |
286 // -- rcx : key | 286 // -- rcx : key |
287 // -- rdx : receiver | 287 // -- rdx : receiver |
288 // -- rsp[0] : return address | 288 // -- rsp[0] : return address |
289 // ----------------------------------- | 289 // ----------------------------------- |
290 // The fail label is not actually used since we do not allocate. | 290 // The fail label is not actually used since we do not allocate. |
291 Label allocated, new_backing_store, only_change_map, done; | 291 Label allocated, new_backing_store, only_change_map, done; |
292 | 292 |
293 if (mode == TRACK_ALLOCATION_SITE) { | 293 if (mode == TRACK_ALLOCATION_SITE) { |
294 masm->TestJSArrayForAllocationSiteInfo(rdx, rdi, fail); | 294 __ TestJSArrayForAllocationSiteInfo(rdx, rdi); |
| 295 __ j(equal, fail); |
295 } | 296 } |
296 | 297 |
297 // Check for empty arrays, which only require a map transition and no changes | 298 // Check for empty arrays, which only require a map transition and no changes |
298 // to the backing store. | 299 // to the backing store. |
299 __ movq(r8, FieldOperand(rdx, JSObject::kElementsOffset)); | 300 __ movq(r8, FieldOperand(rdx, JSObject::kElementsOffset)); |
300 __ CompareRoot(r8, Heap::kEmptyFixedArrayRootIndex); | 301 __ CompareRoot(r8, Heap::kEmptyFixedArrayRootIndex); |
301 __ j(equal, &only_change_map); | 302 __ j(equal, &only_change_map); |
302 | 303 |
303 // Check backing store for COW-ness. For COW arrays we have to | 304 // Check backing store for COW-ness. For COW arrays we have to |
304 // allocate a new backing store. | 305 // allocate a new backing store. |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
409 // ----------- S t a t e ------------- | 410 // ----------- S t a t e ------------- |
410 // -- rax : value | 411 // -- rax : value |
411 // -- rbx : target map | 412 // -- rbx : target map |
412 // -- rcx : key | 413 // -- rcx : key |
413 // -- rdx : receiver | 414 // -- rdx : receiver |
414 // -- rsp[0] : return address | 415 // -- rsp[0] : return address |
415 // ----------------------------------- | 416 // ----------------------------------- |
416 Label loop, entry, convert_hole, gc_required, only_change_map; | 417 Label loop, entry, convert_hole, gc_required, only_change_map; |
417 | 418 |
418 if (mode == TRACK_ALLOCATION_SITE) { | 419 if (mode == TRACK_ALLOCATION_SITE) { |
419 masm->TestJSArrayForAllocationSiteInfo(rdx, rdi, fail); | 420 __ TestJSArrayForAllocationSiteInfo(rdx, rdi); |
| 421 __ j(equal, fail); |
420 } | 422 } |
421 | 423 |
422 // Check for empty arrays, which only require a map transition and no changes | 424 // Check for empty arrays, which only require a map transition and no changes |
423 // to the backing store. | 425 // to the backing store. |
424 __ movq(r8, FieldOperand(rdx, JSObject::kElementsOffset)); | 426 __ movq(r8, FieldOperand(rdx, JSObject::kElementsOffset)); |
425 __ CompareRoot(r8, Heap::kEmptyFixedArrayRootIndex); | 427 __ CompareRoot(r8, Heap::kEmptyFixedArrayRootIndex); |
426 __ j(equal, &only_change_map); | 428 __ j(equal, &only_change_map); |
427 | 429 |
428 __ push(rax); | 430 __ push(rax); |
429 | 431 |
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
773 CodePatcher patcher(sequence, young_length); | 775 CodePatcher patcher(sequence, young_length); |
774 patcher.masm()->call(stub->instruction_start()); | 776 patcher.masm()->call(stub->instruction_start()); |
775 patcher.masm()->nop(); | 777 patcher.masm()->nop(); |
776 } | 778 } |
777 } | 779 } |
778 | 780 |
779 | 781 |
780 } } // namespace v8::internal | 782 } } // namespace v8::internal |
781 | 783 |
782 #endif // V8_TARGET_ARCH_X64 | 784 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |