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

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

Issue 238943002: MIPS: Reland "Track field types.". (Closed) Base URL: https://github.com/v8/v8.git@gbl
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
« no previous file with comments | « src/mips/lithium-codegen-mips.cc ('k') | no next file » | 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 397 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 Representation representation = details.representation(); 408 Representation representation = details.representation();
409 ASSERT(!representation.IsNone()); 409 ASSERT(!representation.IsNone());
410 410
411 if (details.type() == CONSTANT) { 411 if (details.type() == CONSTANT) {
412 Handle<Object> constant(descriptors->GetValue(descriptor), masm->isolate()); 412 Handle<Object> constant(descriptors->GetValue(descriptor), masm->isolate());
413 __ li(scratch1, constant); 413 __ li(scratch1, constant);
414 __ Branch(miss_label, ne, value_reg, Operand(scratch1)); 414 __ Branch(miss_label, ne, value_reg, Operand(scratch1));
415 } else if (representation.IsSmi()) { 415 } else if (representation.IsSmi()) {
416 __ JumpIfNotSmi(value_reg, miss_label); 416 __ JumpIfNotSmi(value_reg, miss_label);
417 } else if (representation.IsHeapObject()) { 417 } else if (representation.IsHeapObject()) {
418 __ JumpIfSmi(value_reg, miss_label); 418 HeapType* field_type = descriptors->GetFieldType(descriptor);
419 if (field_type->IsClass()) {
420 __ CheckMap(value_reg, scratch1, field_type->AsClass(),
421 miss_label, DO_SMI_CHECK);
422 } else {
423 ASSERT(HeapType::Any()->Is(field_type));
424 __ JumpIfSmi(value_reg, miss_label);
425 }
419 } else if (representation.IsDouble()) { 426 } else if (representation.IsDouble()) {
420 Label do_store, heap_number; 427 Label do_store, heap_number;
421 __ LoadRoot(scratch3, Heap::kHeapNumberMapRootIndex); 428 __ LoadRoot(scratch3, Heap::kHeapNumberMapRootIndex);
422 __ AllocateHeapNumber(storage_reg, scratch1, scratch2, scratch3, slow); 429 __ AllocateHeapNumber(storage_reg, scratch1, scratch2, scratch3, slow);
423 430
424 __ JumpIfNotSmi(value_reg, &heap_number); 431 __ JumpIfNotSmi(value_reg, &heap_number);
425 __ SmiUntag(scratch1, value_reg); 432 __ SmiUntag(scratch1, value_reg);
426 __ mtc1(scratch1, f6); 433 __ mtc1(scratch1, f6);
427 __ cvt_d_w(f4, f6); 434 __ cvt_d_w(f4, f6);
428 __ jmp(&do_store); 435 __ jmp(&do_store);
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
571 // Adjust for the number of properties stored in the object. Even in the 578 // Adjust for the number of properties stored in the object. Even in the
572 // face of a transition we can use the old map here because the size of the 579 // face of a transition we can use the old map here because the size of the
573 // object and the number of in-object properties is not going to change. 580 // object and the number of in-object properties is not going to change.
574 index -= object->map()->inobject_properties(); 581 index -= object->map()->inobject_properties();
575 582
576 Representation representation = lookup->representation(); 583 Representation representation = lookup->representation();
577 ASSERT(!representation.IsNone()); 584 ASSERT(!representation.IsNone());
578 if (representation.IsSmi()) { 585 if (representation.IsSmi()) {
579 __ JumpIfNotSmi(value_reg, miss_label); 586 __ JumpIfNotSmi(value_reg, miss_label);
580 } else if (representation.IsHeapObject()) { 587 } else if (representation.IsHeapObject()) {
581 __ JumpIfSmi(value_reg, miss_label); 588 HeapType* field_type = lookup->GetFieldType();
589 if (field_type->IsClass()) {
590 __ CheckMap(value_reg, scratch1, field_type->AsClass(),
591 miss_label, DO_SMI_CHECK);
592 } else {
593 ASSERT(HeapType::Any()->Is(field_type));
594 __ JumpIfSmi(value_reg, miss_label);
595 }
582 } else if (representation.IsDouble()) { 596 } else if (representation.IsDouble()) {
583 // Load the double storage. 597 // Load the double storage.
584 if (index < 0) { 598 if (index < 0) {
585 int offset = object->map()->instance_size() + (index * kPointerSize); 599 int offset = object->map()->instance_size() + (index * kPointerSize);
586 __ lw(scratch1, FieldMemOperand(receiver_reg, offset)); 600 __ lw(scratch1, FieldMemOperand(receiver_reg, offset));
587 } else { 601 } else {
588 __ lw(scratch1, 602 __ lw(scratch1,
589 FieldMemOperand(receiver_reg, JSObject::kPropertiesOffset)); 603 FieldMemOperand(receiver_reg, JSObject::kPropertiesOffset));
590 int offset = index * kPointerSize + FixedArray::kHeaderSize; 604 int offset = index * kPointerSize + FixedArray::kHeaderSize;
591 __ lw(scratch1, FieldMemOperand(scratch1, offset)); 605 __ lw(scratch1, FieldMemOperand(scratch1, offset));
(...skipping 917 matching lines...) Expand 10 before | Expand all | Expand 10 after
1509 // ----------------------------------- 1523 // -----------------------------------
1510 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); 1524 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss);
1511 } 1525 }
1512 1526
1513 1527
1514 #undef __ 1528 #undef __
1515 1529
1516 } } // namespace v8::internal 1530 } } // namespace v8::internal
1517 1531
1518 #endif // V8_TARGET_ARCH_MIPS 1532 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/mips/lithium-codegen-mips.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698