| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/code-stubs.h" | 5 #include "src/code-stubs.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "src/bailout-reason.h" | 9 #include "src/bailout-reason.h" |
| 10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
| (...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 (!FLAG_unbox_double_fields || !index.is_inobject())) { | 389 (!FLAG_unbox_double_fields || !index.is_inobject())) { |
| 390 // Load the heap number. | 390 // Load the heap number. |
| 391 object = Add<HLoadNamedField>( | 391 object = Add<HLoadNamedField>( |
| 392 object, nullptr, access.WithRepresentation(Representation::Tagged())); | 392 object, nullptr, access.WithRepresentation(Representation::Tagged())); |
| 393 // Load the double value from it. | 393 // Load the double value from it. |
| 394 access = HObjectAccess::ForHeapNumberValue(); | 394 access = HObjectAccess::ForHeapNumberValue(); |
| 395 } | 395 } |
| 396 return Add<HLoadNamedField>(object, nullptr, access); | 396 return Add<HLoadNamedField>(object, nullptr, access); |
| 397 } | 397 } |
| 398 | 398 |
| 399 | |
| 400 template<> | |
| 401 HValue* CodeStubGraphBuilder<LoadFieldStub>::BuildCodeStub() { | |
| 402 return BuildLoadNamedField(GetParameter(Descriptor::kReceiver), | |
| 403 casted_stub()->index()); | |
| 404 } | |
| 405 | |
| 406 | |
| 407 Handle<Code> LoadFieldStub::GenerateCode() { | |
| 408 return DoGenerateCode(this); | |
| 409 } | |
| 410 | |
| 411 void CodeStubGraphBuilderBase::BuildStoreNamedField( | 399 void CodeStubGraphBuilderBase::BuildStoreNamedField( |
| 412 HValue* object, HValue* value, FieldIndex index, | 400 HValue* object, HValue* value, FieldIndex index, |
| 413 Representation representation, bool transition_to_field) { | 401 Representation representation, bool transition_to_field) { |
| 414 DCHECK(!index.is_double() || representation.IsDouble()); | 402 DCHECK(!index.is_double() || representation.IsDouble()); |
| 415 int offset = index.offset(); | 403 int offset = index.offset(); |
| 416 HObjectAccess access = | 404 HObjectAccess access = |
| 417 index.is_inobject() | 405 index.is_inobject() |
| 418 ? HObjectAccess::ForObservableJSObjectOffset(offset, representation) | 406 ? HObjectAccess::ForObservableJSObjectOffset(offset, representation) |
| 419 : HObjectAccess::ForBackingStoreOffset(offset, representation); | 407 : HObjectAccess::ForBackingStoreOffset(offset, representation); |
| 420 | 408 |
| (...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 759 if_true.Return(graph()->GetConstantTrue()); | 747 if_true.Return(graph()->GetConstantTrue()); |
| 760 if_true.Else(); | 748 if_true.Else(); |
| 761 if_true.End(); | 749 if_true.End(); |
| 762 return graph()->GetConstantFalse(); | 750 return graph()->GetConstantFalse(); |
| 763 } | 751 } |
| 764 | 752 |
| 765 Handle<Code> ToBooleanICStub::GenerateCode() { return DoGenerateCode(this); } | 753 Handle<Code> ToBooleanICStub::GenerateCode() { return DoGenerateCode(this); } |
| 766 | 754 |
| 767 } // namespace internal | 755 } // namespace internal |
| 768 } // namespace v8 | 756 } // namespace v8 |
| OLD | NEW |