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

Side by Side Diff: src/x64/stub-cache-x64.cc

Issue 9384002: Fix crashes on x64 with smi-only arrays active. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 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 | « no previous file | no next file » | 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 1366 matching lines...) Expand 10 before | Expand all | Expand 10 after
1377 1377
1378 if (FLAG_smi_only_arrays && !FLAG_trace_elements_transitions) { 1378 if (FLAG_smi_only_arrays && !FLAG_trace_elements_transitions) {
1379 Label fast_object, not_fast_object; 1379 Label fast_object, not_fast_object;
1380 __ CheckFastObjectElements(rbx, &not_fast_object, Label::kNear); 1380 __ CheckFastObjectElements(rbx, &not_fast_object, Label::kNear);
1381 __ jmp(&fast_object); 1381 __ jmp(&fast_object);
1382 // In case of fast smi-only, convert to fast object, otherwise bail out. 1382 // In case of fast smi-only, convert to fast object, otherwise bail out.
1383 __ bind(&not_fast_object); 1383 __ bind(&not_fast_object);
1384 __ CheckFastSmiOnlyElements(rbx, &call_builtin); 1384 __ CheckFastSmiOnlyElements(rbx, &call_builtin);
1385 // rdx: receiver 1385 // rdx: receiver
1386 // rbx: map 1386 // rbx: map
1387 __ movq(r9, rdi); // Backup rdi as it is going to be trashed.
1387 __ LoadTransitionedArrayMapConditional(FAST_SMI_ONLY_ELEMENTS, 1388 __ LoadTransitionedArrayMapConditional(FAST_SMI_ONLY_ELEMENTS,
1388 FAST_ELEMENTS, 1389 FAST_ELEMENTS,
1389 rbx, 1390 rbx,
1390 r10, 1391 rdi,
1391 &call_builtin); 1392 &call_builtin);
1392 ElementsTransitionGenerator::GenerateSmiOnlyToObject(masm()); 1393 ElementsTransitionGenerator::GenerateSmiOnlyToObject(masm());
1394 __ movq(rdi, r9);
1393 __ bind(&fast_object); 1395 __ bind(&fast_object);
1394 } else { 1396 } else {
1395 __ CheckFastObjectElements(rbx, &call_builtin); 1397 __ CheckFastObjectElements(rbx, &call_builtin);
1396 } 1398 }
1397 1399
1398 __ CheckFastObjectElements(rbx, &call_builtin);
1399
1400 // Save new length. 1400 // Save new length.
1401 __ Integer32ToSmiField(FieldOperand(rdx, JSArray::kLengthOffset), rax); 1401 __ Integer32ToSmiField(FieldOperand(rdx, JSArray::kLengthOffset), rax);
1402 1402
1403 // Store the value. 1403 // Store the value.
1404 __ lea(rdx, FieldOperand(rdi, 1404 __ lea(rdx, FieldOperand(rdi,
1405 rax, times_pointer_size, 1405 rax, times_pointer_size,
1406 FixedArray::kHeaderSize - argc * kPointerSize)); 1406 FixedArray::kHeaderSize - argc * kPointerSize));
1407 __ movq(Operand(rdx, 0), rcx); 1407 __ movq(Operand(rdx, 0), rcx);
1408 1408
1409 __ RecordWrite(rdi, rdx, rcx, kDontSaveFPRegs, EMIT_REMEMBERED_SET, 1409 __ RecordWrite(rdi, rdx, rcx, kDontSaveFPRegs, EMIT_REMEMBERED_SET,
(...skipping 2198 matching lines...) Expand 10 before | Expand all | Expand 10 after
3608 Handle<Code> ic_miss = masm->isolate()->builtins()->KeyedStoreIC_Miss(); 3608 Handle<Code> ic_miss = masm->isolate()->builtins()->KeyedStoreIC_Miss();
3609 __ jmp(ic_miss, RelocInfo::CODE_TARGET); 3609 __ jmp(ic_miss, RelocInfo::CODE_TARGET);
3610 } 3610 }
3611 3611
3612 3612
3613 #undef __ 3613 #undef __
3614 3614
3615 } } // namespace v8::internal 3615 } } // namespace v8::internal
3616 3616
3617 #endif // V8_TARGET_ARCH_X64 3617 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698