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 3008 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3019 Check(not_equal, "Operand is a smi and not a string"); | 3019 Check(not_equal, "Operand is a smi and not a string"); |
3020 push(object); | 3020 push(object); |
3021 movq(object, FieldOperand(object, HeapObject::kMapOffset)); | 3021 movq(object, FieldOperand(object, HeapObject::kMapOffset)); |
3022 CmpInstanceType(object, FIRST_NONSTRING_TYPE); | 3022 CmpInstanceType(object, FIRST_NONSTRING_TYPE); |
3023 pop(object); | 3023 pop(object); |
3024 Check(below, "Operand is not a string"); | 3024 Check(below, "Operand is not a string"); |
3025 } | 3025 } |
3026 } | 3026 } |
3027 | 3027 |
3028 | 3028 |
| 3029 void MacroAssembler::AssertName(Register object) { |
| 3030 if (emit_debug_code()) { |
| 3031 testb(object, Immediate(kSmiTagMask)); |
| 3032 Check(not_equal, "Operand is a smi and not a name"); |
| 3033 push(object); |
| 3034 movq(object, FieldOperand(object, HeapObject::kMapOffset)); |
| 3035 CmpInstanceType(object, LAST_NAME_TYPE); |
| 3036 pop(object); |
| 3037 Check(below_equal, "Operand is not a name"); |
| 3038 } |
| 3039 } |
| 3040 |
| 3041 |
3029 void MacroAssembler::AssertRootValue(Register src, | 3042 void MacroAssembler::AssertRootValue(Register src, |
3030 Heap::RootListIndex root_value_index, | 3043 Heap::RootListIndex root_value_index, |
3031 const char* message) { | 3044 const char* message) { |
3032 if (emit_debug_code()) { | 3045 if (emit_debug_code()) { |
3033 ASSERT(!src.is(kScratchRegister)); | 3046 ASSERT(!src.is(kScratchRegister)); |
3034 LoadRoot(kScratchRegister, root_value_index); | 3047 LoadRoot(kScratchRegister, root_value_index); |
3035 cmpq(src, kScratchRegister); | 3048 cmpq(src, kScratchRegister); |
3036 Check(equal, message); | 3049 Check(equal, message); |
3037 } | 3050 } |
3038 } | 3051 } |
3039 | 3052 |
3040 | 3053 |
3041 | 3054 |
3042 Condition MacroAssembler::IsObjectStringType(Register heap_object, | 3055 Condition MacroAssembler::IsObjectStringType(Register heap_object, |
3043 Register map, | 3056 Register map, |
3044 Register instance_type) { | 3057 Register instance_type) { |
3045 movq(map, FieldOperand(heap_object, HeapObject::kMapOffset)); | 3058 movq(map, FieldOperand(heap_object, HeapObject::kMapOffset)); |
3046 movzxbl(instance_type, FieldOperand(map, Map::kInstanceTypeOffset)); | 3059 movzxbl(instance_type, FieldOperand(map, Map::kInstanceTypeOffset)); |
3047 STATIC_ASSERT(kNotStringTag != 0); | 3060 STATIC_ASSERT(kNotStringTag != 0); |
3048 testb(instance_type, Immediate(kIsNotStringMask)); | 3061 testb(instance_type, Immediate(kIsNotStringMask)); |
3049 return zero; | 3062 return zero; |
3050 } | 3063 } |
3051 | 3064 |
3052 | 3065 |
| 3066 Condition MacroAssembler::IsObjectNameType(Register heap_object, |
| 3067 Register map, |
| 3068 Register instance_type) { |
| 3069 movq(map, FieldOperand(heap_object, HeapObject::kMapOffset)); |
| 3070 movzxbl(instance_type, FieldOperand(map, Map::kInstanceTypeOffset)); |
| 3071 cmpb(instance_type, Immediate(static_cast<int8_t>(LAST_NAME_TYPE))); |
| 3072 return below_equal; |
| 3073 } |
| 3074 |
| 3075 |
3053 void MacroAssembler::TryGetFunctionPrototype(Register function, | 3076 void MacroAssembler::TryGetFunctionPrototype(Register function, |
3054 Register result, | 3077 Register result, |
3055 Label* miss, | 3078 Label* miss, |
3056 bool miss_on_bound_function) { | 3079 bool miss_on_bound_function) { |
3057 // Check that the receiver isn't a smi. | 3080 // Check that the receiver isn't a smi. |
3058 testl(function, Immediate(kSmiTagMask)); | 3081 testl(function, Immediate(kSmiTagMask)); |
3059 j(zero, miss); | 3082 j(zero, miss); |
3060 | 3083 |
3061 // Check that the function really is a function. | 3084 // Check that the function really is a function. |
3062 CmpObjectType(function, JS_FUNCTION_TYPE, result); | 3085 CmpObjectType(function, JS_FUNCTION_TYPE, result); |
(...skipping 1565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4628 j(greater, &no_info_available); | 4651 j(greater, &no_info_available); |
4629 CompareRoot(MemOperand(scratch_reg, -AllocationSiteInfo::kSize), | 4652 CompareRoot(MemOperand(scratch_reg, -AllocationSiteInfo::kSize), |
4630 Heap::kAllocationSiteInfoMapRootIndex); | 4653 Heap::kAllocationSiteInfoMapRootIndex); |
4631 bind(&no_info_available); | 4654 bind(&no_info_available); |
4632 } | 4655 } |
4633 | 4656 |
4634 | 4657 |
4635 } } // namespace v8::internal | 4658 } } // namespace v8::internal |
4636 | 4659 |
4637 #endif // V8_TARGET_ARCH_X64 | 4660 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |