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

Side by Side Diff: src/compiler/js-generic-lowering.cc

Issue 1894953004: Add HasProperty code stub that tries simple lookups or jumps to runtime otherwise. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebasing Created 4 years, 7 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.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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-factory.h" 5 #include "src/code-factory.h"
6 #include "src/code-stubs.h" 6 #include "src/code-stubs.h"
7 #include "src/compiler/common-operator.h" 7 #include "src/compiler/common-operator.h"
8 #include "src/compiler/js-generic-lowering.h" 8 #include "src/compiler/js-generic-lowering.h"
9 #include "src/compiler/js-graph.h" 9 #include "src/compiler/js-graph.h"
10 #include "src/compiler/machine-operator.h" 10 #include "src/compiler/machine-operator.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 REPLACE_STUB_CALL(Multiply) 79 REPLACE_STUB_CALL(Multiply)
80 REPLACE_STUB_CALL(Divide) 80 REPLACE_STUB_CALL(Divide)
81 REPLACE_STUB_CALL(Modulus) 81 REPLACE_STUB_CALL(Modulus)
82 REPLACE_STUB_CALL(BitwiseAnd) 82 REPLACE_STUB_CALL(BitwiseAnd)
83 REPLACE_STUB_CALL(BitwiseOr) 83 REPLACE_STUB_CALL(BitwiseOr)
84 REPLACE_STUB_CALL(BitwiseXor) 84 REPLACE_STUB_CALL(BitwiseXor)
85 REPLACE_STUB_CALL(LessThan) 85 REPLACE_STUB_CALL(LessThan)
86 REPLACE_STUB_CALL(LessThanOrEqual) 86 REPLACE_STUB_CALL(LessThanOrEqual)
87 REPLACE_STUB_CALL(GreaterThan) 87 REPLACE_STUB_CALL(GreaterThan)
88 REPLACE_STUB_CALL(GreaterThanOrEqual) 88 REPLACE_STUB_CALL(GreaterThanOrEqual)
89 REPLACE_STUB_CALL(HasProperty)
89 REPLACE_STUB_CALL(Equal) 90 REPLACE_STUB_CALL(Equal)
90 REPLACE_STUB_CALL(NotEqual) 91 REPLACE_STUB_CALL(NotEqual)
91 REPLACE_STUB_CALL(ToInteger) 92 REPLACE_STUB_CALL(ToInteger)
92 REPLACE_STUB_CALL(ToLength) 93 REPLACE_STUB_CALL(ToLength)
93 REPLACE_STUB_CALL(ToNumber) 94 REPLACE_STUB_CALL(ToNumber)
94 REPLACE_STUB_CALL(ToName) 95 REPLACE_STUB_CALL(ToName)
95 REPLACE_STUB_CALL(ToObject) 96 REPLACE_STUB_CALL(ToObject)
96 REPLACE_STUB_CALL(ToString) 97 REPLACE_STUB_CALL(ToString)
97 #undef REPLACE_STUB_CALL 98 #undef REPLACE_STUB_CALL
98 99
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 345
345 346
346 void JSGenericLowering::LowerJSDeleteProperty(Node* node) { 347 void JSGenericLowering::LowerJSDeleteProperty(Node* node) {
347 LanguageMode language_mode = OpParameter<LanguageMode>(node); 348 LanguageMode language_mode = OpParameter<LanguageMode>(node);
348 ReplaceWithRuntimeCall(node, is_strict(language_mode) 349 ReplaceWithRuntimeCall(node, is_strict(language_mode)
349 ? Runtime::kDeleteProperty_Strict 350 ? Runtime::kDeleteProperty_Strict
350 : Runtime::kDeleteProperty_Sloppy); 351 : Runtime::kDeleteProperty_Sloppy);
351 } 352 }
352 353
353 354
354 void JSGenericLowering::LowerJSHasProperty(Node* node) {
355 ReplaceWithRuntimeCall(node, Runtime::kHasProperty);
356 }
357
358
359 void JSGenericLowering::LowerJSInstanceOf(Node* node) { 355 void JSGenericLowering::LowerJSInstanceOf(Node* node) {
360 CallDescriptor::Flags flags = AdjustFrameStatesForCall(node); 356 CallDescriptor::Flags flags = AdjustFrameStatesForCall(node);
361 Callable callable = CodeFactory::InstanceOf(isolate()); 357 Callable callable = CodeFactory::InstanceOf(isolate());
362 ReplaceWithStubCall(node, callable, flags); 358 ReplaceWithStubCall(node, callable, flags);
363 } 359 }
364 360
365 361
366 void JSGenericLowering::LowerJSLoadContext(Node* node) { 362 void JSGenericLowering::LowerJSLoadContext(Node* node) {
367 const ContextAccess& access = ContextAccessOf(node->op()); 363 const ContextAccess& access = ContextAccessOf(node->op());
368 for (size_t i = 0; i < access.depth(); ++i) { 364 for (size_t i = 0; i < access.depth(); ++i) {
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
753 } 749 }
754 750
755 751
756 MachineOperatorBuilder* JSGenericLowering::machine() const { 752 MachineOperatorBuilder* JSGenericLowering::machine() const {
757 return jsgraph()->machine(); 753 return jsgraph()->machine();
758 } 754 }
759 755
760 } // namespace compiler 756 } // namespace compiler
761 } // namespace internal 757 } // namespace internal
762 } // namespace v8 758 } // namespace v8
OLDNEW
« no previous file with comments | « src/code-stubs.cc ('k') | src/crankshaft/hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698