| 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 225 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 236   } | 236   } | 
| 237 } | 237 } | 
| 238 | 238 | 
| 239 | 239 | 
| 240 void MacroAssembler::RecordWriteForMap( | 240 void MacroAssembler::RecordWriteForMap( | 
| 241     Register object, | 241     Register object, | 
| 242     Handle<Map> map, | 242     Handle<Map> map, | 
| 243     Register scratch1, | 243     Register scratch1, | 
| 244     Register scratch2, | 244     Register scratch2, | 
| 245     SaveFPRegsMode save_fp) { | 245     SaveFPRegsMode save_fp) { | 
| 246   // First, check if a write barrier is even needed. The tests below |  | 
| 247   // catch stores of Smis. |  | 
| 248   Label done; | 246   Label done; | 
| 249 | 247 | 
| 250   Register address = scratch1; | 248   Register address = scratch1; | 
| 251   Register value = scratch2; | 249   Register value = scratch2; | 
| 252   if (emit_debug_code()) { | 250   if (emit_debug_code()) { | 
| 253     Label ok; | 251     Label ok; | 
| 254     lea(address, FieldOperand(object, HeapObject::kMapOffset)); | 252     lea(address, FieldOperand(object, HeapObject::kMapOffset)); | 
| 255     test_b(address, (1 << kPointerSizeLog2) - 1); | 253     test_b(address, (1 << kPointerSizeLog2) - 1); | 
| 256     j(zero, &ok, Label::kNear); | 254     j(zero, &ok, Label::kNear); | 
| 257     int3(); | 255     int3(); | 
| (...skipping 16 matching lines...) Expand all  Loading... | 
| 274   // the from object's page's interesting flag is also set.  This optimization | 272   // the from object's page's interesting flag is also set.  This optimization | 
| 275   // relies on the fact that maps can never be in new space. | 273   // relies on the fact that maps can never be in new space. | 
| 276   ASSERT(!isolate()->heap()->InNewSpace(*map)); | 274   ASSERT(!isolate()->heap()->InNewSpace(*map)); | 
| 277   CheckPageFlagForMap(map, | 275   CheckPageFlagForMap(map, | 
| 278                       MemoryChunk::kPointersToHereAreInterestingMask, | 276                       MemoryChunk::kPointersToHereAreInterestingMask, | 
| 279                       zero, | 277                       zero, | 
| 280                       &done, | 278                       &done, | 
| 281                       Label::kNear); | 279                       Label::kNear); | 
| 282 | 280 | 
| 283   // Delay the initialization of |address| and |value| for the stub until it's | 281   // Delay the initialization of |address| and |value| for the stub until it's | 
| 284   // known that the will be needed. Up until this point their value are not | 282   // known that the will be needed. Up until this point their values are not | 
| 285   // needed since they are embedded in the operands of instructions that need | 283   // needed since they are embedded in the operands of instructions that need | 
| 286   // them. | 284   // them. | 
| 287   lea(address, FieldOperand(object, HeapObject::kMapOffset)); | 285   lea(address, FieldOperand(object, HeapObject::kMapOffset)); | 
| 288   mov(value, Immediate(map)); | 286   mov(value, Immediate(map)); | 
| 289   RecordWriteStub stub(object, value, address, OMIT_REMEMBERED_SET, save_fp); | 287   RecordWriteStub stub(object, value, address, OMIT_REMEMBERED_SET, save_fp); | 
| 290   CallStub(&stub); | 288   CallStub(&stub); | 
| 291 | 289 | 
| 292   bind(&done); | 290   bind(&done); | 
| 293 | 291 | 
| 294   // Clobber clobbered input registers when running with the debug-code flag | 292   // Clobber clobbered input registers when running with the debug-code flag | 
| (...skipping 2613 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 2908   // Load the prototype from the map and loop if non-null. | 2906   // Load the prototype from the map and loop if non-null. | 
| 2909   bind(&check_prototype); | 2907   bind(&check_prototype); | 
| 2910   mov(ecx, FieldOperand(ebx, Map::kPrototypeOffset)); | 2908   mov(ecx, FieldOperand(ebx, Map::kPrototypeOffset)); | 
| 2911   cmp(ecx, isolate()->factory()->null_value()); | 2909   cmp(ecx, isolate()->factory()->null_value()); | 
| 2912   j(not_equal, &next); | 2910   j(not_equal, &next); | 
| 2913 } | 2911 } | 
| 2914 | 2912 | 
| 2915 } }  // namespace v8::internal | 2913 } }  // namespace v8::internal | 
| 2916 | 2914 | 
| 2917 #endif  // V8_TARGET_ARCH_IA32 | 2915 #endif  // V8_TARGET_ARCH_IA32 | 
| OLD | NEW | 
|---|