Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(51)

Side by Side Diff: src/ia32/lithium-codegen-ia32.cc

Issue 6092007: Write buffer based write barrier for IA32 and Crankshaft. Currently... (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/gc/
Patch Set: '' Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/ia32/ic-ia32.cc ('k') | src/ia32/macro-assembler-ia32.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 2465 matching lines...) Expand 10 before | Expand all | Expand 10 after
2476 Register value = ToRegister(instr->value()); 2476 Register value = ToRegister(instr->value());
2477 int offset = instr->offset(); 2477 int offset = instr->offset();
2478 2478
2479 if (!instr->transition().is_null()) { 2479 if (!instr->transition().is_null()) {
2480 __ mov(FieldOperand(object, HeapObject::kMapOffset), instr->transition()); 2480 __ mov(FieldOperand(object, HeapObject::kMapOffset), instr->transition());
2481 } 2481 }
2482 2482
2483 // Do the store. 2483 // Do the store.
2484 if (instr->is_in_object()) { 2484 if (instr->is_in_object()) {
2485 __ mov(FieldOperand(object, offset), value); 2485 __ mov(FieldOperand(object, offset), value);
2486 #ifdef ENABLE_CARDMARKING_WRITE_BARRIER
2487 if (instr->needs_write_barrier()) { 2486 if (instr->needs_write_barrier()) {
2488 Register temp = ToRegister(instr->temp()); 2487 Register temp = ToRegister(instr->temp());
2489 // Update the write barrier for the object for in-object properties. 2488 // Update the write barrier for the object for in-object properties.
2490 __ RecordWrite(object, offset, value, temp); 2489 __ RecordWrite(object, offset, value, temp, kSaveFPRegs);
2491 } 2490 }
2492 #endif
2493 } else { 2491 } else {
2494 Register temp = ToRegister(instr->temp()); 2492 Register temp = ToRegister(instr->temp());
2495 __ mov(temp, FieldOperand(object, JSObject::kPropertiesOffset)); 2493 __ mov(temp, FieldOperand(object, JSObject::kPropertiesOffset));
2496 __ mov(FieldOperand(temp, offset), value); 2494 __ mov(FieldOperand(temp, offset), value);
2497 #ifdef ENABLE_CARDMARKING_WRITE_BARRIER
2498 if (instr->needs_write_barrier()) { 2495 if (instr->needs_write_barrier()) {
2499 // Update the write barrier for the properties array. 2496 // Update the write barrier for the properties array.
2500 // object is used as a scratch register. 2497 // object is used as a scratch register.
2501 __ RecordWrite(temp, offset, value, object); 2498 __ RecordWrite(temp, offset, value, object, kSaveFPRegs);
2502 } 2499 }
2503 #endif
2504 } 2500 }
2505 } 2501 }
2506 2502
2507 2503
2508 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { 2504 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) {
2509 ASSERT(ToRegister(instr->object()).is(edx)); 2505 ASSERT(ToRegister(instr->object()).is(edx));
2510 ASSERT(ToRegister(instr->value()).is(eax)); 2506 ASSERT(ToRegister(instr->value()).is(eax));
2511 2507
2512 __ mov(ecx, instr->name()); 2508 __ mov(ecx, instr->name());
2513 Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Initialize)); 2509 Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Initialize));
(...skipping 17 matching lines...) Expand all
2531 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); 2527 ASSERT(!instr->hydrogen()->NeedsWriteBarrier());
2532 LConstantOperand* const_operand = LConstantOperand::cast(instr->key()); 2528 LConstantOperand* const_operand = LConstantOperand::cast(instr->key());
2533 int offset = 2529 int offset =
2534 ToInteger32(const_operand) * kPointerSize + FixedArray::kHeaderSize; 2530 ToInteger32(const_operand) * kPointerSize + FixedArray::kHeaderSize;
2535 __ mov(FieldOperand(elements, offset), value); 2531 __ mov(FieldOperand(elements, offset), value);
2536 } else { 2532 } else {
2537 __ mov(FieldOperand(elements, key, times_4, FixedArray::kHeaderSize), 2533 __ mov(FieldOperand(elements, key, times_4, FixedArray::kHeaderSize),
2538 value); 2534 value);
2539 } 2535 }
2540 2536
2541 #ifdef ENABLE_CARDMARKING_WRITE_BARRIER
2542 // Update the write barrier unless we're certain that we're storing a smi. 2537 // Update the write barrier unless we're certain that we're storing a smi.
2543 if (instr->hydrogen()->NeedsWriteBarrier()) { 2538 if (instr->hydrogen()->NeedsWriteBarrier()) {
2544 // Compute address of modified element and store it into key register. 2539 // Compute address of modified element and store it into key register.
2545 __ lea(key, FieldOperand(elements, key, times_4, FixedArray::kHeaderSize)); 2540 __ lea(key, FieldOperand(elements, key, times_4, FixedArray::kHeaderSize));
2546 __ RecordWrite(elements, key, value); 2541 __ RecordWrite(elements, key, value, kSaveFPRegs);
2547 } 2542 }
2548 #endif
2549 } 2543 }
2550 2544
2551 2545
2552 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { 2546 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) {
2553 ASSERT(ToRegister(instr->object()).is(edx)); 2547 ASSERT(ToRegister(instr->object()).is(edx));
2554 ASSERT(ToRegister(instr->key()).is(ecx)); 2548 ASSERT(ToRegister(instr->key()).is(ecx));
2555 ASSERT(ToRegister(instr->value()).is(eax)); 2549 ASSERT(ToRegister(instr->value()).is(eax));
2556 2550
2557 Handle<Code> ic(Builtins::builtin(Builtins::KeyedStoreIC_Initialize)); 2551 Handle<Code> ic(Builtins::builtin(Builtins::KeyedStoreIC_Initialize));
2558 CallCode(ic, RelocInfo::CODE_TARGET, instr); 2552 CallCode(ic, RelocInfo::CODE_TARGET, instr);
(...skipping 747 matching lines...) Expand 10 before | Expand all | Expand 10 after
3306 ASSERT(!environment->HasBeenRegistered()); 3300 ASSERT(!environment->HasBeenRegistered());
3307 RegisterEnvironmentForDeoptimization(environment); 3301 RegisterEnvironmentForDeoptimization(environment);
3308 ASSERT(osr_pc_offset_ == -1); 3302 ASSERT(osr_pc_offset_ == -1);
3309 osr_pc_offset_ = masm()->pc_offset(); 3303 osr_pc_offset_ = masm()->pc_offset();
3310 } 3304 }
3311 3305
3312 3306
3313 #undef __ 3307 #undef __
3314 3308
3315 } } // namespace v8::internal 3309 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ia32/ic-ia32.cc ('k') | src/ia32/macro-assembler-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698