OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/ic/handler-compiler.h" | 5 #include "src/ic/handler-compiler.h" |
6 | 6 |
7 #include "src/field-type.h" | 7 #include "src/field-type.h" |
8 #include "src/ic/call-optimization.h" | 8 #include "src/ic/call-optimization.h" |
9 #include "src/ic/handler-configuration.h" | 9 #include "src/ic/handler-configuration.h" |
10 #include "src/ic/ic-inl.h" | 10 #include "src/ic/ic-inl.h" |
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
497 Register map_reg = StoreTransitionDescriptor::MapRegister(); | 497 Register map_reg = StoreTransitionDescriptor::MapRegister(); |
498 | 498 |
499 if (details.type() == DATA_CONSTANT) { | 499 if (details.type() == DATA_CONSTANT) { |
500 DCHECK(descriptors->GetValue(descriptor)->IsJSFunction()); | 500 DCHECK(descriptors->GetValue(descriptor)->IsJSFunction()); |
501 GenerateRestoreMap(transition, map_reg, scratch1(), &miss); | 501 GenerateRestoreMap(transition, map_reg, scratch1(), &miss); |
502 GenerateConstantCheck(map_reg, descriptor, value(), scratch1(), &miss); | 502 GenerateConstantCheck(map_reg, descriptor, value(), scratch1(), &miss); |
503 if (need_save_restore) { | 503 if (need_save_restore) { |
504 PopVectorAndSlot(); | 504 PopVectorAndSlot(); |
505 } | 505 } |
506 GenerateRestoreName(name); | 506 GenerateRestoreName(name); |
507 StoreTransitionStub stub(isolate()); | 507 StoreMapStub stub(isolate()); |
508 GenerateTailCall(masm(), stub.GetCode()); | 508 GenerateTailCall(masm(), stub.GetCode()); |
509 | 509 |
510 } else { | 510 } else { |
511 if (representation.IsHeapObject()) { | 511 if (representation.IsHeapObject()) { |
512 GenerateFieldTypeChecks(descriptors->GetFieldType(descriptor), value(), | 512 GenerateFieldTypeChecks(descriptors->GetFieldType(descriptor), value(), |
513 &miss); | 513 &miss); |
514 } | 514 } |
515 StoreTransitionStub::StoreMode store_mode = | 515 StoreTransitionStub::StoreMode store_mode = |
516 Map::cast(transition->GetBackPointer())->unused_property_fields() == 0 | 516 Map::cast(transition->GetBackPointer())->unused_property_fields() == 0 |
517 ? StoreTransitionStub::ExtendStorageAndStoreMapAndValue | 517 ? StoreTransitionStub::ExtendStorageAndStoreMapAndValue |
518 : StoreTransitionStub::StoreMapAndValue; | 518 : StoreTransitionStub::StoreMapAndValue; |
519 GenerateRestoreMap(transition, map_reg, scratch1(), &miss); | 519 GenerateRestoreMap(transition, map_reg, scratch1(), &miss); |
520 if (need_save_restore) { | 520 if (need_save_restore) { |
521 PopVectorAndSlot(); | 521 PopVectorAndSlot(); |
522 } | 522 } |
523 GenerateRestoreName(name); | 523 // We need to pass name on the stack. |
524 StoreTransitionStub stub(isolate(), | 524 PopReturnAddress(this->name()); |
525 FieldIndex::ForDescriptor(*transition, descriptor), | 525 __ Push(name); |
526 representation, store_mode); | 526 PushReturnAddress(this->name()); |
| 527 |
| 528 FieldIndex index = FieldIndex::ForDescriptor(*transition, descriptor); |
| 529 __ Move(StoreNamedTransitionDescriptor::FieldOffsetRegister(), |
| 530 Smi::FromInt(index.index() << kPointerSizeLog2)); |
| 531 |
| 532 StoreTransitionStub stub(isolate(), index.is_inobject(), representation, |
| 533 store_mode); |
527 GenerateTailCall(masm(), stub.GetCode()); | 534 GenerateTailCall(masm(), stub.GetCode()); |
528 } | 535 } |
529 | 536 |
530 __ bind(&miss); | 537 __ bind(&miss); |
531 if (need_save_restore) { | 538 if (need_save_restore) { |
532 PopVectorAndSlot(); | 539 PopVectorAndSlot(); |
533 } | 540 } |
534 GenerateRestoreName(name); | 541 GenerateRestoreName(name); |
535 TailCallBuiltin(masm(), MissBuiltin(kind())); | 542 TailCallBuiltin(masm(), MissBuiltin(kind())); |
536 | 543 |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
656 } | 663 } |
657 | 664 |
658 void ElementHandlerCompiler::CompileElementHandlers( | 665 void ElementHandlerCompiler::CompileElementHandlers( |
659 MapHandleList* receiver_maps, List<Handle<Object>>* handlers) { | 666 MapHandleList* receiver_maps, List<Handle<Object>>* handlers) { |
660 for (int i = 0; i < receiver_maps->length(); ++i) { | 667 for (int i = 0; i < receiver_maps->length(); ++i) { |
661 handlers->Add(GetKeyedLoadHandler(receiver_maps->at(i), isolate())); | 668 handlers->Add(GetKeyedLoadHandler(receiver_maps->at(i), isolate())); |
662 } | 669 } |
663 } | 670 } |
664 } // namespace internal | 671 } // namespace internal |
665 } // namespace v8 | 672 } // namespace v8 |
OLD | NEW |