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

Side by Side Diff: src/ia32/stub-cache-ia32.cc

Issue 240813002: Track up to 5 stable maps as field type. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fixes Created 6 years, 8 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/arm64/stub-cache-arm64.cc ('k') | src/objects.h » ('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 510 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 Representation representation = details.representation(); 521 Representation representation = details.representation();
522 ASSERT(!representation.IsNone()); 522 ASSERT(!representation.IsNone());
523 523
524 if (details.type() == CONSTANT) { 524 if (details.type() == CONSTANT) {
525 Handle<Object> constant(descriptors->GetValue(descriptor), masm->isolate()); 525 Handle<Object> constant(descriptors->GetValue(descriptor), masm->isolate());
526 __ CmpObject(value_reg, constant); 526 __ CmpObject(value_reg, constant);
527 __ j(not_equal, miss_label); 527 __ j(not_equal, miss_label);
528 } else if (representation.IsSmi()) { 528 } else if (representation.IsSmi()) {
529 __ JumpIfNotSmi(value_reg, miss_label); 529 __ JumpIfNotSmi(value_reg, miss_label);
530 } else if (representation.IsHeapObject()) { 530 } else if (representation.IsHeapObject()) {
531 __ JumpIfSmi(value_reg, miss_label);
531 HeapType* field_type = descriptors->GetFieldType(descriptor); 532 HeapType* field_type = descriptors->GetFieldType(descriptor);
532 if (field_type->IsClass()) { 533 HeapType::Iterator<Map> it = field_type->Classes();
533 __ CheckMap(value_reg, field_type->AsClass()->Map(), 534 if (!it.Done()) {
534 miss_label, DO_SMI_CHECK); 535 Label do_store;
535 } else { 536 while (true) {
536 ASSERT(HeapType::Any()->Is(field_type)); 537 __ CompareMap(value_reg, it.Current());
537 __ JumpIfSmi(value_reg, miss_label); 538 it.Advance();
539 if (it.Done()) {
540 __ j(not_equal, miss_label);
541 break;
542 }
543 __ j(equal, &do_store, Label::kNear);
544 }
545 __ bind(&do_store);
538 } 546 }
539 } else if (representation.IsDouble()) { 547 } else if (representation.IsDouble()) {
540 Label do_store, heap_number; 548 Label do_store, heap_number;
541 __ AllocateHeapNumber(storage_reg, scratch1, scratch2, slow); 549 __ AllocateHeapNumber(storage_reg, scratch1, scratch2, slow);
542 550
543 __ JumpIfNotSmi(value_reg, &heap_number); 551 __ JumpIfNotSmi(value_reg, &heap_number);
544 __ SmiUntag(value_reg); 552 __ SmiUntag(value_reg);
545 if (CpuFeatures::IsSupported(SSE2)) { 553 if (CpuFeatures::IsSupported(SSE2)) {
546 CpuFeatureScope use_sse2(masm, SSE2); 554 CpuFeatureScope use_sse2(masm, SSE2);
547 __ Cvtsi2sd(xmm0, value_reg); 555 __ Cvtsi2sd(xmm0, value_reg);
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
698 // Adjust for the number of properties stored in the object. Even in the 706 // Adjust for the number of properties stored in the object. Even in the
699 // face of a transition we can use the old map here because the size of the 707 // face of a transition we can use the old map here because the size of the
700 // object and the number of in-object properties is not going to change. 708 // object and the number of in-object properties is not going to change.
701 index -= object->map()->inobject_properties(); 709 index -= object->map()->inobject_properties();
702 710
703 Representation representation = lookup->representation(); 711 Representation representation = lookup->representation();
704 ASSERT(!representation.IsNone()); 712 ASSERT(!representation.IsNone());
705 if (representation.IsSmi()) { 713 if (representation.IsSmi()) {
706 __ JumpIfNotSmi(value_reg, miss_label); 714 __ JumpIfNotSmi(value_reg, miss_label);
707 } else if (representation.IsHeapObject()) { 715 } else if (representation.IsHeapObject()) {
716 __ JumpIfSmi(value_reg, miss_label);
708 HeapType* field_type = lookup->GetFieldType(); 717 HeapType* field_type = lookup->GetFieldType();
709 if (field_type->IsClass()) { 718 HeapType::Iterator<Map> it = field_type->Classes();
710 __ CheckMap(value_reg, field_type->AsClass()->Map(), 719 if (!it.Done()) {
711 miss_label, DO_SMI_CHECK); 720 Label do_store;
712 } else { 721 while (true) {
713 ASSERT(HeapType::Any()->Is(field_type)); 722 __ CompareMap(value_reg, it.Current());
714 __ JumpIfSmi(value_reg, miss_label); 723 it.Advance();
724 if (it.Done()) {
725 __ j(not_equal, miss_label);
726 break;
727 }
728 __ j(equal, &do_store, Label::kNear);
729 }
730 __ bind(&do_store);
715 } 731 }
716 } else if (representation.IsDouble()) { 732 } else if (representation.IsDouble()) {
717 // Load the double storage. 733 // Load the double storage.
718 if (index < 0) { 734 if (index < 0) {
719 int offset = object->map()->instance_size() + (index * kPointerSize); 735 int offset = object->map()->instance_size() + (index * kPointerSize);
720 __ mov(scratch1, FieldOperand(receiver_reg, offset)); 736 __ mov(scratch1, FieldOperand(receiver_reg, offset));
721 } else { 737 } else {
722 __ mov(scratch1, FieldOperand(receiver_reg, JSObject::kPropertiesOffset)); 738 __ mov(scratch1, FieldOperand(receiver_reg, JSObject::kPropertiesOffset));
723 int offset = index * kPointerSize + FixedArray::kHeaderSize; 739 int offset = index * kPointerSize + FixedArray::kHeaderSize;
724 __ mov(scratch1, FieldOperand(scratch1, offset)); 740 __ mov(scratch1, FieldOperand(scratch1, offset));
(...skipping 825 matching lines...) Expand 10 before | Expand all | Expand 10 after
1550 // ----------------------------------- 1566 // -----------------------------------
1551 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); 1567 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss);
1552 } 1568 }
1553 1569
1554 1570
1555 #undef __ 1571 #undef __
1556 1572
1557 } } // namespace v8::internal 1573 } } // namespace v8::internal
1558 1574
1559 #endif // V8_TARGET_ARCH_IA32 1575 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/arm64/stub-cache-arm64.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698