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

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: Support transitions in LookupResult. Created 6 years, 9 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
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 __ JumpIfSmi(value_reg, miss_label);
536 }
532 } else if (representation.IsDouble()) { 537 } else if (representation.IsDouble()) {
533 Label do_store, heap_number; 538 Label do_store, heap_number;
534 __ AllocateHeapNumber(storage_reg, scratch1, scratch2, slow); 539 __ AllocateHeapNumber(storage_reg, scratch1, scratch2, slow);
535 540
536 __ JumpIfNotSmi(value_reg, &heap_number); 541 __ JumpIfNotSmi(value_reg, &heap_number);
537 __ SmiUntag(value_reg); 542 __ SmiUntag(value_reg);
538 if (CpuFeatures::IsSupported(SSE2)) { 543 if (CpuFeatures::IsSupported(SSE2)) {
539 CpuFeatureScope use_sse2(masm, SSE2); 544 CpuFeatureScope use_sse2(masm, SSE2);
540 __ Cvtsi2sd(xmm0, value_reg); 545 __ Cvtsi2sd(xmm0, value_reg);
541 } else { 546 } 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 696 // 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 697 // 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. 698 // object and the number of in-object properties is not going to change.
694 index -= object->map()->inobject_properties(); 699 index -= object->map()->inobject_properties();
695 700
696 Representation representation = lookup->representation(); 701 Representation representation = lookup->representation();
697 ASSERT(!representation.IsNone()); 702 ASSERT(!representation.IsNone());
698 if (representation.IsSmi()) { 703 if (representation.IsSmi()) {
699 __ JumpIfNotSmi(value_reg, miss_label); 704 __ JumpIfNotSmi(value_reg, miss_label);
700 } else if (representation.IsHeapObject()) { 705 } else if (representation.IsHeapObject()) {
701 __ JumpIfSmi(value_reg, miss_label); 706 HeapType* field_type = lookup->GetFieldType();
707 if (field_type->IsClass()) {
708 __ CheckMap(value_reg, field_type->AsClass(), miss_label, DO_SMI_CHECK);
709 } else {
710 __ JumpIfSmi(value_reg, miss_label);
711 }
702 } else if (representation.IsDouble()) { 712 } else if (representation.IsDouble()) {
703 // Load the double storage. 713 // Load the double storage.
704 if (index < 0) { 714 if (index < 0) {
705 int offset = object->map()->instance_size() + (index * kPointerSize); 715 int offset = object->map()->instance_size() + (index * kPointerSize);
706 __ mov(scratch1, FieldOperand(receiver_reg, offset)); 716 __ mov(scratch1, FieldOperand(receiver_reg, offset));
707 } else { 717 } else {
708 __ mov(scratch1, FieldOperand(receiver_reg, JSObject::kPropertiesOffset)); 718 __ mov(scratch1, FieldOperand(receiver_reg, JSObject::kPropertiesOffset));
709 int offset = index * kPointerSize + FixedArray::kHeaderSize; 719 int offset = index * kPointerSize + FixedArray::kHeaderSize;
710 __ mov(scratch1, FieldOperand(scratch1, offset)); 720 __ mov(scratch1, FieldOperand(scratch1, offset));
711 } 721 }
(...skipping 823 matching lines...) Expand 10 before | Expand all | Expand 10 after
1535 // ----------------------------------- 1545 // -----------------------------------
1536 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); 1546 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss);
1537 } 1547 }
1538 1548
1539 1549
1540 #undef __ 1550 #undef __
1541 1551
1542 } } // namespace v8::internal 1552 } } // namespace v8::internal
1543 1553
1544 #endif // V8_TARGET_ARCH_IA32 1554 #endif // V8_TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698