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

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

Issue 5736008: Provide baseline for experimental GC implementation. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/gc
Patch Set: Created 10 years 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 2317 matching lines...) Expand 10 before | Expand all | Expand 10 after
2328 Register value = ToRegister(instr->value()); 2328 Register value = ToRegister(instr->value());
2329 int offset = instr->offset(); 2329 int offset = instr->offset();
2330 2330
2331 if (!instr->transition().is_null()) { 2331 if (!instr->transition().is_null()) {
2332 __ mov(FieldOperand(object, HeapObject::kMapOffset), instr->transition()); 2332 __ mov(FieldOperand(object, HeapObject::kMapOffset), instr->transition());
2333 } 2333 }
2334 2334
2335 // Do the store. 2335 // Do the store.
2336 if (instr->is_in_object()) { 2336 if (instr->is_in_object()) {
2337 __ mov(FieldOperand(object, offset), value); 2337 __ mov(FieldOperand(object, offset), value);
2338 #ifdef ENABLE_CARDMARKING_WRITE_BARRIER
2338 if (instr->needs_write_barrier()) { 2339 if (instr->needs_write_barrier()) {
2339 Register temp = ToRegister(instr->temp()); 2340 Register temp = ToRegister(instr->temp());
2340 // Update the write barrier for the object for in-object properties. 2341 // Update the write barrier for the object for in-object properties.
2341 __ RecordWrite(object, offset, value, temp); 2342 __ RecordWrite(object, offset, value, temp);
2342 } 2343 }
2344 #endif
2343 } else { 2345 } else {
2344 Register temp = ToRegister(instr->temp()); 2346 Register temp = ToRegister(instr->temp());
2345 __ mov(temp, FieldOperand(object, JSObject::kPropertiesOffset)); 2347 __ mov(temp, FieldOperand(object, JSObject::kPropertiesOffset));
2346 __ mov(FieldOperand(temp, offset), value); 2348 __ mov(FieldOperand(temp, offset), value);
2349 #ifdef ENABLE_CARDMARKING_WRITE_BARRIER
2347 if (instr->needs_write_barrier()) { 2350 if (instr->needs_write_barrier()) {
2348 // Update the write barrier for the properties array. 2351 // Update the write barrier for the properties array.
2349 // object is used as a scratch register. 2352 // object is used as a scratch register.
2350 __ RecordWrite(temp, offset, value, object); 2353 __ RecordWrite(temp, offset, value, object);
2351 } 2354 }
2355 #endif
2352 } 2356 }
2353 } 2357 }
2354 2358
2355 2359
2356 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { 2360 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) {
2357 ASSERT(ToRegister(instr->object()).is(edx)); 2361 ASSERT(ToRegister(instr->object()).is(edx));
2358 ASSERT(ToRegister(instr->value()).is(eax)); 2362 ASSERT(ToRegister(instr->value()).is(eax));
2359 2363
2360 __ mov(ecx, instr->name()); 2364 __ mov(ecx, instr->name());
2361 Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Initialize)); 2365 Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Initialize));
(...skipping 17 matching lines...) Expand all
2379 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); 2383 ASSERT(!instr->hydrogen()->NeedsWriteBarrier());
2380 LConstantOperand* const_operand = LConstantOperand::cast(instr->key()); 2384 LConstantOperand* const_operand = LConstantOperand::cast(instr->key());
2381 int offset = 2385 int offset =
2382 ToInteger32(const_operand) * kPointerSize + FixedArray::kHeaderSize; 2386 ToInteger32(const_operand) * kPointerSize + FixedArray::kHeaderSize;
2383 __ mov(FieldOperand(elements, offset), value); 2387 __ mov(FieldOperand(elements, offset), value);
2384 } else { 2388 } else {
2385 __ mov(FieldOperand(elements, key, times_4, FixedArray::kHeaderSize), 2389 __ mov(FieldOperand(elements, key, times_4, FixedArray::kHeaderSize),
2386 value); 2390 value);
2387 } 2391 }
2388 2392
2393 #ifdef ENABLE_CARDMARKING_WRITE_BARRIER
2389 // Update the write barrier unless we're certain that we're storing a smi. 2394 // Update the write barrier unless we're certain that we're storing a smi.
2390 if (instr->hydrogen()->NeedsWriteBarrier()) { 2395 if (instr->hydrogen()->NeedsWriteBarrier()) {
2391 // Compute address of modified element and store it into key register. 2396 // Compute address of modified element and store it into key register.
2392 __ lea(key, FieldOperand(elements, key, times_4, FixedArray::kHeaderSize)); 2397 __ lea(key, FieldOperand(elements, key, times_4, FixedArray::kHeaderSize));
2393 __ RecordWrite(elements, key, value); 2398 __ RecordWrite(elements, key, value);
2394 } 2399 }
2400 #endif
2395 } 2401 }
2396 2402
2397 2403
2398 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { 2404 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) {
2399 ASSERT(ToRegister(instr->object()).is(edx)); 2405 ASSERT(ToRegister(instr->object()).is(edx));
2400 ASSERT(ToRegister(instr->key()).is(ecx)); 2406 ASSERT(ToRegister(instr->key()).is(ecx));
2401 ASSERT(ToRegister(instr->value()).is(eax)); 2407 ASSERT(ToRegister(instr->value()).is(eax));
2402 2408
2403 Handle<Code> ic(Builtins::builtin(Builtins::KeyedStoreIC_Initialize)); 2409 Handle<Code> ic(Builtins::builtin(Builtins::KeyedStoreIC_Initialize));
2404 CallCode(ic, RelocInfo::CODE_TARGET, instr); 2410 CallCode(ic, RelocInfo::CODE_TARGET, instr);
(...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after
3155 ASSERT(!environment->HasBeenRegistered()); 3161 ASSERT(!environment->HasBeenRegistered());
3156 RegisterEnvironmentForDeoptimization(environment); 3162 RegisterEnvironmentForDeoptimization(environment);
3157 ASSERT(osr_pc_offset_ == -1); 3163 ASSERT(osr_pc_offset_ == -1);
3158 osr_pc_offset_ = masm()->pc_offset(); 3164 osr_pc_offset_ = masm()->pc_offset();
3159 } 3165 }
3160 3166
3161 3167
3162 #undef __ 3168 #undef __
3163 3169
3164 } } // namespace v8::internal 3170 } } // namespace v8::internal
OLDNEW
« src/globals.h ('K') | « 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