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

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

Issue 236843002: Revert "Track field types." (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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/x64/lithium-codegen-x64.cc ('k') | test/mjsunit/field-type-tracking.js » ('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 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 HeapType* field_type = descriptors->GetFieldType(descriptor); 497 __ JumpIfSmi(value_reg, miss_label);
498 if (field_type->IsClass()) {
499 __ CheckMap(value_reg, field_type->AsClass(), miss_label, DO_SMI_CHECK);
500 } else {
501 ASSERT(HeapType::Any()->Is(field_type));
502 __ JumpIfSmi(value_reg, miss_label);
503 }
504 } else if (representation.IsDouble()) { 498 } else if (representation.IsDouble()) {
505 Label do_store, heap_number; 499 Label do_store, heap_number;
506 __ AllocateHeapNumber(storage_reg, scratch1, slow); 500 __ AllocateHeapNumber(storage_reg, scratch1, slow);
507 501
508 __ JumpIfNotSmi(value_reg, &heap_number); 502 __ JumpIfNotSmi(value_reg, &heap_number);
509 __ SmiToInteger32(scratch1, value_reg); 503 __ SmiToInteger32(scratch1, value_reg);
510 __ Cvtlsi2sd(xmm0, scratch1); 504 __ Cvtlsi2sd(xmm0, scratch1);
511 __ jmp(&do_store); 505 __ jmp(&do_store);
512 506
513 __ bind(&heap_number); 507 __ bind(&heap_number);
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
637 // Adjust for the number of properties stored in the object. Even in the 631 // Adjust for the number of properties stored in the object. Even in the
638 // face of a transition we can use the old map here because the size of the 632 // face of a transition we can use the old map here because the size of the
639 // object and the number of in-object properties is not going to change. 633 // object and the number of in-object properties is not going to change.
640 index -= object->map()->inobject_properties(); 634 index -= object->map()->inobject_properties();
641 635
642 Representation representation = lookup->representation(); 636 Representation representation = lookup->representation();
643 ASSERT(!representation.IsNone()); 637 ASSERT(!representation.IsNone());
644 if (representation.IsSmi()) { 638 if (representation.IsSmi()) {
645 __ JumpIfNotSmi(value_reg, miss_label); 639 __ JumpIfNotSmi(value_reg, miss_label);
646 } else if (representation.IsHeapObject()) { 640 } else if (representation.IsHeapObject()) {
647 HeapType* field_type = lookup->GetFieldType(); 641 __ JumpIfSmi(value_reg, miss_label);
648 if (field_type->IsClass()) {
649 __ CheckMap(value_reg, field_type->AsClass(), miss_label, DO_SMI_CHECK);
650 } else {
651 ASSERT(HeapType::Any()->Is(field_type));
652 __ JumpIfSmi(value_reg, miss_label);
653 }
654 } else if (representation.IsDouble()) { 642 } else if (representation.IsDouble()) {
655 // Load the double storage. 643 // Load the double storage.
656 if (index < 0) { 644 if (index < 0) {
657 int offset = object->map()->instance_size() + (index * kPointerSize); 645 int offset = object->map()->instance_size() + (index * kPointerSize);
658 __ movp(scratch1, FieldOperand(receiver_reg, offset)); 646 __ movp(scratch1, FieldOperand(receiver_reg, offset));
659 } else { 647 } else {
660 __ movp(scratch1, 648 __ movp(scratch1,
661 FieldOperand(receiver_reg, JSObject::kPropertiesOffset)); 649 FieldOperand(receiver_reg, JSObject::kPropertiesOffset));
662 int offset = index * kPointerSize + FixedArray::kHeaderSize; 650 int offset = index * kPointerSize + FixedArray::kHeaderSize;
663 __ movp(scratch1, FieldOperand(scratch1, offset)); 651 __ movp(scratch1, FieldOperand(scratch1, offset));
(...skipping 790 matching lines...) Expand 10 before | Expand all | Expand 10 after
1454 // ----------------------------------- 1442 // -----------------------------------
1455 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); 1443 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss);
1456 } 1444 }
1457 1445
1458 1446
1459 #undef __ 1447 #undef __
1460 1448
1461 } } // namespace v8::internal 1449 } } // namespace v8::internal
1462 1450
1463 #endif // V8_TARGET_ARCH_X64 1451 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/lithium-codegen-x64.cc ('k') | test/mjsunit/field-type-tracking.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698