| 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/ic-inl.h" | 9 #include "src/ic/ic-inl.h" |
| 10 #include "src/ic/ic.h" | 10 #include "src/ic/ic.h" |
| (...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 468 // Stub is never generated for objects that require access checks. | 468 // Stub is never generated for objects that require access checks. |
| 469 DCHECK(!transition->is_access_check_needed()); | 469 DCHECK(!transition->is_access_check_needed()); |
| 470 | 470 |
| 471 // Call to respective StoreTransitionStub. | 471 // Call to respective StoreTransitionStub. |
| 472 bool virtual_args = StoreTransitionHelper::HasVirtualSlotArg(); | 472 bool virtual_args = StoreTransitionHelper::HasVirtualSlotArg(); |
| 473 Register map_reg = StoreTransitionHelper::MapRegister(); | 473 Register map_reg = StoreTransitionHelper::MapRegister(); |
| 474 | 474 |
| 475 if (details.type() == DATA_CONSTANT) { | 475 if (details.type() == DATA_CONSTANT) { |
| 476 DCHECK(descriptors->GetValue(descriptor)->IsJSFunction()); | 476 DCHECK(descriptors->GetValue(descriptor)->IsJSFunction()); |
| 477 Register tmp = | 477 Register tmp = |
| 478 virtual_args ? VectorStoreICDescriptor::VectorRegister() : map_reg; | 478 virtual_args ? StoreWithVectorDescriptor::VectorRegister() : map_reg; |
| 479 GenerateRestoreMap(transition, tmp, scratch2(), &miss); | 479 GenerateRestoreMap(transition, tmp, scratch2(), &miss); |
| 480 GenerateConstantCheck(tmp, descriptor, value(), scratch2(), &miss); | 480 GenerateConstantCheck(tmp, descriptor, value(), scratch2(), &miss); |
| 481 if (virtual_args) { | 481 if (virtual_args) { |
| 482 // This will move the map from tmp into map_reg. | 482 // This will move the map from tmp into map_reg. |
| 483 RearrangeVectorAndSlot(tmp, map_reg); | 483 RearrangeVectorAndSlot(tmp, map_reg); |
| 484 } else { | 484 } else { |
| 485 PopVectorAndSlot(); | 485 PopVectorAndSlot(); |
| 486 } | 486 } |
| 487 GenerateRestoreName(name); | 487 GenerateRestoreName(name); |
| 488 StoreTransitionStub stub(isolate()); | 488 StoreTransitionStub stub(isolate()); |
| 489 GenerateTailCall(masm(), stub.GetCode()); | 489 GenerateTailCall(masm(), stub.GetCode()); |
| 490 | 490 |
| 491 } else { | 491 } else { |
| 492 if (representation.IsHeapObject()) { | 492 if (representation.IsHeapObject()) { |
| 493 GenerateFieldTypeChecks(descriptors->GetFieldType(descriptor), value(), | 493 GenerateFieldTypeChecks(descriptors->GetFieldType(descriptor), value(), |
| 494 &miss); | 494 &miss); |
| 495 } | 495 } |
| 496 StoreTransitionStub::StoreMode store_mode = | 496 StoreTransitionStub::StoreMode store_mode = |
| 497 Map::cast(transition->GetBackPointer())->unused_property_fields() == 0 | 497 Map::cast(transition->GetBackPointer())->unused_property_fields() == 0 |
| 498 ? StoreTransitionStub::ExtendStorageAndStoreMapAndValue | 498 ? StoreTransitionStub::ExtendStorageAndStoreMapAndValue |
| 499 : StoreTransitionStub::StoreMapAndValue; | 499 : StoreTransitionStub::StoreMapAndValue; |
| 500 | 500 |
| 501 Register tmp = | 501 Register tmp = |
| 502 virtual_args ? VectorStoreICDescriptor::VectorRegister() : map_reg; | 502 virtual_args ? StoreWithVectorDescriptor::VectorRegister() : map_reg; |
| 503 GenerateRestoreMap(transition, tmp, scratch2(), &miss); | 503 GenerateRestoreMap(transition, tmp, scratch2(), &miss); |
| 504 if (virtual_args) { | 504 if (virtual_args) { |
| 505 RearrangeVectorAndSlot(tmp, map_reg); | 505 RearrangeVectorAndSlot(tmp, map_reg); |
| 506 } else { | 506 } else { |
| 507 PopVectorAndSlot(); | 507 PopVectorAndSlot(); |
| 508 } | 508 } |
| 509 GenerateRestoreName(name); | 509 GenerateRestoreName(name); |
| 510 StoreTransitionStub stub(isolate(), | 510 StoreTransitionStub stub(isolate(), |
| 511 FieldIndex::ForDescriptor(*transition, descriptor), | 511 FieldIndex::ForDescriptor(*transition, descriptor), |
| 512 representation, store_mode); | 512 representation, store_mode); |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 611 DCHECK(elements_kind == DICTIONARY_ELEMENTS); | 611 DCHECK(elements_kind == DICTIONARY_ELEMENTS); |
| 612 cached_stub = LoadDictionaryElementStub(isolate()).GetCode(); | 612 cached_stub = LoadDictionaryElementStub(isolate()).GetCode(); |
| 613 } | 613 } |
| 614 } | 614 } |
| 615 | 615 |
| 616 handlers->Add(cached_stub); | 616 handlers->Add(cached_stub); |
| 617 } | 617 } |
| 618 } | 618 } |
| 619 } // namespace internal | 619 } // namespace internal |
| 620 } // namespace v8 | 620 } // namespace v8 |
| OLD | NEW |