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

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

Issue 2325013003: [stubs] Port StoreFieldStub to TurboFan. (Closed)
Patch Set: 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.h ('k') | src/code-stubs-hydrogen.cc » ('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 <sstream> 7 #include <sstream>
8 8
9 #include "src/ast/ast.h" 9 #include "src/ast/ast.h"
10 #include "src/bootstrapper.h" 10 #include "src/bootstrapper.h"
(...skipping 4416 matching lines...) Expand 10 before | Expand all | Expand 10 after
4427 Node* map = assembler->LoadMap(receiver); 4427 Node* map = assembler->LoadMap(receiver);
4428 Node* descriptors = assembler->LoadMapDescriptors(map); 4428 Node* descriptors = assembler->LoadMapDescriptors(map);
4429 Node* value_index = 4429 Node* value_index =
4430 assembler->IntPtrConstant(DescriptorArray::ToValueIndex(index())); 4430 assembler->IntPtrConstant(DescriptorArray::ToValueIndex(index()));
4431 Node* callback = assembler->LoadFixedArrayElement( 4431 Node* callback = assembler->LoadFixedArrayElement(
4432 descriptors, value_index, 0, CodeStubAssembler::INTPTR_PARAMETERS); 4432 descriptors, value_index, 0, CodeStubAssembler::INTPTR_PARAMETERS);
4433 assembler->TailCallStub(CodeFactory::ApiGetter(isolate()), context, receiver, 4433 assembler->TailCallStub(CodeFactory::ApiGetter(isolate()), context, receiver,
4434 holder, callback); 4434 holder, callback);
4435 } 4435 }
4436 4436
4437 void StoreFieldStub::GenerateAssembly(CodeStubAssembler* assembler) const {
4438 typedef CodeStubAssembler::Label Label;
4439 typedef compiler::Node Node;
4440
4441 FieldIndex index = this->index();
4442 Representation representation = this->representation();
4443
4444 assembler->Comment("StoreFieldStub: inobject=%d, offset=%d, rep=%s",
4445 index.is_inobject(), index.offset(),
4446 representation.Mnemonic());
4447
4448 Node* receiver = assembler->Parameter(Descriptor::kReceiver);
4449 Node* name = assembler->Parameter(Descriptor::kName);
4450 Node* value = assembler->Parameter(Descriptor::kValue);
4451 Node* slot = assembler->Parameter(Descriptor::kSlot);
4452 Node* vector = assembler->Parameter(Descriptor::kVector);
4453 Node* context = assembler->Parameter(Descriptor::kContext);
4454
4455 Label miss(assembler);
4456
4457 Node* prepared_value =
4458 assembler->PrepareValueForWrite(value, representation, &miss);
4459 assembler->StoreNamedField(receiver, index, representation, prepared_value,
4460 false);
4461 assembler->Return(value);
4462
4463 // Only stores to tagged field can't bailout.
4464 if (!representation.IsTagged()) {
4465 assembler->Bind(&miss);
4466 {
4467 assembler->Comment("Miss");
4468 assembler->TailCallRuntime(Runtime::kStoreIC_Miss, context, receiver,
4469 name, value, slot, vector);
4470 }
4471 }
4472 }
4473
4437 // static 4474 // static
4438 compiler::Node* LessThanStub::Generate(CodeStubAssembler* assembler, 4475 compiler::Node* LessThanStub::Generate(CodeStubAssembler* assembler,
4439 compiler::Node* lhs, compiler::Node* rhs, 4476 compiler::Node* lhs, compiler::Node* rhs,
4440 compiler::Node* context) { 4477 compiler::Node* context) {
4441 return GenerateAbstractRelationalComparison(assembler, kLessThan, lhs, rhs, 4478 return GenerateAbstractRelationalComparison(assembler, kLessThan, lhs, rhs,
4442 context); 4479 context);
4443 } 4480 }
4444 4481
4445 // static 4482 // static
4446 compiler::Node* LessThanOrEqualStub::Generate(CodeStubAssembler* assembler, 4483 compiler::Node* LessThanOrEqualStub::Generate(CodeStubAssembler* assembler,
(...skipping 1402 matching lines...) Expand 10 before | Expand all | Expand 10 after
5849 5886
5850 if (type == MachineType::Pointer()) { 5887 if (type == MachineType::Pointer()) {
5851 return Representation::External(); 5888 return Representation::External();
5852 } 5889 }
5853 5890
5854 return Representation::Tagged(); 5891 return Representation::Tagged();
5855 } 5892 }
5856 5893
5857 } // namespace internal 5894 } // namespace internal
5858 } // namespace v8 5895 } // namespace v8
OLDNEW
« no previous file with comments | « src/code-stubs.h ('k') | src/code-stubs-hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698