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/crankshaft/hydrogen.h" | 10 #include "src/crankshaft/hydrogen.h" |
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
535 checker.End(); | 535 checker.End(); |
536 | 536 |
537 return environment()->Pop(); | 537 return environment()->Pop(); |
538 } | 538 } |
539 | 539 |
540 | 540 |
541 Handle<Code> FastCloneShallowArrayStub::GenerateCode() { | 541 Handle<Code> FastCloneShallowArrayStub::GenerateCode() { |
542 return DoGenerateCode(this); | 542 return DoGenerateCode(this); |
543 } | 543 } |
544 | 544 |
545 | |
546 template <> | |
547 HValue* CodeStubGraphBuilder<CreateWeakCellStub>::BuildCodeStub() { | |
548 // This stub is performance sensitive, the generated code must be tuned | |
549 // so that it doesn't build an eager frame. | |
550 info()->MarkMustNotHaveEagerFrame(); | |
551 | |
552 HValue* size = Add<HConstant>(WeakCell::kSize); | |
553 HInstruction* object = | |
554 Add<HAllocate>(size, HType::JSObject(), TENURED, JS_OBJECT_TYPE, | |
555 graph()->GetConstant0()); | |
556 | |
557 Handle<Map> weak_cell_map = isolate()->factory()->weak_cell_map(); | |
558 AddStoreMapConstant(object, weak_cell_map); | |
559 | |
560 HInstruction* value = GetParameter(Descriptor::kValue); | |
561 Add<HStoreNamedField>(object, HObjectAccess::ForWeakCellValue(), value); | |
562 Add<HStoreNamedField>(object, HObjectAccess::ForWeakCellNext(), | |
563 graph()->GetConstantHole()); | |
564 | |
565 HInstruction* feedback_vector = GetParameter(Descriptor::kVector); | |
566 HInstruction* slot = GetParameter(Descriptor::kSlot); | |
567 Add<HStoreKeyed>(feedback_vector, slot, object, nullptr, FAST_ELEMENTS, | |
568 INITIALIZING_STORE); | |
569 return graph()->GetConstant0(); | |
570 } | |
571 | |
572 | |
573 Handle<Code> CreateWeakCellStub::GenerateCode() { return DoGenerateCode(this); } | |
574 | |
575 | |
576 template <> | 545 template <> |
577 HValue* CodeStubGraphBuilder<LoadScriptContextFieldStub>::BuildCodeStub() { | 546 HValue* CodeStubGraphBuilder<LoadScriptContextFieldStub>::BuildCodeStub() { |
578 int context_index = casted_stub()->context_index(); | 547 int context_index = casted_stub()->context_index(); |
579 int slot_index = casted_stub()->slot_index(); | 548 int slot_index = casted_stub()->slot_index(); |
580 | 549 |
581 HValue* script_context = BuildGetScriptContext(context_index); | 550 HValue* script_context = BuildGetScriptContext(context_index); |
582 return Add<HLoadNamedField>(script_context, nullptr, | 551 return Add<HLoadNamedField>(script_context, nullptr, |
583 HObjectAccess::ForContextSlot(slot_index)); | 552 HObjectAccess::ForContextSlot(slot_index)); |
584 } | 553 } |
585 | 554 |
(...skipping 1548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2134 return Pop(); | 2103 return Pop(); |
2135 } | 2104 } |
2136 | 2105 |
2137 | 2106 |
2138 Handle<Code> KeyedLoadGenericStub::GenerateCode() { | 2107 Handle<Code> KeyedLoadGenericStub::GenerateCode() { |
2139 return DoGenerateCode(this); | 2108 return DoGenerateCode(this); |
2140 } | 2109 } |
2141 | 2110 |
2142 } // namespace internal | 2111 } // namespace internal |
2143 } // namespace v8 | 2112 } // namespace v8 |
OLD | NEW |