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 2998 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3009 // Preserve original value. | 3009 // Preserve original value. |
3010 SmiToInteger32(kScratchRegister, maybe_number); | 3010 SmiToInteger32(kScratchRegister, maybe_number); |
3011 Cvtlsi2sd(xmm_scratch, kScratchRegister); | 3011 Cvtlsi2sd(xmm_scratch, kScratchRegister); |
3012 movsd(FieldOperand(elements, index, times_8, | 3012 movsd(FieldOperand(elements, index, times_8, |
3013 FixedDoubleArray::kHeaderSize - elements_offset), | 3013 FixedDoubleArray::kHeaderSize - elements_offset), |
3014 xmm_scratch); | 3014 xmm_scratch); |
3015 bind(&done); | 3015 bind(&done); |
3016 } | 3016 } |
3017 | 3017 |
3018 | 3018 |
3019 void MacroAssembler::CompareMap(Register obj, | 3019 void MacroAssembler::CompareMap(Register obj, Handle<Map> map) { |
3020 Handle<Map> map, | |
3021 Label* early_success) { | |
3022 Cmp(FieldOperand(obj, HeapObject::kMapOffset), map); | 3020 Cmp(FieldOperand(obj, HeapObject::kMapOffset), map); |
3023 } | 3021 } |
3024 | 3022 |
3025 | 3023 |
3026 void MacroAssembler::CheckMap(Register obj, | 3024 void MacroAssembler::CheckMap(Register obj, |
3027 Handle<Map> map, | 3025 Handle<Map> map, |
3028 Label* fail, | 3026 Label* fail, |
3029 SmiCheckType smi_check_type) { | 3027 SmiCheckType smi_check_type) { |
3030 if (smi_check_type == DO_SMI_CHECK) { | 3028 if (smi_check_type == DO_SMI_CHECK) { |
3031 JumpIfSmi(obj, fail); | 3029 JumpIfSmi(obj, fail); |
3032 } | 3030 } |
3033 | 3031 |
3034 Label success; | 3032 CompareMap(obj, map); |
3035 CompareMap(obj, map, &success); | |
3036 j(not_equal, fail); | 3033 j(not_equal, fail); |
3037 bind(&success); | |
3038 } | 3034 } |
3039 | 3035 |
3040 | 3036 |
3041 void MacroAssembler::ClampUint8(Register reg) { | 3037 void MacroAssembler::ClampUint8(Register reg) { |
3042 Label done; | 3038 Label done; |
3043 testl(reg, Immediate(0xFFFFFF00)); | 3039 testl(reg, Immediate(0xFFFFFF00)); |
3044 j(zero, &done, Label::kNear); | 3040 j(zero, &done, Label::kNear); |
3045 setcc(negative, reg); // 1 if negative, 0 if positive. | 3041 setcc(negative, reg); // 1 if negative, 0 if positive. |
3046 decb(reg); // 0 if negative, 255 if positive. | 3042 decb(reg); // 0 if negative, 255 if positive. |
3047 bind(&done); | 3043 bind(&done); |
(...skipping 1916 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4964 movq(arg_reg_1, isolate, RelocInfo::EXTERNAL_REFERENCE); | 4960 movq(arg_reg_1, isolate, RelocInfo::EXTERNAL_REFERENCE); |
4965 CallCFunction( | 4961 CallCFunction( |
4966 ExternalReference::record_object_allocation_function(isolate), 3); | 4962 ExternalReference::record_object_allocation_function(isolate), 3); |
4967 PopSafepointRegisters(); | 4963 PopSafepointRegisters(); |
4968 } | 4964 } |
4969 | 4965 |
4970 | 4966 |
4971 } } // namespace v8::internal | 4967 } } // namespace v8::internal |
4972 | 4968 |
4973 #endif // V8_TARGET_ARCH_X64 | 4969 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |