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

Side by Side Diff: src/x64/stub-cache-x64.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 476 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 Representation representation = details.representation(); 487 Representation representation = details.representation();
488 ASSERT(!representation.IsNone()); 488 ASSERT(!representation.IsNone());
489 489
490 if (details.type() == CONSTANT) { 490 if (details.type() == CONSTANT) {
491 Handle<Object> constant(descriptors->GetValue(descriptor), masm->isolate()); 491 Handle<Object> constant(descriptors->GetValue(descriptor), masm->isolate());
492 __ Cmp(value_reg, constant); 492 __ Cmp(value_reg, constant);
493 __ j(not_equal, miss_label); 493 __ j(not_equal, miss_label);
494 } else if (representation.IsSmi()) { 494 } else if (representation.IsSmi()) {
495 __ JumpIfNotSmi(value_reg, miss_label); 495 __ JumpIfNotSmi(value_reg, miss_label);
496 } else if (representation.IsHeapObject()) { 496 } else if (representation.IsHeapObject()) {
497 __ JumpIfSmi(value_reg, miss_label); 497 HeapType* field_type = descriptors->GetFieldType(descriptor);
498 if (field_type->IsClass()) {
499 __ CheckMap(value_reg, field_type->AsClass(), miss_label, DO_SMI_CHECK);
500 } else {
501 __ JumpIfSmi(value_reg, miss_label);
502 }
498 } else if (representation.IsDouble()) { 503 } else if (representation.IsDouble()) {
499 Label do_store, heap_number; 504 Label do_store, heap_number;
500 __ AllocateHeapNumber(storage_reg, scratch1, slow); 505 __ AllocateHeapNumber(storage_reg, scratch1, slow);
501 506
502 __ JumpIfNotSmi(value_reg, &heap_number); 507 __ JumpIfNotSmi(value_reg, &heap_number);
503 __ SmiToInteger32(scratch1, value_reg); 508 __ SmiToInteger32(scratch1, value_reg);
504 __ Cvtlsi2sd(xmm0, scratch1); 509 __ Cvtlsi2sd(xmm0, scratch1);
505 __ jmp(&do_store); 510 __ jmp(&do_store);
506 511
507 __ bind(&heap_number); 512 __ bind(&heap_number);
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
631 // Adjust for the number of properties stored in the object. Even in the 636 // Adjust for the number of properties stored in the object. Even in the
632 // face of a transition we can use the old map here because the size of the 637 // face of a transition we can use the old map here because the size of the
633 // object and the number of in-object properties is not going to change. 638 // object and the number of in-object properties is not going to change.
634 index -= object->map()->inobject_properties(); 639 index -= object->map()->inobject_properties();
635 640
636 Representation representation = lookup->representation(); 641 Representation representation = lookup->representation();
637 ASSERT(!representation.IsNone()); 642 ASSERT(!representation.IsNone());
638 if (representation.IsSmi()) { 643 if (representation.IsSmi()) {
639 __ JumpIfNotSmi(value_reg, miss_label); 644 __ JumpIfNotSmi(value_reg, miss_label);
640 } else if (representation.IsHeapObject()) { 645 } else if (representation.IsHeapObject()) {
641 __ JumpIfSmi(value_reg, miss_label); 646 HeapType* field_type = lookup->GetFieldType();
647 if (field_type->IsClass()) {
648 __ CheckMap(value_reg, field_type->AsClass(), miss_label, DO_SMI_CHECK);
649 } else {
650 __ JumpIfSmi(value_reg, miss_label);
651 }
642 } else if (representation.IsDouble()) { 652 } else if (representation.IsDouble()) {
643 // Load the double storage. 653 // Load the double storage.
644 if (index < 0) { 654 if (index < 0) {
645 int offset = object->map()->instance_size() + (index * kPointerSize); 655 int offset = object->map()->instance_size() + (index * kPointerSize);
646 __ movp(scratch1, FieldOperand(receiver_reg, offset)); 656 __ movp(scratch1, FieldOperand(receiver_reg, offset));
647 } else { 657 } else {
648 __ movp(scratch1, 658 __ movp(scratch1,
649 FieldOperand(receiver_reg, JSObject::kPropertiesOffset)); 659 FieldOperand(receiver_reg, JSObject::kPropertiesOffset));
650 int offset = index * kPointerSize + FixedArray::kHeaderSize; 660 int offset = index * kPointerSize + FixedArray::kHeaderSize;
651 __ movp(scratch1, FieldOperand(scratch1, offset)); 661 __ movp(scratch1, FieldOperand(scratch1, offset));
(...skipping 790 matching lines...) Expand 10 before | Expand all | Expand 10 after
1442 // ----------------------------------- 1452 // -----------------------------------
1443 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); 1453 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss);
1444 } 1454 }
1445 1455
1446 1456
1447 #undef __ 1457 #undef __
1448 1458
1449 } } // namespace v8::internal 1459 } } // namespace v8::internal
1450 1460
1451 #endif // V8_TARGET_ARCH_X64 1461 #endif // V8_TARGET_ARCH_X64
OLDNEW
« src/property.h ('K') | « src/property.cc ('k') | test/mjsunit/field-type-tracking.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698