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

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

Issue 237963016: Revert "Implement structural function and array 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/types-inl.h ('k') | test/cctest/test-types.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 478 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 HeapType* field_type = descriptors->GetFieldType(descriptor);
498 if (field_type->IsClass()) { 498 if (field_type->IsClass()) {
499 __ CheckMap(value_reg, field_type->AsClass()->Map(), 499 __ CheckMap(value_reg, field_type->AsClass(), miss_label, DO_SMI_CHECK);
500 miss_label, DO_SMI_CHECK);
501 } else { 500 } else {
502 ASSERT(HeapType::Any()->Is(field_type)); 501 ASSERT(HeapType::Any()->Is(field_type));
503 __ JumpIfSmi(value_reg, miss_label); 502 __ JumpIfSmi(value_reg, miss_label);
504 } 503 }
505 } else if (representation.IsDouble()) { 504 } else if (representation.IsDouble()) {
506 Label do_store, heap_number; 505 Label do_store, heap_number;
507 __ AllocateHeapNumber(storage_reg, scratch1, slow); 506 __ AllocateHeapNumber(storage_reg, scratch1, slow);
508 507
509 __ JumpIfNotSmi(value_reg, &heap_number); 508 __ JumpIfNotSmi(value_reg, &heap_number);
510 __ SmiToInteger32(scratch1, value_reg); 509 __ SmiToInteger32(scratch1, value_reg);
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
640 // object and the number of in-object properties is not going to change. 639 // object and the number of in-object properties is not going to change.
641 index -= object->map()->inobject_properties(); 640 index -= object->map()->inobject_properties();
642 641
643 Representation representation = lookup->representation(); 642 Representation representation = lookup->representation();
644 ASSERT(!representation.IsNone()); 643 ASSERT(!representation.IsNone());
645 if (representation.IsSmi()) { 644 if (representation.IsSmi()) {
646 __ JumpIfNotSmi(value_reg, miss_label); 645 __ JumpIfNotSmi(value_reg, miss_label);
647 } else if (representation.IsHeapObject()) { 646 } else if (representation.IsHeapObject()) {
648 HeapType* field_type = lookup->GetFieldType(); 647 HeapType* field_type = lookup->GetFieldType();
649 if (field_type->IsClass()) { 648 if (field_type->IsClass()) {
650 __ CheckMap(value_reg, field_type->AsClass()->Map(), 649 __ CheckMap(value_reg, field_type->AsClass(), miss_label, DO_SMI_CHECK);
651 miss_label, DO_SMI_CHECK);
652 } else { 650 } else {
653 ASSERT(HeapType::Any()->Is(field_type)); 651 ASSERT(HeapType::Any()->Is(field_type));
654 __ JumpIfSmi(value_reg, miss_label); 652 __ JumpIfSmi(value_reg, miss_label);
655 } 653 }
656 } else if (representation.IsDouble()) { 654 } else if (representation.IsDouble()) {
657 // Load the double storage. 655 // Load the double storage.
658 if (index < 0) { 656 if (index < 0) {
659 int offset = object->map()->instance_size() + (index * kPointerSize); 657 int offset = object->map()->instance_size() + (index * kPointerSize);
660 __ movp(scratch1, FieldOperand(receiver_reg, offset)); 658 __ movp(scratch1, FieldOperand(receiver_reg, offset));
661 } else { 659 } else {
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
748 ASSERT(!scratch2.is(object_reg) && !scratch2.is(holder_reg) 746 ASSERT(!scratch2.is(object_reg) && !scratch2.is(holder_reg)
749 && !scratch2.is(scratch1)); 747 && !scratch2.is(scratch1));
750 748
751 // Keep track of the current object in register reg. On the first 749 // Keep track of the current object in register reg. On the first
752 // iteration, reg is an alias for object_reg, on later iterations, 750 // iteration, reg is an alias for object_reg, on later iterations,
753 // it is an alias for holder_reg. 751 // it is an alias for holder_reg.
754 Register reg = object_reg; 752 Register reg = object_reg;
755 int depth = 0; 753 int depth = 0;
756 754
757 Handle<JSObject> current = Handle<JSObject>::null(); 755 Handle<JSObject> current = Handle<JSObject>::null();
758 if (type->IsConstant()) { 756 if (type->IsConstant()) current = Handle<JSObject>::cast(type->AsConstant());
759 current = Handle<JSObject>::cast(type->AsConstant()->Value());
760 }
761 Handle<JSObject> prototype = Handle<JSObject>::null(); 757 Handle<JSObject> prototype = Handle<JSObject>::null();
762 Handle<Map> current_map = receiver_map; 758 Handle<Map> current_map = receiver_map;
763 Handle<Map> holder_map(holder->map()); 759 Handle<Map> holder_map(holder->map());
764 // Traverse the prototype chain and check the maps in the prototype chain for 760 // Traverse the prototype chain and check the maps in the prototype chain for
765 // fast and global objects or do negative lookup for normal objects. 761 // fast and global objects or do negative lookup for normal objects.
766 while (!current_map.is_identical_to(holder_map)) { 762 while (!current_map.is_identical_to(holder_map)) {
767 ++depth; 763 ++depth;
768 764
769 // Only global objects and objects that do not require access 765 // Only global objects and objects that do not require access
770 // checks are allowed in stubs. 766 // checks are allowed in stubs.
(...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after
1458 // ----------------------------------- 1454 // -----------------------------------
1459 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); 1455 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss);
1460 } 1456 }
1461 1457
1462 1458
1463 #undef __ 1459 #undef __
1464 1460
1465 } } // namespace v8::internal 1461 } } // namespace v8::internal
1466 1462
1467 #endif // V8_TARGET_ARCH_X64 1463 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/types-inl.h ('k') | test/cctest/test-types.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698