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

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

Issue 167303005: Track field types. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments 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/ia32/lithium-codegen-ia32.cc ('k') | src/ic.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 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 if (field_type->IsClass()) {
533 __ CheckMap(value_reg, field_type->AsClass(), miss_label, DO_SMI_CHECK);
534 } else {
535 ASSERT(HeapType::Any()->Is(field_type));
536 __ JumpIfSmi(value_reg, miss_label);
537 }
532 } else if (representation.IsDouble()) { 538 } else if (representation.IsDouble()) {
533 Label do_store, heap_number; 539 Label do_store, heap_number;
534 __ AllocateHeapNumber(storage_reg, scratch1, scratch2, slow); 540 __ AllocateHeapNumber(storage_reg, scratch1, scratch2, slow);
535 541
536 __ JumpIfNotSmi(value_reg, &heap_number); 542 __ JumpIfNotSmi(value_reg, &heap_number);
537 __ SmiUntag(value_reg); 543 __ SmiUntag(value_reg);
538 if (CpuFeatures::IsSupported(SSE2)) { 544 if (CpuFeatures::IsSupported(SSE2)) {
539 CpuFeatureScope use_sse2(masm, SSE2); 545 CpuFeatureScope use_sse2(masm, SSE2);
540 __ Cvtsi2sd(xmm0, value_reg); 546 __ Cvtsi2sd(xmm0, value_reg);
541 } else { 547 } else {
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
691 // Adjust for the number of properties stored in the object. Even in the 697 // Adjust for the number of properties stored in the object. Even in the
692 // face of a transition we can use the old map here because the size of the 698 // face of a transition we can use the old map here because the size of the
693 // object and the number of in-object properties is not going to change. 699 // object and the number of in-object properties is not going to change.
694 index -= object->map()->inobject_properties(); 700 index -= object->map()->inobject_properties();
695 701
696 Representation representation = lookup->representation(); 702 Representation representation = lookup->representation();
697 ASSERT(!representation.IsNone()); 703 ASSERT(!representation.IsNone());
698 if (representation.IsSmi()) { 704 if (representation.IsSmi()) {
699 __ JumpIfNotSmi(value_reg, miss_label); 705 __ JumpIfNotSmi(value_reg, miss_label);
700 } else if (representation.IsHeapObject()) { 706 } else if (representation.IsHeapObject()) {
701 __ JumpIfSmi(value_reg, miss_label); 707 HeapType* field_type = lookup->GetFieldType();
708 if (field_type->IsClass()) {
709 __ CheckMap(value_reg, field_type->AsClass(), miss_label, DO_SMI_CHECK);
710 } else {
711 ASSERT(HeapType::Any()->Is(field_type));
712 __ JumpIfSmi(value_reg, miss_label);
713 }
702 } else if (representation.IsDouble()) { 714 } else if (representation.IsDouble()) {
703 // Load the double storage. 715 // Load the double storage.
704 if (index < 0) { 716 if (index < 0) {
705 int offset = object->map()->instance_size() + (index * kPointerSize); 717 int offset = object->map()->instance_size() + (index * kPointerSize);
706 __ mov(scratch1, FieldOperand(receiver_reg, offset)); 718 __ mov(scratch1, FieldOperand(receiver_reg, offset));
707 } else { 719 } else {
708 __ mov(scratch1, FieldOperand(receiver_reg, JSObject::kPropertiesOffset)); 720 __ mov(scratch1, FieldOperand(receiver_reg, JSObject::kPropertiesOffset));
709 int offset = index * kPointerSize + FixedArray::kHeaderSize; 721 int offset = index * kPointerSize + FixedArray::kHeaderSize;
710 __ mov(scratch1, FieldOperand(scratch1, offset)); 722 __ mov(scratch1, FieldOperand(scratch1, offset));
711 } 723 }
(...skipping 823 matching lines...) Expand 10 before | Expand all | Expand 10 after
1535 // ----------------------------------- 1547 // -----------------------------------
1536 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); 1548 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss);
1537 } 1549 }
1538 1550
1539 1551
1540 #undef __ 1552 #undef __
1541 1553
1542 } } // namespace v8::internal 1554 } } // namespace v8::internal
1543 1555
1544 #endif // V8_TARGET_ARCH_IA32 1556 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/lithium-codegen-ia32.cc ('k') | src/ic.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698