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

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

Issue 167303005: Track field types. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments 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/arm/lithium-codegen-arm.cc ('k') | src/arm64/lithium-codegen-arm64.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 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 ASSERT(!representation.IsNone()); 423 ASSERT(!representation.IsNone());
424 424
425 if (details.type() == CONSTANT) { 425 if (details.type() == CONSTANT) {
426 Handle<Object> constant(descriptors->GetValue(descriptor), masm->isolate()); 426 Handle<Object> constant(descriptors->GetValue(descriptor), masm->isolate());
427 __ Move(scratch1, constant); 427 __ Move(scratch1, constant);
428 __ cmp(value_reg, scratch1); 428 __ cmp(value_reg, scratch1);
429 __ b(ne, miss_label); 429 __ b(ne, miss_label);
430 } else if (representation.IsSmi()) { 430 } else if (representation.IsSmi()) {
431 __ JumpIfNotSmi(value_reg, miss_label); 431 __ JumpIfNotSmi(value_reg, miss_label);
432 } else if (representation.IsHeapObject()) { 432 } else if (representation.IsHeapObject()) {
433 __ JumpIfSmi(value_reg, miss_label); 433 HeapType* field_type = descriptors->GetFieldType(descriptor);
434 if (field_type->IsClass()) {
435 __ CheckMap(value_reg, scratch1, field_type->AsClass(),
436 miss_label, DO_SMI_CHECK);
437 } else {
438 ASSERT(HeapType::Any()->Is(field_type));
439 __ JumpIfSmi(value_reg, miss_label);
440 }
434 } else if (representation.IsDouble()) { 441 } else if (representation.IsDouble()) {
435 Label do_store, heap_number; 442 Label do_store, heap_number;
436 __ LoadRoot(scratch3, Heap::kHeapNumberMapRootIndex); 443 __ LoadRoot(scratch3, Heap::kHeapNumberMapRootIndex);
437 __ AllocateHeapNumber(storage_reg, scratch1, scratch2, scratch3, slow); 444 __ AllocateHeapNumber(storage_reg, scratch1, scratch2, scratch3, slow);
438 445
439 __ JumpIfNotSmi(value_reg, &heap_number); 446 __ JumpIfNotSmi(value_reg, &heap_number);
440 __ SmiUntag(scratch1, value_reg); 447 __ SmiUntag(scratch1, value_reg);
441 __ vmov(s0, scratch1); 448 __ vmov(s0, scratch1);
442 __ vcvt_f64_s32(d0, s0); 449 __ vcvt_f64_s32(d0, s0);
443 __ jmp(&do_store); 450 __ jmp(&do_store);
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
585 // Adjust for the number of properties stored in the object. Even in the 592 // Adjust for the number of properties stored in the object. Even in the
586 // face of a transition we can use the old map here because the size of the 593 // face of a transition we can use the old map here because the size of the
587 // object and the number of in-object properties is not going to change. 594 // object and the number of in-object properties is not going to change.
588 index -= object->map()->inobject_properties(); 595 index -= object->map()->inobject_properties();
589 596
590 Representation representation = lookup->representation(); 597 Representation representation = lookup->representation();
591 ASSERT(!representation.IsNone()); 598 ASSERT(!representation.IsNone());
592 if (representation.IsSmi()) { 599 if (representation.IsSmi()) {
593 __ JumpIfNotSmi(value_reg, miss_label); 600 __ JumpIfNotSmi(value_reg, miss_label);
594 } else if (representation.IsHeapObject()) { 601 } else if (representation.IsHeapObject()) {
595 __ JumpIfSmi(value_reg, miss_label); 602 HeapType* field_type = lookup->GetFieldType();
603 if (field_type->IsClass()) {
604 __ CheckMap(value_reg, scratch1, field_type->AsClass(),
605 miss_label, DO_SMI_CHECK);
606 } else {
607 ASSERT(HeapType::Any()->Is(field_type));
608 __ JumpIfSmi(value_reg, miss_label);
609 }
596 } else if (representation.IsDouble()) { 610 } else if (representation.IsDouble()) {
597 // Load the double storage. 611 // Load the double storage.
598 if (index < 0) { 612 if (index < 0) {
599 int offset = object->map()->instance_size() + (index * kPointerSize); 613 int offset = object->map()->instance_size() + (index * kPointerSize);
600 __ ldr(scratch1, FieldMemOperand(receiver_reg, offset)); 614 __ ldr(scratch1, FieldMemOperand(receiver_reg, offset));
601 } else { 615 } else {
602 __ ldr(scratch1, 616 __ ldr(scratch1,
603 FieldMemOperand(receiver_reg, JSObject::kPropertiesOffset)); 617 FieldMemOperand(receiver_reg, JSObject::kPropertiesOffset));
604 int offset = index * kPointerSize + FixedArray::kHeaderSize; 618 int offset = index * kPointerSize + FixedArray::kHeaderSize;
605 __ ldr(scratch1, FieldMemOperand(scratch1, offset)); 619 __ ldr(scratch1, FieldMemOperand(scratch1, offset));
(...skipping 916 matching lines...) Expand 10 before | Expand all | Expand 10 after
1522 // ----------------------------------- 1536 // -----------------------------------
1523 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); 1537 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss);
1524 } 1538 }
1525 1539
1526 1540
1527 #undef __ 1541 #undef __
1528 1542
1529 } } // namespace v8::internal 1543 } } // namespace v8::internal
1530 1544
1531 #endif // V8_TARGET_ARCH_ARM 1545 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/lithium-codegen-arm.cc ('k') | src/arm64/lithium-codegen-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698