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

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

Issue 26841009: Make TestJSArrayForAllocationMemento less awkward. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Comments addressed. Created 7 years, 2 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/macro-assembler-ia32.cc ('k') | src/x64/lithium-codegen-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 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 Label* allocation_memento_found) { 256 Label* allocation_memento_found) {
257 // ----------- S t a t e ------------- 257 // ----------- S t a t e -------------
258 // -- rax : value 258 // -- rax : value
259 // -- rbx : target map 259 // -- rbx : target map
260 // -- rcx : key 260 // -- rcx : key
261 // -- rdx : receiver 261 // -- rdx : receiver
262 // -- rsp[0] : return address 262 // -- rsp[0] : return address
263 // ----------------------------------- 263 // -----------------------------------
264 if (mode == TRACK_ALLOCATION_SITE) { 264 if (mode == TRACK_ALLOCATION_SITE) {
265 ASSERT(allocation_memento_found != NULL); 265 ASSERT(allocation_memento_found != NULL);
266 __ TestJSArrayForAllocationMemento(rdx, rdi); 266 __ JumpIfJSArrayHasAllocationMemento(rdx, rdi, allocation_memento_found);
267 __ j(equal, allocation_memento_found);
268 } 267 }
269 268
270 // Set transitioned map. 269 // Set transitioned map.
271 __ movq(FieldOperand(rdx, HeapObject::kMapOffset), rbx); 270 __ movq(FieldOperand(rdx, HeapObject::kMapOffset), rbx);
272 __ RecordWriteField(rdx, 271 __ RecordWriteField(rdx,
273 HeapObject::kMapOffset, 272 HeapObject::kMapOffset,
274 rbx, 273 rbx,
275 rdi, 274 rdi,
276 kDontSaveFPRegs, 275 kDontSaveFPRegs,
277 EMIT_REMEMBERED_SET, 276 EMIT_REMEMBERED_SET,
278 OMIT_SMI_CHECK); 277 OMIT_SMI_CHECK);
279 } 278 }
280 279
281 280
282 void ElementsTransitionGenerator::GenerateSmiToDouble( 281 void ElementsTransitionGenerator::GenerateSmiToDouble(
283 MacroAssembler* masm, AllocationSiteMode mode, Label* fail) { 282 MacroAssembler* masm, AllocationSiteMode mode, Label* fail) {
284 // ----------- S t a t e ------------- 283 // ----------- S t a t e -------------
285 // -- rax : value 284 // -- rax : value
286 // -- rbx : target map 285 // -- rbx : target map
287 // -- rcx : key 286 // -- rcx : key
288 // -- rdx : receiver 287 // -- rdx : receiver
289 // -- rsp[0] : return address 288 // -- rsp[0] : return address
290 // ----------------------------------- 289 // -----------------------------------
291 // The fail label is not actually used since we do not allocate. 290 // The fail label is not actually used since we do not allocate.
292 Label allocated, new_backing_store, only_change_map, done; 291 Label allocated, new_backing_store, only_change_map, done;
293 292
294 if (mode == TRACK_ALLOCATION_SITE) { 293 if (mode == TRACK_ALLOCATION_SITE) {
295 __ TestJSArrayForAllocationMemento(rdx, rdi); 294 __ JumpIfJSArrayHasAllocationMemento(rdx, rdi, fail);
296 __ j(equal, fail);
297 } 295 }
298 296
299 // Check for empty arrays, which only require a map transition and no changes 297 // Check for empty arrays, which only require a map transition and no changes
300 // to the backing store. 298 // to the backing store.
301 __ movq(r8, FieldOperand(rdx, JSObject::kElementsOffset)); 299 __ movq(r8, FieldOperand(rdx, JSObject::kElementsOffset));
302 __ CompareRoot(r8, Heap::kEmptyFixedArrayRootIndex); 300 __ CompareRoot(r8, Heap::kEmptyFixedArrayRootIndex);
303 __ j(equal, &only_change_map); 301 __ j(equal, &only_change_map);
304 302
305 // Check backing store for COW-ness. For COW arrays we have to 303 // Check backing store for COW-ness. For COW arrays we have to
306 // allocate a new backing store. 304 // allocate a new backing store.
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 // ----------- S t a t e ------------- 409 // ----------- S t a t e -------------
412 // -- rax : value 410 // -- rax : value
413 // -- rbx : target map 411 // -- rbx : target map
414 // -- rcx : key 412 // -- rcx : key
415 // -- rdx : receiver 413 // -- rdx : receiver
416 // -- rsp[0] : return address 414 // -- rsp[0] : return address
417 // ----------------------------------- 415 // -----------------------------------
418 Label loop, entry, convert_hole, gc_required, only_change_map; 416 Label loop, entry, convert_hole, gc_required, only_change_map;
419 417
420 if (mode == TRACK_ALLOCATION_SITE) { 418 if (mode == TRACK_ALLOCATION_SITE) {
421 __ TestJSArrayForAllocationMemento(rdx, rdi); 419 __ JumpIfJSArrayHasAllocationMemento(rdx, rdi, fail);
422 __ j(equal, fail);
423 } 420 }
424 421
425 // Check for empty arrays, which only require a map transition and no changes 422 // Check for empty arrays, which only require a map transition and no changes
426 // to the backing store. 423 // to the backing store.
427 __ movq(r8, FieldOperand(rdx, JSObject::kElementsOffset)); 424 __ movq(r8, FieldOperand(rdx, JSObject::kElementsOffset));
428 __ CompareRoot(r8, Heap::kEmptyFixedArrayRootIndex); 425 __ CompareRoot(r8, Heap::kEmptyFixedArrayRootIndex);
429 __ j(equal, &only_change_map); 426 __ j(equal, &only_change_map);
430 427
431 __ push(rax); 428 __ push(rax);
432 429
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
762 // argument_count_reg_ * times_pointer_size + (receiver - 1) * kPointerSize. 759 // argument_count_reg_ * times_pointer_size + (receiver - 1) * kPointerSize.
763 return Operand(base_reg_, argument_count_reg_, times_pointer_size, 760 return Operand(base_reg_, argument_count_reg_, times_pointer_size,
764 displacement_to_last_argument + (receiver - 1 - index) * kPointerSize); 761 displacement_to_last_argument + (receiver - 1 - index) * kPointerSize);
765 } 762 }
766 } 763 }
767 764
768 765
769 } } // namespace v8::internal 766 } } // namespace v8::internal
770 767
771 #endif // V8_TARGET_ARCH_X64 768 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/ia32/macro-assembler-ia32.cc ('k') | src/x64/lithium-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698