| 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/ic/call-optimization.h" | 7 #include "src/ic/call-optimization.h" |
| 8 #include "src/ic/ic.h" | 8 #include "src/ic/ic.h" |
| 9 #include "src/ic/ic-inl.h" | 9 #include "src/ic/ic-inl.h" |
| 10 #include "src/isolate-inl.h" | 10 #include "src/isolate-inl.h" |
| (...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 502 GenerateTailCall(masm(), stub.GetCode()); | 502 GenerateTailCall(masm(), stub.GetCode()); |
| 503 } | 503 } |
| 504 | 504 |
| 505 GenerateRestoreName(&miss, name); | 505 GenerateRestoreName(&miss, name); |
| 506 PopVectorAndSlot(); | 506 PopVectorAndSlot(); |
| 507 TailCallBuiltin(masm(), MissBuiltin(kind())); | 507 TailCallBuiltin(masm(), MissBuiltin(kind())); |
| 508 | 508 |
| 509 return GetCode(kind(), Code::FAST, name); | 509 return GetCode(kind(), Code::FAST, name); |
| 510 } | 510 } |
| 511 | 511 |
| 512 | |
| 513 bool NamedStoreHandlerCompiler::RequiresFieldTypeChecks( | 512 bool NamedStoreHandlerCompiler::RequiresFieldTypeChecks( |
| 514 HeapType* field_type) const { | 513 FieldType* field_type) const { |
| 515 return !field_type->Classes().Done(); | 514 return !field_type->Classes().Done(); |
| 516 } | 515 } |
| 517 | 516 |
| 518 | 517 |
| 519 Handle<Code> NamedStoreHandlerCompiler::CompileStoreField(LookupIterator* it) { | 518 Handle<Code> NamedStoreHandlerCompiler::CompileStoreField(LookupIterator* it) { |
| 520 Label miss; | 519 Label miss; |
| 521 DCHECK(it->representation().IsHeapObject()); | 520 DCHECK(it->representation().IsHeapObject()); |
| 522 | 521 |
| 523 HeapType* field_type = *it->GetFieldType(); | 522 FieldType* field_type = *it->GetFieldType(); |
| 524 bool need_save_restore = false; | 523 bool need_save_restore = false; |
| 525 if (RequiresFieldTypeChecks(field_type)) { | 524 if (RequiresFieldTypeChecks(field_type)) { |
| 526 need_save_restore = IC::ICUseVector(kind()); | 525 need_save_restore = IC::ICUseVector(kind()); |
| 527 if (need_save_restore) PushVectorAndSlot(); | 526 if (need_save_restore) PushVectorAndSlot(); |
| 528 GenerateFieldTypeChecks(field_type, value(), &miss); | 527 GenerateFieldTypeChecks(field_type, value(), &miss); |
| 529 if (need_save_restore) PopVectorAndSlot(); | 528 if (need_save_restore) PopVectorAndSlot(); |
| 530 } | 529 } |
| 531 | 530 |
| 532 StoreFieldStub stub(isolate(), it->GetFieldIndex(), it->representation()); | 531 StoreFieldStub stub(isolate(), it->GetFieldIndex(), it->representation()); |
| 533 GenerateTailCall(masm(), stub.GetCode()); | 532 GenerateTailCall(masm(), stub.GetCode()); |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 604 : kNoExtraICState); | 603 : kNoExtraICState); |
| 605 cached_stub = LoadDictionaryElementStub(isolate(), state).GetCode(); | 604 cached_stub = LoadDictionaryElementStub(isolate(), state).GetCode(); |
| 606 } | 605 } |
| 607 } | 606 } |
| 608 | 607 |
| 609 handlers->Add(cached_stub); | 608 handlers->Add(cached_stub); |
| 610 } | 609 } |
| 611 } | 610 } |
| 612 } // namespace internal | 611 } // namespace internal |
| 613 } // namespace v8 | 612 } // namespace v8 |
| OLD | NEW |