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

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
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 2429 matching lines...) Expand 10 before | Expand all | Expand 10 after
2440 Register value = ToRegister(instr->value()); 2440 Register value = ToRegister(instr->value());
2441 int offset = instr->offset(); 2441 int offset = instr->offset();
2442 2442
2443 if (!instr->transition().is_null()) { 2443 if (!instr->transition().is_null()) {
2444 __ mov(FieldOperand(object, HeapObject::kMapOffset), instr->transition()); 2444 __ mov(FieldOperand(object, HeapObject::kMapOffset), instr->transition());
2445 } 2445 }
2446 2446
2447 // Do the store. 2447 // Do the store.
2448 if (instr->is_in_object()) { 2448 if (instr->is_in_object()) {
2449 __ mov(FieldOperand(object, offset), value); 2449 __ mov(FieldOperand(object, offset), value);
2450 #ifdef ENABLE_CARDMARKING_WRITE_BARRIER
2451 if (instr->needs_write_barrier()) { 2450 if (instr->needs_write_barrier()) {
2452 Register temp = ToRegister(instr->temp()); 2451 Register temp = ToRegister(instr->temp());
2453 // Update the write barrier for the object for in-object properties. 2452 // Update the write barrier for the object for in-object properties.
2454 __ RecordWrite(object, offset, value, temp); 2453 __ RecordWrite(object, offset, value, temp, kSaveFPRegs);
2455 } 2454 }
2456 #endif
2457 } else { 2455 } else {
2458 Register temp = ToRegister(instr->temp()); 2456 Register temp = ToRegister(instr->temp());
2459 __ mov(temp, FieldOperand(object, JSObject::kPropertiesOffset)); 2457 __ mov(temp, FieldOperand(object, JSObject::kPropertiesOffset));
2460 __ mov(FieldOperand(temp, offset), value); 2458 __ mov(FieldOperand(temp, offset), value);
2461 #ifdef ENABLE_CARDMARKING_WRITE_BARRIER
2462 if (instr->needs_write_barrier()) { 2459 if (instr->needs_write_barrier()) {
2463 // Update the write barrier for the properties array. 2460 // Update the write barrier for the properties array.
2464 // object is used as a scratch register. 2461 // object is used as a scratch register.
2465 __ RecordWrite(temp, offset, value, object); 2462 __ RecordWrite(temp, offset, value, object, kSaveFPRegs);
2466 } 2463 }
2467 #endif
2468 } 2464 }
2469 } 2465 }
2470 2466
2471 2467
2472 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { 2468 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) {
2473 ASSERT(ToRegister(instr->object()).is(edx)); 2469 ASSERT(ToRegister(instr->object()).is(edx));
2474 ASSERT(ToRegister(instr->value()).is(eax)); 2470 ASSERT(ToRegister(instr->value()).is(eax));
2475 2471
2476 __ mov(ecx, instr->name()); 2472 __ mov(ecx, instr->name());
2477 Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Initialize)); 2473 Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Initialize));
(...skipping 17 matching lines...) Expand all
2495 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); 2491 ASSERT(!instr->hydrogen()->NeedsWriteBarrier());
2496 LConstantOperand* const_operand = LConstantOperand::cast(instr->key()); 2492 LConstantOperand* const_operand = LConstantOperand::cast(instr->key());
2497 int offset = 2493 int offset =
2498 ToInteger32(const_operand) * kPointerSize + FixedArray::kHeaderSize; 2494 ToInteger32(const_operand) * kPointerSize + FixedArray::kHeaderSize;
2499 __ mov(FieldOperand(elements, offset), value); 2495 __ mov(FieldOperand(elements, offset), value);
2500 } else { 2496 } else {
2501 __ mov(FieldOperand(elements, key, times_4, FixedArray::kHeaderSize), 2497 __ mov(FieldOperand(elements, key, times_4, FixedArray::kHeaderSize),
2502 value); 2498 value);
2503 } 2499 }
2504 2500
2505 #ifdef ENABLE_CARDMARKING_WRITE_BARRIER
2506 // Update the write barrier unless we're certain that we're storing a smi. 2501 // Update the write barrier unless we're certain that we're storing a smi.
2507 if (instr->hydrogen()->NeedsWriteBarrier()) { 2502 if (instr->hydrogen()->NeedsWriteBarrier()) {
2508 // Compute address of modified element and store it into key register. 2503 // Compute address of modified element and store it into key register.
2509 __ lea(key, FieldOperand(elements, key, times_4, FixedArray::kHeaderSize)); 2504 __ lea(key, FieldOperand(elements, key, times_4, FixedArray::kHeaderSize));
2510 __ RecordWrite(elements, key, value); 2505 __ RecordWrite(elements, key, value, kSaveFPRegs);
2511 } 2506 }
2512 #endif
2513 } 2507 }
2514 2508
2515 2509
2516 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { 2510 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) {
2517 ASSERT(ToRegister(instr->object()).is(edx)); 2511 ASSERT(ToRegister(instr->object()).is(edx));
2518 ASSERT(ToRegister(instr->key()).is(ecx)); 2512 ASSERT(ToRegister(instr->key()).is(ecx));
2519 ASSERT(ToRegister(instr->value()).is(eax)); 2513 ASSERT(ToRegister(instr->value()).is(eax));
2520 2514
2521 Handle<Code> ic(Builtins::builtin(Builtins::KeyedStoreIC_Initialize)); 2515 Handle<Code> ic(Builtins::builtin(Builtins::KeyedStoreIC_Initialize));
2522 CallCode(ic, RelocInfo::CODE_TARGET, instr); 2516 CallCode(ic, RelocInfo::CODE_TARGET, instr);
(...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after
3273 ASSERT(!environment->HasBeenRegistered()); 3267 ASSERT(!environment->HasBeenRegistered());
3274 RegisterEnvironmentForDeoptimization(environment); 3268 RegisterEnvironmentForDeoptimization(environment);
3275 ASSERT(osr_pc_offset_ == -1); 3269 ASSERT(osr_pc_offset_ == -1);
3276 osr_pc_offset_ = masm()->pc_offset(); 3270 osr_pc_offset_ = masm()->pc_offset();
3277 } 3271 }
3278 3272
3279 3273
3280 #undef __ 3274 #undef __
3281 3275
3282 } } // namespace v8::internal 3276 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698