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

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

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