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

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

Issue 735323002: Revert "Re-land r25392 Use a stub in crankshaft for grow store arrays." (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Ports. Created 6 years, 1 month 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/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/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 530 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 return GetParameter(2); 541 return GetParameter(2);
542 } 542 }
543 543
544 544
545 Handle<Code> StoreScriptContextFieldStub::GenerateCode() { 545 Handle<Code> StoreScriptContextFieldStub::GenerateCode() {
546 return DoGenerateCode(this); 546 return DoGenerateCode(this);
547 } 547 }
548 548
549 549
550 template <> 550 template <>
551 HValue* CodeStubGraphBuilder<GrowArrayElementsStub>::BuildCodeStub() {
552 HValue* object = GetParameter(GrowArrayElementsDescriptor::kObjectIndex);
553 HValue* key = GetParameter(GrowArrayElementsDescriptor::kKeyIndex);
554 HValue* current_capacity =
555 GetParameter(GrowArrayElementsDescriptor::kCapacityIndex);
556 ElementsKind kind = casted_stub()->elements_kind();
557
558 HValue* elements = AddLoadElements(object);
559 HValue* length =
560 casted_stub()->is_js_array()
561 ? Add<HLoadNamedField>(object, static_cast<HValue*>(NULL),
562 HObjectAccess::ForArrayLength(kind))
563 : current_capacity;
564
565 return BuildCheckAndGrowElementsCapacity(object, elements, kind, length,
566 current_capacity, key);
567 }
568
569
570 Handle<Code> GrowArrayElementsStub::GenerateCode() {
571 return DoGenerateCode(this);
572 }
573
574
575 template <>
576 HValue* CodeStubGraphBuilder<LoadFastElementStub>::BuildCodeStub() { 551 HValue* CodeStubGraphBuilder<LoadFastElementStub>::BuildCodeStub() {
577 HInstruction* load = BuildUncheckedMonomorphicElementAccess( 552 HInstruction* load = BuildUncheckedMonomorphicElementAccess(
578 GetParameter(LoadDescriptor::kReceiverIndex), 553 GetParameter(LoadDescriptor::kReceiverIndex),
579 GetParameter(LoadDescriptor::kNameIndex), NULL, 554 GetParameter(LoadDescriptor::kNameIndex), NULL,
580 casted_stub()->is_js_array(), casted_stub()->elements_kind(), LOAD, 555 casted_stub()->is_js_array(), casted_stub()->elements_kind(), LOAD,
581 NEVER_RETURN_HOLE, STANDARD_STORE); 556 NEVER_RETURN_HOLE, STANDARD_STORE);
582 return load; 557 return load;
583 } 558 }
584 559
585 560
(...skipping 1500 matching lines...) Expand 10 before | Expand all | Expand 10 after
2086 2061
2087 // Probe the stub cache. 2062 // Probe the stub cache.
2088 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( 2063 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags(
2089 Code::ComputeHandlerFlags(Code::LOAD_IC)); 2064 Code::ComputeHandlerFlags(Code::LOAD_IC));
2090 Add<HTailCallThroughMegamorphicCache>(receiver, name, flags); 2065 Add<HTailCallThroughMegamorphicCache>(receiver, name, flags);
2091 2066
2092 // We never continue. 2067 // We never continue.
2093 return graph()->GetConstant0(); 2068 return graph()->GetConstant0();
2094 } 2069 }
2095 } } // namespace v8::internal 2070 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/code-stubs.cc ('k') | src/hydrogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698