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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/bailout-reason.h" | 7 #include "src/bailout-reason.h" |
8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
9 #include "src/field-index.h" | 9 #include "src/field-index.h" |
10 #include "src/hydrogen.h" | 10 #include "src/hydrogen.h" |
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 } | 443 } |
444 | 444 |
445 | 445 |
446 Handle<Code> FastCloneShallowObjectStub::GenerateCode() { | 446 Handle<Code> FastCloneShallowObjectStub::GenerateCode() { |
447 return DoGenerateCode(this); | 447 return DoGenerateCode(this); |
448 } | 448 } |
449 | 449 |
450 | 450 |
451 template <> | 451 template <> |
452 HValue* CodeStubGraphBuilder<CreateAllocationSiteStub>::BuildCodeStub() { | 452 HValue* CodeStubGraphBuilder<CreateAllocationSiteStub>::BuildCodeStub() { |
| 453 // This stub is performance sensitive, the generated code must be tuned |
| 454 // so that it doesn't build an eager frame. |
| 455 info()->MarkMustNotHaveEagerFrame(); |
| 456 |
453 HValue* size = Add<HConstant>(AllocationSite::kSize); | 457 HValue* size = Add<HConstant>(AllocationSite::kSize); |
454 HInstruction* object = Add<HAllocate>(size, HType::JSObject(), TENURED, | 458 HInstruction* object = Add<HAllocate>(size, HType::JSObject(), TENURED, |
455 JS_OBJECT_TYPE); | 459 JS_OBJECT_TYPE); |
456 | 460 |
457 // Store the map | 461 // Store the map |
458 Handle<Map> allocation_site_map = isolate()->factory()->allocation_site_map(); | 462 Handle<Map> allocation_site_map = isolate()->factory()->allocation_site_map(); |
459 AddStoreMapConstant(object, allocation_site_map); | 463 AddStoreMapConstant(object, allocation_site_map); |
460 | 464 |
461 // Store the payload (smi elements kind) | 465 // Store the payload (smi elements kind) |
462 HValue* initial_elements_kind = Add<HConstant>(GetInitialFastElementsKind()); | 466 HValue* initial_elements_kind = Add<HConstant>(GetInitialFastElementsKind()); |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
516 return feedback_vector; | 520 return feedback_vector; |
517 } | 521 } |
518 | 522 |
519 | 523 |
520 Handle<Code> CreateAllocationSiteStub::GenerateCode() { | 524 Handle<Code> CreateAllocationSiteStub::GenerateCode() { |
521 return DoGenerateCode(this); | 525 return DoGenerateCode(this); |
522 } | 526 } |
523 | 527 |
524 | 528 |
525 template <> | 529 template <> |
| 530 HValue* CodeStubGraphBuilder<CreateWeakCellStub>::BuildCodeStub() { |
| 531 // This stub is performance sensitive, the generated code must be tuned |
| 532 // so that it doesn't build an eager frame. |
| 533 info()->MarkMustNotHaveEagerFrame(); |
| 534 |
| 535 HValue* size = Add<HConstant>(WeakCell::kSize); |
| 536 HInstruction* object = |
| 537 Add<HAllocate>(size, HType::JSObject(), TENURED, JS_OBJECT_TYPE); |
| 538 |
| 539 Handle<Map> weak_cell_map = isolate()->factory()->weak_cell_map(); |
| 540 AddStoreMapConstant(object, weak_cell_map); |
| 541 |
| 542 HInstruction* value = GetParameter(CreateWeakCellDescriptor::kValueIndex); |
| 543 Add<HStoreNamedField>(object, HObjectAccess::ForWeakCellValue(), value); |
| 544 Add<HStoreNamedField>(object, HObjectAccess::ForWeakCellNext(), |
| 545 graph()->GetConstantUndefined()); |
| 546 |
| 547 HInstruction* feedback_vector = |
| 548 GetParameter(CreateWeakCellDescriptor::kVectorIndex); |
| 549 HInstruction* slot = GetParameter(CreateWeakCellDescriptor::kSlotIndex); |
| 550 Add<HStoreKeyed>(feedback_vector, slot, object, FAST_ELEMENTS, |
| 551 INITIALIZING_STORE); |
| 552 return graph()->GetConstant0(); |
| 553 } |
| 554 |
| 555 |
| 556 Handle<Code> CreateWeakCellStub::GenerateCode() { return DoGenerateCode(this); } |
| 557 |
| 558 |
| 559 template <> |
526 HValue* CodeStubGraphBuilder<LoadScriptContextFieldStub>::BuildCodeStub() { | 560 HValue* CodeStubGraphBuilder<LoadScriptContextFieldStub>::BuildCodeStub() { |
527 int context_index = casted_stub()->context_index(); | 561 int context_index = casted_stub()->context_index(); |
528 int slot_index = casted_stub()->slot_index(); | 562 int slot_index = casted_stub()->slot_index(); |
529 | 563 |
530 HValue* script_context = BuildGetScriptContext(context_index); | 564 HValue* script_context = BuildGetScriptContext(context_index); |
531 return Add<HLoadNamedField>(script_context, nullptr, | 565 return Add<HLoadNamedField>(script_context, nullptr, |
532 HObjectAccess::ForContextSlot(slot_index)); | 566 HObjectAccess::ForContextSlot(slot_index)); |
533 } | 567 } |
534 | 568 |
535 | 569 |
(...skipping 1690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2226 // megamorphic case is handled as part of the default stub. | 2260 // megamorphic case is handled as part of the default stub. |
2227 DCHECK(!FLAG_vector_ics); | 2261 DCHECK(!FLAG_vector_ics); |
2228 | 2262 |
2229 // Probe the stub cache. | 2263 // Probe the stub cache. |
2230 Add<HTailCallThroughMegamorphicCache>(receiver, name); | 2264 Add<HTailCallThroughMegamorphicCache>(receiver, name); |
2231 | 2265 |
2232 // We never continue. | 2266 // We never continue. |
2233 return graph()->GetConstant0(); | 2267 return graph()->GetConstant0(); |
2234 } | 2268 } |
2235 } } // namespace v8::internal | 2269 } } // namespace v8::internal |
OLD | NEW |