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

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

Issue 7929001: Initialize pre-allocated fields of JSObject with undefined. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 3 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
« src/ia32/builtins-ia32.cc ('K') | « src/objects-inl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 // rbx: JSObject (not HeapObject tagged - the actual address). 200 // rbx: JSObject (not HeapObject tagged - the actual address).
201 // rdi: start of next object 201 // rdi: start of next object
202 __ movq(Operand(rbx, JSObject::kMapOffset), rax); 202 __ movq(Operand(rbx, JSObject::kMapOffset), rax);
203 __ LoadRoot(rcx, Heap::kEmptyFixedArrayRootIndex); 203 __ LoadRoot(rcx, Heap::kEmptyFixedArrayRootIndex);
204 __ movq(Operand(rbx, JSObject::kPropertiesOffset), rcx); 204 __ movq(Operand(rbx, JSObject::kPropertiesOffset), rcx);
205 __ movq(Operand(rbx, JSObject::kElementsOffset), rcx); 205 __ movq(Operand(rbx, JSObject::kElementsOffset), rcx);
206 // Set extra fields in the newly allocated object. 206 // Set extra fields in the newly allocated object.
207 // rax: initial map 207 // rax: initial map
208 // rbx: JSObject 208 // rbx: JSObject
209 // rdi: start of next object 209 // rdi: start of next object
210 { Label loop, entry; 210 { Label loop, entry, load_one_pointer_filler, continue_loop;
211 // To allow for truncation. 211 // To allow for truncation.
212 __ lea(rcx, Operand(rbx, JSObject::kHeaderSize));
213 __ LoadRoot(rdx, Heap::kUndefinedValueRootIndex);
212 if (count_constructions) { 214 if (count_constructions) {
215 __ movzxbq(rsi,
216 FieldOperand(rax, Map::kPreAllocatedPropertyFieldsOffset));
217 __ incq(rsi);
218 __ jmp(&entry);
219 __ bind(&load_one_pointer_filler);
213 __ LoadRoot(rdx, Heap::kOnePointerFillerMapRootIndex); 220 __ LoadRoot(rdx, Heap::kOnePointerFillerMapRootIndex);
214 } else { 221 __ jmp(&continue_loop);
215 __ LoadRoot(rdx, Heap::kUndefinedValueRootIndex);
216 } 222 }
217 __ lea(rcx, Operand(rbx, JSObject::kHeaderSize));
218 __ jmp(&entry); 223 __ jmp(&entry);
219 __ bind(&loop); 224 __ bind(&loop);
220 __ movq(Operand(rcx, 0), rdx); 225 __ movq(Operand(rcx, 0), rdx);
221 __ addq(rcx, Immediate(kPointerSize)); 226 __ addq(rcx, Immediate(kPointerSize));
222 __ bind(&entry); 227 __ bind(&entry);
228 if (count_constructions) {
229 __ decq(rsi);
230 __ j(zero, &load_one_pointer_filler);
231 __ bind(&continue_loop);
232 }
223 __ cmpq(rcx, rdi); 233 __ cmpq(rcx, rdi);
224 __ j(less, &loop); 234 __ j(less, &loop);
225 } 235 }
226 236
227 // Add the object tag to make the JSObject real, so that we can continue 237 // Add the object tag to make the JSObject real, so that we can continue
228 // and jump into the continuation code at any time from now on. Any 238 // and jump into the continuation code at any time from now on. Any
229 // failures need to undo the allocation, so that the heap is in a 239 // failures need to undo the allocation, so that the heap is in a
230 // consistent state and verifiable. 240 // consistent state and verifiable.
231 // rax: initial map 241 // rax: initial map
232 // rbx: JSObject 242 // rbx: JSObject
(...skipping 1352 matching lines...) Expand 10 before | Expand all | Expand 10 after
1585 Deoptimizer::EntryGenerator generator(masm, Deoptimizer::OSR); 1595 Deoptimizer::EntryGenerator generator(masm, Deoptimizer::OSR);
1586 generator.Generate(); 1596 generator.Generate();
1587 } 1597 }
1588 1598
1589 1599
1590 #undef __ 1600 #undef __
1591 1601
1592 } } // namespace v8::internal 1602 } } // namespace v8::internal
1593 1603
1594 #endif // V8_TARGET_ARCH_X64 1604 #endif // V8_TARGET_ARCH_X64
OLDNEW
« src/ia32/builtins-ia32.cc ('K') | « src/objects-inl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698