| 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 "src/bailout-reason.h" | 7 #include "src/bailout-reason.h" |
| 8 #include "src/crankshaft/hydrogen.h" | 8 #include "src/crankshaft/hydrogen.h" |
| 9 #include "src/crankshaft/lithium.h" | 9 #include "src/crankshaft/lithium.h" |
| 10 #include "src/field-index.h" | 10 #include "src/field-index.h" |
| (...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 430 | 430 |
| 431 | 431 |
| 432 Handle<Code> TypeofStub::GenerateCode() { return DoGenerateCode(this); } | 432 Handle<Code> TypeofStub::GenerateCode() { return DoGenerateCode(this); } |
| 433 | 433 |
| 434 | 434 |
| 435 template <> | 435 template <> |
| 436 HValue* CodeStubGraphBuilder<FastCloneShallowArrayStub>::BuildCodeStub() { | 436 HValue* CodeStubGraphBuilder<FastCloneShallowArrayStub>::BuildCodeStub() { |
| 437 Factory* factory = isolate()->factory(); | 437 Factory* factory = isolate()->factory(); |
| 438 HValue* undefined = graph()->GetConstantUndefined(); | 438 HValue* undefined = graph()->GetConstantUndefined(); |
| 439 AllocationSiteMode alloc_site_mode = casted_stub()->allocation_site_mode(); | 439 AllocationSiteMode alloc_site_mode = casted_stub()->allocation_site_mode(); |
| 440 HValue* closure = GetParameter(0); |
| 441 HValue* literal_index = GetParameter(1); |
| 440 | 442 |
| 441 // This stub is very performance sensitive, the generated code must be tuned | 443 // This stub is very performance sensitive, the generated code must be tuned |
| 442 // so that it doesn't build and eager frame. | 444 // so that it doesn't build and eager frame. |
| 443 info()->MarkMustNotHaveEagerFrame(); | 445 info()->MarkMustNotHaveEagerFrame(); |
| 444 | 446 |
| 447 HValue* literals_array = Add<HLoadNamedField>( |
| 448 closure, nullptr, HObjectAccess::ForLiteralsPointer()); |
| 449 |
| 445 HInstruction* allocation_site = Add<HLoadKeyed>( | 450 HInstruction* allocation_site = Add<HLoadKeyed>( |
| 446 GetParameter(0), GetParameter(1), nullptr, FAST_ELEMENTS, | 451 literals_array, literal_index, nullptr, FAST_ELEMENTS, NEVER_RETURN_HOLE, |
| 447 NEVER_RETURN_HOLE, LiteralsArray::kOffsetToFirstLiteral - kHeapObjectTag); | 452 LiteralsArray::kOffsetToFirstLiteral - kHeapObjectTag); |
| 448 IfBuilder checker(this); | 453 IfBuilder checker(this); |
| 449 checker.IfNot<HCompareObjectEqAndBranch, HValue*>(allocation_site, | 454 checker.IfNot<HCompareObjectEqAndBranch, HValue*>(allocation_site, |
| 450 undefined); | 455 undefined); |
| 451 checker.Then(); | 456 checker.Then(); |
| 452 | 457 |
| 453 HObjectAccess access = HObjectAccess::ForAllocationSiteOffset( | 458 HObjectAccess access = HObjectAccess::ForAllocationSiteOffset( |
| 454 AllocationSite::kTransitionInfoOffset); | 459 AllocationSite::kTransitionInfoOffset); |
| 455 HInstruction* boilerplate = | 460 HInstruction* boilerplate = |
| 456 Add<HLoadNamedField>(allocation_site, nullptr, access); | 461 Add<HLoadNamedField>(allocation_site, nullptr, access); |
| 457 HValue* elements = AddLoadElements(boilerplate); | 462 HValue* elements = AddLoadElements(boilerplate); |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 497 | 502 |
| 498 | 503 |
| 499 Handle<Code> FastCloneShallowArrayStub::GenerateCode() { | 504 Handle<Code> FastCloneShallowArrayStub::GenerateCode() { |
| 500 return DoGenerateCode(this); | 505 return DoGenerateCode(this); |
| 501 } | 506 } |
| 502 | 507 |
| 503 | 508 |
| 504 template <> | 509 template <> |
| 505 HValue* CodeStubGraphBuilder<FastCloneShallowObjectStub>::BuildCodeStub() { | 510 HValue* CodeStubGraphBuilder<FastCloneShallowObjectStub>::BuildCodeStub() { |
| 506 HValue* undefined = graph()->GetConstantUndefined(); | 511 HValue* undefined = graph()->GetConstantUndefined(); |
| 512 HValue* closure = GetParameter(0); |
| 513 HValue* literal_index = GetParameter(1); |
| 514 |
| 515 HValue* literals_array = Add<HLoadNamedField>( |
| 516 closure, nullptr, HObjectAccess::ForLiteralsPointer()); |
| 507 | 517 |
| 508 HInstruction* allocation_site = Add<HLoadKeyed>( | 518 HInstruction* allocation_site = Add<HLoadKeyed>( |
| 509 GetParameter(0), GetParameter(1), nullptr, FAST_ELEMENTS, | 519 literals_array, literal_index, nullptr, FAST_ELEMENTS, NEVER_RETURN_HOLE, |
| 510 NEVER_RETURN_HOLE, LiteralsArray::kOffsetToFirstLiteral - kHeapObjectTag); | 520 LiteralsArray::kOffsetToFirstLiteral - kHeapObjectTag); |
| 511 | 521 |
| 512 IfBuilder checker(this); | 522 IfBuilder checker(this); |
| 513 checker.IfNot<HCompareObjectEqAndBranch, HValue*>(allocation_site, | 523 checker.IfNot<HCompareObjectEqAndBranch, HValue*>(allocation_site, |
| 514 undefined); | 524 undefined); |
| 515 checker.And(); | 525 checker.And(); |
| 516 | 526 |
| 517 HObjectAccess access = HObjectAccess::ForAllocationSiteOffset( | 527 HObjectAccess access = HObjectAccess::ForAllocationSiteOffset( |
| 518 AllocationSite::kTransitionInfoOffset); | 528 AllocationSite::kTransitionInfoOffset); |
| 519 HInstruction* boilerplate = | 529 HInstruction* boilerplate = |
| 520 Add<HLoadNamedField>(allocation_site, nullptr, access); | 530 Add<HLoadNamedField>(allocation_site, nullptr, access); |
| (...skipping 1858 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2379 return Pop(); | 2389 return Pop(); |
| 2380 } | 2390 } |
| 2381 | 2391 |
| 2382 | 2392 |
| 2383 Handle<Code> KeyedLoadGenericStub::GenerateCode() { | 2393 Handle<Code> KeyedLoadGenericStub::GenerateCode() { |
| 2384 return DoGenerateCode(this); | 2394 return DoGenerateCode(this); |
| 2385 } | 2395 } |
| 2386 | 2396 |
| 2387 } // namespace internal | 2397 } // namespace internal |
| 2388 } // namespace v8 | 2398 } // namespace v8 |
| OLD | NEW |