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

Side by Side Diff: src/x64/macro-assembler-x64.cc

Issue 9015020: Make sure transitioned arrays efficiently call builtin Array functions (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Tweaks Created 8 years, 11 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 2011 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
11 // with the distribution. 11 // with the distribution.
(...skipping 2723 matching lines...) Expand 10 before | Expand all | Expand 10 after
2735 cvtlsi2sd(xmm_scratch, kScratchRegister); 2735 cvtlsi2sd(xmm_scratch, kScratchRegister);
2736 movsd(FieldOperand(elements, index, times_8, FixedDoubleArray::kHeaderSize), 2736 movsd(FieldOperand(elements, index, times_8, FixedDoubleArray::kHeaderSize),
2737 xmm_scratch); 2737 xmm_scratch);
2738 bind(&done); 2738 bind(&done);
2739 } 2739 }
2740 2740
2741 2741
2742 void MacroAssembler::CheckMap(Register obj, 2742 void MacroAssembler::CheckMap(Register obj,
2743 Handle<Map> map, 2743 Handle<Map> map,
2744 Label* fail, 2744 Label* fail,
2745 SmiCheckType smi_check_type) { 2745 SmiCheckType smi_check_type,
2746 MapCheckMode mode) {
2746 if (smi_check_type == DO_SMI_CHECK) { 2747 if (smi_check_type == DO_SMI_CHECK) {
2747 JumpIfSmi(obj, fail); 2748 JumpIfSmi(obj, fail);
2748 } 2749 }
2750
2751 Label success;
2749 Cmp(FieldOperand(obj, HeapObject::kMapOffset), map); 2752 Cmp(FieldOperand(obj, HeapObject::kMapOffset), map);
2753 if (mode == ALLOW_ELEMENT_TRANSITION_MAPS) {
fschneider 2012/01/04 09:20:18 The following code is the same as in lithium-codeg
danno 2012/01/04 10:42:15 Done.
2754 bool ignore;
2755 Map* transitioned_double_map =
2756 map->LookupElementsTransitionMap(FAST_DOUBLE_ELEMENTS, &ignore);
2757 ASSERT(transitioned_double_map == NULL ||
2758 map->elements_kind() == FAST_SMI_ONLY_ELEMENTS);
2759 Map* transitioned_fast_element_map =
2760 map->LookupElementsTransitionMap(FAST_ELEMENTS, &ignore);
2761 ASSERT(transitioned_fast_element_map == NULL ||
2762 map->elements_kind() != FAST_ELEMENTS);
2763 if (transitioned_fast_element_map != NULL) {
2764 j(equal, &success, Label::kNear);
2765 Cmp(FieldOperand(obj, HeapObject::kMapOffset),
2766 Handle<Map>(transitioned_fast_element_map));
2767 }
2768
2769 if (transitioned_double_map != NULL) {
2770 j(equal, &success, Label::kNear);
2771 Cmp(FieldOperand(obj, HeapObject::kMapOffset),
2772 Handle<Map>(transitioned_double_map));
2773 }
2774 }
2750 j(not_equal, fail); 2775 j(not_equal, fail);
2776 bind(&success);
2751 } 2777 }
2752 2778
2753 2779
2754 void MacroAssembler::ClampUint8(Register reg) { 2780 void MacroAssembler::ClampUint8(Register reg) {
2755 Label done; 2781 Label done;
2756 testl(reg, Immediate(0xFFFFFF00)); 2782 testl(reg, Immediate(0xFFFFFF00));
2757 j(zero, &done, Label::kNear); 2783 j(zero, &done, Label::kNear);
2758 setcc(negative, reg); // 1 if negative, 0 if positive. 2784 setcc(negative, reg); // 1 if negative, 0 if positive.
2759 decb(reg); // 0 if negative, 255 if positive. 2785 decb(reg); // 0 if negative, 255 if positive.
2760 bind(&done); 2786 bind(&done);
(...skipping 1518 matching lines...) Expand 10 before | Expand all | Expand 10 after
4279 4305
4280 and_(bitmap_scratch, Immediate(~Page::kPageAlignmentMask)); 4306 and_(bitmap_scratch, Immediate(~Page::kPageAlignmentMask));
4281 addl(Operand(bitmap_scratch, MemoryChunk::kLiveBytesOffset), length); 4307 addl(Operand(bitmap_scratch, MemoryChunk::kLiveBytesOffset), length);
4282 4308
4283 bind(&done); 4309 bind(&done);
4284 } 4310 }
4285 4311
4286 } } // namespace v8::internal 4312 } } // namespace v8::internal
4287 4313
4288 #endif // V8_TARGET_ARCH_X64 4314 #endif // V8_TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698