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

Side by Side Diff: src/builtins/builtins-object.cc

Issue 2511223003: [turbofan] Properly optimize instanceof (even in the presence of @@hasInstance). (Closed)
Patch Set: Created 4 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
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 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/builtins/builtins.h" 5 #include "src/builtins/builtins.h"
6 #include "src/builtins/builtins-utils.h" 6 #include "src/builtins/builtins-utils.h"
7 7
8 #include "src/code-factory.h" 8 #include "src/code-factory.h"
9 #include "src/property-descriptor.h" 9 #include "src/property-descriptor.h"
10 10
(...skipping 1042 matching lines...) Expand 10 before | Expand all | Expand 10 after
1053 typedef CompareDescriptor Descriptor; 1053 typedef CompareDescriptor Descriptor;
1054 CodeStubAssembler assembler(state); 1054 CodeStubAssembler assembler(state);
1055 1055
1056 Node* object = assembler.Parameter(Descriptor::kLeft); 1056 Node* object = assembler.Parameter(Descriptor::kLeft);
1057 Node* callable = assembler.Parameter(Descriptor::kRight); 1057 Node* callable = assembler.Parameter(Descriptor::kRight);
1058 Node* context = assembler.Parameter(Descriptor::kContext); 1058 Node* context = assembler.Parameter(Descriptor::kContext);
1059 1059
1060 assembler.Return(assembler.InstanceOf(object, callable, context)); 1060 assembler.Return(assembler.InstanceOf(object, callable, context));
1061 } 1061 }
1062 1062
1063 // ES6 section 7.3.19 OrdinaryHasInstance ( C, O )
1064 void Builtins::Generate_OrdinaryHasInstance(
1065 compiler::CodeAssemblerState* state) {
1066 typedef compiler::Node Node;
1067 typedef CompareDescriptor Descriptor;
1068 CodeStubAssembler assembler(state);
1069
1070 Node* constructor = assembler.Parameter(Descriptor::kLeft);
1071 Node* object = assembler.Parameter(Descriptor::kRight);
1072 Node* context = assembler.Parameter(Descriptor::kContext);
1073
1074 assembler.Return(assembler.OrdinaryHasInstance(context, constructor, object));
1075 }
1076
1063 } // namespace internal 1077 } // namespace internal
1064 } // namespace v8 1078 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698