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

Side by Side Diff: src/x64/lithium-x64.cc

Issue 10443052: Fix missing write barrier in store field stub. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments by Vyacheslav Egorov. Created 8 years, 6 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/x64/lithium-codegen-x64.cc ('k') | src/x64/stub-cache-x64.cc » ('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 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 2018 matching lines...) Expand 10 before | Expand all | Expand 10 after
2029 new(zone()) LTransitionElementsKind(object, 2029 new(zone()) LTransitionElementsKind(object,
2030 new_map_reg, 2030 new_map_reg,
2031 fixed_object_reg); 2031 fixed_object_reg);
2032 return MarkAsCall(DefineFixed(result, rax), instr); 2032 return MarkAsCall(DefineFixed(result, rax), instr);
2033 } 2033 }
2034 } 2034 }
2035 2035
2036 2036
2037 LInstruction* LChunkBuilder::DoStoreNamedField(HStoreNamedField* instr) { 2037 LInstruction* LChunkBuilder::DoStoreNamedField(HStoreNamedField* instr) {
2038 bool needs_write_barrier = instr->NeedsWriteBarrier(); 2038 bool needs_write_barrier = instr->NeedsWriteBarrier();
2039 bool needs_write_barrier_for_map = !instr->transition().is_null() &&
2040 instr->NeedsWriteBarrierForMap();
2039 2041
2040 LOperand* obj = needs_write_barrier 2042 LOperand* obj;
2041 ? UseTempRegister(instr->object()) 2043 if (needs_write_barrier) {
2042 : UseRegisterAtStart(instr->object()); 2044 obj = instr->is_in_object()
2045 ? UseRegister(instr->object())
2046 : UseTempRegister(instr->object());
2047 } else {
2048 obj = needs_write_barrier_for_map
2049 ? UseRegister(instr->object())
2050 : UseRegisterAtStart(instr->object());
2051 }
2043 2052
2044 LOperand* val = needs_write_barrier 2053 LOperand* val = needs_write_barrier
2045 ? UseTempRegister(instr->value()) 2054 ? UseTempRegister(instr->value())
2046 : UseRegister(instr->value()); 2055 : UseRegister(instr->value());
2047 2056
2048 // We only need a scratch register if we have a write barrier or we 2057 // We only need a scratch register if we have a write barrier or we
2049 // have a store into the properties array (not in-object-property). 2058 // have a store into the properties array (not in-object-property).
2050 LOperand* temp = (!instr->is_in_object() || needs_write_barrier) 2059 LOperand* temp = (!instr->is_in_object() || needs_write_barrier ||
2051 ? TempRegister() : NULL; 2060 needs_write_barrier_for_map) ? TempRegister() : NULL;
2052 2061
2053 return new(zone()) LStoreNamedField(obj, val, temp); 2062 return new(zone()) LStoreNamedField(obj, val, temp);
2054 } 2063 }
2055 2064
2056 2065
2057 LInstruction* LChunkBuilder::DoStoreNamedGeneric(HStoreNamedGeneric* instr) { 2066 LInstruction* LChunkBuilder::DoStoreNamedGeneric(HStoreNamedGeneric* instr) {
2058 LOperand* object = UseFixed(instr->object(), rdx); 2067 LOperand* object = UseFixed(instr->object(), rdx);
2059 LOperand* value = UseFixed(instr->value(), rax); 2068 LOperand* value = UseFixed(instr->value(), rax);
2060 2069
2061 LStoreNamedGeneric* result = new(zone()) LStoreNamedGeneric(object, value); 2070 LStoreNamedGeneric* result = new(zone()) LStoreNamedGeneric(object, value);
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
2316 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { 2325 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
2317 LOperand* object = UseRegister(instr->object()); 2326 LOperand* object = UseRegister(instr->object());
2318 LOperand* index = UseTempRegister(instr->index()); 2327 LOperand* index = UseTempRegister(instr->index());
2319 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); 2328 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index));
2320 } 2329 }
2321 2330
2322 2331
2323 } } // namespace v8::internal 2332 } } // namespace v8::internal
2324 2333
2325 #endif // V8_TARGET_ARCH_X64 2334 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/lithium-codegen-x64.cc ('k') | src/x64/stub-cache-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698