| 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 } | 78 } |
| 79 | 79 |
| 80 | 80 |
| 81 void MacroAssembler::RememberedSetHelper( | 81 void MacroAssembler::RememberedSetHelper( |
| 82 Register object, // Only used for debug checks. | 82 Register object, // Only used for debug checks. |
| 83 Register addr, | 83 Register addr, |
| 84 Register scratch, | 84 Register scratch, |
| 85 SaveFPRegsMode save_fp, | 85 SaveFPRegsMode save_fp, |
| 86 MacroAssembler::RememberedSetFinalAction and_then) { | 86 MacroAssembler::RememberedSetFinalAction and_then) { |
| 87 Label done; | 87 Label done; |
| 88 if (FLAG_debug_code) { | 88 if (emit_debug_code()) { |
| 89 Label ok; | 89 Label ok; |
| 90 JumpIfNotInNewSpace(object, scratch, &ok, Label::kNear); | 90 JumpIfNotInNewSpace(object, scratch, &ok, Label::kNear); |
| 91 int3(); | 91 int3(); |
| 92 bind(&ok); | 92 bind(&ok); |
| 93 } | 93 } |
| 94 // Load store buffer top. | 94 // Load store buffer top. |
| 95 ExternalReference store_buffer = | 95 ExternalReference store_buffer = |
| 96 ExternalReference::store_buffer_top(isolate()); | 96 ExternalReference::store_buffer_top(isolate()); |
| 97 mov(scratch, Operand::StaticVariable(store_buffer)); | 97 mov(scratch, Operand::StaticVariable(store_buffer)); |
| 98 // Store pointer to buffer. | 98 // Store pointer to buffer. |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 ASSERT(!value.is(address)); | 310 ASSERT(!value.is(address)); |
| 311 if (emit_debug_code()) { | 311 if (emit_debug_code()) { |
| 312 AbortIfSmi(object); | 312 AbortIfSmi(object); |
| 313 } | 313 } |
| 314 | 314 |
| 315 if (remembered_set_action == OMIT_REMEMBERED_SET && | 315 if (remembered_set_action == OMIT_REMEMBERED_SET && |
| 316 !FLAG_incremental_marking) { | 316 !FLAG_incremental_marking) { |
| 317 return; | 317 return; |
| 318 } | 318 } |
| 319 | 319 |
| 320 if (FLAG_debug_code) { | 320 if (emit_debug_code()) { |
| 321 Label ok; | 321 Label ok; |
| 322 cmp(value, Operand(address, 0)); | 322 cmp(value, Operand(address, 0)); |
| 323 j(equal, &ok, Label::kNear); | 323 j(equal, &ok, Label::kNear); |
| 324 int3(); | 324 int3(); |
| 325 bind(&ok); | 325 bind(&ok); |
| 326 } | 326 } |
| 327 | 327 |
| 328 // First, check if a write barrier is even needed. The tests below | 328 // First, check if a write barrier is even needed. The tests below |
| 329 // catch stores of Smis and stores into young gen. | 329 // catch stores of Smis and stores into young gen. |
| 330 Label done; | 330 Label done; |
| (...skipping 2455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2786 ASSERT(strcmp(Marking::kGreyBitPattern, "11") == 0); | 2786 ASSERT(strcmp(Marking::kGreyBitPattern, "11") == 0); |
| 2787 ASSERT(strcmp(Marking::kImpossibleBitPattern, "01") == 0); | 2787 ASSERT(strcmp(Marking::kImpossibleBitPattern, "01") == 0); |
| 2788 | 2788 |
| 2789 Label done; | 2789 Label done; |
| 2790 | 2790 |
| 2791 // Since both black and grey have a 1 in the first position and white does | 2791 // Since both black and grey have a 1 in the first position and white does |
| 2792 // not have a 1 there we only need to check one bit. | 2792 // not have a 1 there we only need to check one bit. |
| 2793 test(mask_scratch, Operand(bitmap_scratch, MemoryChunk::kHeaderSize)); | 2793 test(mask_scratch, Operand(bitmap_scratch, MemoryChunk::kHeaderSize)); |
| 2794 j(not_zero, &done, Label::kNear); | 2794 j(not_zero, &done, Label::kNear); |
| 2795 | 2795 |
| 2796 if (FLAG_debug_code) { | 2796 if (emit_debug_code()) { |
| 2797 // Check for impossible bit pattern. | 2797 // Check for impossible bit pattern. |
| 2798 Label ok; | 2798 Label ok; |
| 2799 push(mask_scratch); | 2799 push(mask_scratch); |
| 2800 // shl. May overflow making the check conservative. | 2800 // shl. May overflow making the check conservative. |
| 2801 add(mask_scratch, mask_scratch); | 2801 add(mask_scratch, mask_scratch); |
| 2802 test(mask_scratch, Operand(bitmap_scratch, MemoryChunk::kHeaderSize)); | 2802 test(mask_scratch, Operand(bitmap_scratch, MemoryChunk::kHeaderSize)); |
| 2803 j(zero, &ok, Label::kNear); | 2803 j(zero, &ok, Label::kNear); |
| 2804 int3(); | 2804 int3(); |
| 2805 bind(&ok); | 2805 bind(&ok); |
| 2806 pop(mask_scratch); | 2806 pop(mask_scratch); |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2861 and_(length, Immediate(~kObjectAlignmentMask)); | 2861 and_(length, Immediate(~kObjectAlignmentMask)); |
| 2862 | 2862 |
| 2863 bind(&is_data_object); | 2863 bind(&is_data_object); |
| 2864 // Value is a data object, and it is white. Mark it black. Since we know | 2864 // Value is a data object, and it is white. Mark it black. Since we know |
| 2865 // that the object is white we can make it black by flipping one bit. | 2865 // that the object is white we can make it black by flipping one bit. |
| 2866 or_(Operand(bitmap_scratch, MemoryChunk::kHeaderSize), mask_scratch); | 2866 or_(Operand(bitmap_scratch, MemoryChunk::kHeaderSize), mask_scratch); |
| 2867 | 2867 |
| 2868 and_(bitmap_scratch, Immediate(~Page::kPageAlignmentMask)); | 2868 and_(bitmap_scratch, Immediate(~Page::kPageAlignmentMask)); |
| 2869 add(Operand(bitmap_scratch, MemoryChunk::kLiveBytesOffset), | 2869 add(Operand(bitmap_scratch, MemoryChunk::kLiveBytesOffset), |
| 2870 length); | 2870 length); |
| 2871 if (FLAG_debug_code) { | 2871 if (emit_debug_code()) { |
| 2872 mov(length, Operand(bitmap_scratch, MemoryChunk::kLiveBytesOffset)); | 2872 mov(length, Operand(bitmap_scratch, MemoryChunk::kLiveBytesOffset)); |
| 2873 cmp(length, Operand(bitmap_scratch, MemoryChunk::kSizeOffset)); | 2873 cmp(length, Operand(bitmap_scratch, MemoryChunk::kSizeOffset)); |
| 2874 Check(less_equal, "Live Bytes Count overflow chunk size"); | 2874 Check(less_equal, "Live Bytes Count overflow chunk size"); |
| 2875 } | 2875 } |
| 2876 | 2876 |
| 2877 bind(&done); | 2877 bind(&done); |
| 2878 } | 2878 } |
| 2879 | 2879 |
| 2880 | 2880 |
| 2881 void MacroAssembler::CheckEnumCache(Label* call_runtime) { | 2881 void MacroAssembler::CheckEnumCache(Label* call_runtime) { |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2916 // Load the prototype from the map and loop if non-null. | 2916 // Load the prototype from the map and loop if non-null. |
| 2917 bind(&check_prototype); | 2917 bind(&check_prototype); |
| 2918 mov(ecx, FieldOperand(ebx, Map::kPrototypeOffset)); | 2918 mov(ecx, FieldOperand(ebx, Map::kPrototypeOffset)); |
| 2919 cmp(ecx, isolate()->factory()->null_value()); | 2919 cmp(ecx, isolate()->factory()->null_value()); |
| 2920 j(not_equal, &next); | 2920 j(not_equal, &next); |
| 2921 } | 2921 } |
| 2922 | 2922 |
| 2923 } } // namespace v8::internal | 2923 } } // namespace v8::internal |
| 2924 | 2924 |
| 2925 #endif // V8_TARGET_ARCH_IA32 | 2925 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |