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 3346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3357 Check(not_equal, kOperandIsASmiAndNotAName); | 3357 Check(not_equal, kOperandIsASmiAndNotAName); |
3358 push(object); | 3358 push(object); |
3359 movp(object, FieldOperand(object, HeapObject::kMapOffset)); | 3359 movp(object, FieldOperand(object, HeapObject::kMapOffset)); |
3360 CmpInstanceType(object, LAST_NAME_TYPE); | 3360 CmpInstanceType(object, LAST_NAME_TYPE); |
3361 pop(object); | 3361 pop(object); |
3362 Check(below_equal, kOperandIsNotAName); | 3362 Check(below_equal, kOperandIsNotAName); |
3363 } | 3363 } |
3364 } | 3364 } |
3365 | 3365 |
3366 | 3366 |
3367 void MacroAssembler::AssertUndefinedOrAllocationSite(Register object) { | |
3368 if (emit_debug_code()) { | |
3369 Label done_checking; | |
3370 AssertNotSmi(object); | |
3371 Cmp(object, isolate()->factory()->undefined_value()); | |
3372 j(equal, &done_checking); | |
3373 Cmp(FieldOperand(object, 0), isolate()->factory()->allocation_site_map()); | |
3374 Assert(equal, kExpectedUndefinedOrCell); | |
3375 bind(&done_checking); | |
3376 } | |
3377 } | |
3378 | |
3379 | |
3367 void MacroAssembler::AssertRootValue(Register src, | 3380 void MacroAssembler::AssertRootValue(Register src, |
3368 Heap::RootListIndex root_value_index, | 3381 Heap::RootListIndex root_value_index, |
3369 BailoutReason reason) { | 3382 BailoutReason reason) { |
3370 if (emit_debug_code()) { | 3383 if (emit_debug_code()) { |
3371 ASSERT(!src.is(kScratchRegister)); | 3384 ASSERT(!src.is(kScratchRegister)); |
3372 LoadRoot(kScratchRegister, root_value_index); | 3385 LoadRoot(kScratchRegister, root_value_index); |
3373 cmpq(src, kScratchRegister); | 3386 cmpq(src, kScratchRegister); |
3374 Check(equal, reason); | 3387 Check(equal, reason); |
3375 } | 3388 } |
3376 } | 3389 } |
(...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4026 AllocationUtils::GetAllocationTopReference(isolate(), flags); | 4039 AllocationUtils::GetAllocationTopReference(isolate(), flags); |
4027 | 4040 |
4028 // Just return if allocation top is already known. | 4041 // Just return if allocation top is already known. |
4029 if ((flags & RESULT_CONTAINS_TOP) != 0) { | 4042 if ((flags & RESULT_CONTAINS_TOP) != 0) { |
4030 // No use of scratch if allocation top is provided. | 4043 // No use of scratch if allocation top is provided. |
4031 ASSERT(!scratch.is_valid()); | 4044 ASSERT(!scratch.is_valid()); |
4032 #ifdef DEBUG | 4045 #ifdef DEBUG |
4033 // Assert that result actually contains top on entry. | 4046 // Assert that result actually contains top on entry. |
4034 Operand top_operand = ExternalOperand(allocation_top); | 4047 Operand top_operand = ExternalOperand(allocation_top); |
4035 cmpq(result, top_operand); | 4048 cmpq(result, top_operand); |
4049 Label fine; | |
4050 j(equal, &fine); | |
4051 int3(); | |
4052 bind(&fine); | |
Hannes Payer (out of office)
2014/02/18 16:24:26
I don't think this code is needed...
mvstanton
2014/02/19 08:40:26
Whoa, thank you, that was me debugging somewhere i
| |
4036 Check(equal, kUnexpectedAllocationTop); | 4053 Check(equal, kUnexpectedAllocationTop); |
4037 #endif | 4054 #endif |
4038 return; | 4055 return; |
4039 } | 4056 } |
4040 | 4057 |
4041 // Move address of new object to result. Use scratch register if available, | 4058 // Move address of new object to result. Use scratch register if available, |
4042 // and keep address in scratch until call to UpdateAllocationTopHelper. | 4059 // and keep address in scratch until call to UpdateAllocationTopHelper. |
4043 if (scratch.is_valid()) { | 4060 if (scratch.is_valid()) { |
4044 LoadAddress(scratch, allocation_top); | 4061 LoadAddress(scratch, allocation_top); |
4045 movp(result, Operand(scratch, 0)); | 4062 movp(result, Operand(scratch, 0)); |
(...skipping 974 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5020 j(equal, found); | 5037 j(equal, found); |
5021 movp(current, FieldOperand(current, Map::kPrototypeOffset)); | 5038 movp(current, FieldOperand(current, Map::kPrototypeOffset)); |
5022 CompareRoot(current, Heap::kNullValueRootIndex); | 5039 CompareRoot(current, Heap::kNullValueRootIndex); |
5023 j(not_equal, &loop_again); | 5040 j(not_equal, &loop_again); |
5024 } | 5041 } |
5025 | 5042 |
5026 | 5043 |
5027 } } // namespace v8::internal | 5044 } } // namespace v8::internal |
5028 | 5045 |
5029 #endif // V8_TARGET_ARCH_X64 | 5046 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |