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

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

Issue 1895093002: Create per-descriptor-index LoadApiGetterStub (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 4 years, 8 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/compiler/code-assembler.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 <sstream> 7 #include <sstream>
8 8
9 #include "src/bootstrapper.h" 9 #include "src/bootstrapper.h"
10 #include "src/code-factory.h" 10 #include "src/code-factory.h"
(...skipping 3211 matching lines...) Expand 10 before | Expand all | Expand 10 after
3222 3222
3223 assembler->Bind(&if_equal); 3223 assembler->Bind(&if_equal);
3224 assembler->Return(assembler->BooleanConstant(mode == kDontNegateResult)); 3224 assembler->Return(assembler->BooleanConstant(mode == kDontNegateResult));
3225 3225
3226 assembler->Bind(&if_notequal); 3226 assembler->Bind(&if_notequal);
3227 assembler->Return(assembler->BooleanConstant(mode == kNegateResult)); 3227 assembler->Return(assembler->BooleanConstant(mode == kNegateResult));
3228 } 3228 }
3229 3229
3230 } // namespace 3230 } // namespace
3231 3231
3232 void LoadApiGetterStub::GenerateAssembly(CodeStubAssembler* assembler) const {
3233 typedef compiler::Node Node;
3234 Node* context = assembler->Parameter(3);
3235 Node* receiver = assembler->Parameter(0);
3236 // For now we only support receiver_is_holder.
3237 DCHECK(receiver_is_holder());
3238 Node* holder = receiver;
3239 Node* map = assembler->LoadMap(receiver);
3240 Node* descriptors = assembler->LoadMapDescriptors(map);
3241 Node* offset =
3242 assembler->Int32Constant(DescriptorArray::ToValueIndex(index()));
3243 Node* callback =
3244 assembler->LoadFixedArrayElementInt32Index(descriptors, offset);
3245 assembler->TailCallStub(CodeFactory::ApiGetter(isolate()), context, receiver,
3246 holder, callback);
3247 }
3248
3232 void LessThanStub::GenerateAssembly(CodeStubAssembler* assembler) const { 3249 void LessThanStub::GenerateAssembly(CodeStubAssembler* assembler) const {
3233 GenerateAbstractRelationalComparison(assembler, kLessThan); 3250 GenerateAbstractRelationalComparison(assembler, kLessThan);
3234 } 3251 }
3235 3252
3236 void LessThanOrEqualStub::GenerateAssembly(CodeStubAssembler* assembler) const { 3253 void LessThanOrEqualStub::GenerateAssembly(CodeStubAssembler* assembler) const {
3237 GenerateAbstractRelationalComparison(assembler, kLessThanOrEqual); 3254 GenerateAbstractRelationalComparison(assembler, kLessThanOrEqual);
3238 } 3255 }
3239 3256
3240 void GreaterThanStub::GenerateAssembly(CodeStubAssembler* assembler) const { 3257 void GreaterThanStub::GenerateAssembly(CodeStubAssembler* assembler) const {
3241 GenerateAbstractRelationalComparison(assembler, kGreaterThan); 3258 GenerateAbstractRelationalComparison(assembler, kGreaterThan);
(...skipping 854 matching lines...) Expand 10 before | Expand all | Expand 10 after
4096 if (type->Is(Type::UntaggedPointer())) { 4113 if (type->Is(Type::UntaggedPointer())) {
4097 return Representation::External(); 4114 return Representation::External();
4098 } 4115 }
4099 4116
4100 DCHECK(!type->Is(Type::Untagged())); 4117 DCHECK(!type->Is(Type::Untagged()));
4101 return Representation::Tagged(); 4118 return Representation::Tagged();
4102 } 4119 }
4103 4120
4104 } // namespace internal 4121 } // namespace internal
4105 } // namespace v8 4122 } // namespace v8
OLDNEW
« no previous file with comments | « src/code-stubs.h ('k') | src/compiler/code-assembler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698