Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1508)

Side by Side Diff: src/code-stubs-hydrogen.cc

Issue 2325013004: [stubs] Port LoadScriptContextFieldStub and StoreScriptContextFieldStub to TurboFan. (Closed)
Patch Set: Rebasing Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/code-stubs.cc ('k') | src/crankshaft/hydrogen.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 checker.End(); 411 checker.End();
412 412
413 return environment()->Pop(); 413 return environment()->Pop();
414 } 414 }
415 415
416 416
417 Handle<Code> FastCloneShallowArrayStub::GenerateCode() { 417 Handle<Code> FastCloneShallowArrayStub::GenerateCode() {
418 return DoGenerateCode(this); 418 return DoGenerateCode(this);
419 } 419 }
420 420
421 template <>
422 HValue* CodeStubGraphBuilder<LoadScriptContextFieldStub>::BuildCodeStub() {
423 int context_index = casted_stub()->context_index();
424 int slot_index = casted_stub()->slot_index();
425
426 HValue* script_context = BuildGetScriptContext(context_index);
427 return Add<HLoadNamedField>(script_context, nullptr,
428 HObjectAccess::ForContextSlot(slot_index));
429 }
430
431
432 Handle<Code> LoadScriptContextFieldStub::GenerateCode() {
433 return DoGenerateCode(this);
434 }
435
436
437 template <>
438 HValue* CodeStubGraphBuilder<StoreScriptContextFieldStub>::BuildCodeStub() {
439 int context_index = casted_stub()->context_index();
440 int slot_index = casted_stub()->slot_index();
441
442 HValue* script_context = BuildGetScriptContext(context_index);
443 Add<HStoreNamedField>(script_context,
444 HObjectAccess::ForContextSlot(slot_index),
445 GetParameter(2), STORE_TO_INITIALIZED_ENTRY);
446 // TODO(ishell): Remove this unused stub.
447 return GetParameter(2);
448 }
449
450
451 Handle<Code> StoreScriptContextFieldStub::GenerateCode() {
452 return DoGenerateCode(this);
453 }
454
455 HValue* CodeStubGraphBuilderBase::BuildPushElement(HValue* object, HValue* argc, 421 HValue* CodeStubGraphBuilderBase::BuildPushElement(HValue* object, HValue* argc,
456 HValue* argument_elements, 422 HValue* argument_elements,
457 ElementsKind kind) { 423 ElementsKind kind) {
458 // Precheck whether all elements fit into the array. 424 // Precheck whether all elements fit into the array.
459 if (!IsFastObjectElementsKind(kind)) { 425 if (!IsFastObjectElementsKind(kind)) {
460 LoopBuilder builder(this, context(), LoopBuilder::kPostIncrement); 426 LoopBuilder builder(this, context(), LoopBuilder::kPostIncrement);
461 HValue* start = graph()->GetConstant0(); 427 HValue* start = graph()->GetConstant0();
462 HValue* key = builder.BeginBody(start, argc, Token::LT); 428 HValue* key = builder.BeginBody(start, argc, Token::LT);
463 { 429 {
464 HInstruction* argument = 430 HInstruction* argument =
(...skipping 1221 matching lines...) Expand 10 before | Expand all | Expand 10 after
1686 return Pop(); 1652 return Pop();
1687 } 1653 }
1688 1654
1689 1655
1690 Handle<Code> KeyedLoadGenericStub::GenerateCode() { 1656 Handle<Code> KeyedLoadGenericStub::GenerateCode() {
1691 return DoGenerateCode(this); 1657 return DoGenerateCode(this);
1692 } 1658 }
1693 1659
1694 } // namespace internal 1660 } // namespace internal
1695 } // namespace v8 1661 } // namespace v8
OLDNEW
« no previous file with comments | « src/code-stubs.cc ('k') | src/crankshaft/hydrogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698