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

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

Issue 1876793002: [stubs] Introduce ModulusStub. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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/compiler/code-stub-assembler.h ('k') | src/interpreter/interpreter.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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 66
67 #define REPLACE_BINARY_OP_IC_CALL(Op, token) \ 67 #define REPLACE_BINARY_OP_IC_CALL(Op, token) \
68 void JSGenericLowering::Lower##Op(Node* node) { \ 68 void JSGenericLowering::Lower##Op(Node* node) { \
69 CallDescriptor::Flags flags = AdjustFrameStatesForCall(node); \ 69 CallDescriptor::Flags flags = AdjustFrameStatesForCall(node); \
70 ReplaceWithStubCall(node, CodeFactory::BinaryOpIC(isolate(), token), \ 70 ReplaceWithStubCall(node, CodeFactory::BinaryOpIC(isolate(), token), \
71 CallDescriptor::kPatchableCallSiteWithNop | flags); \ 71 CallDescriptor::kPatchableCallSiteWithNop | flags); \
72 } 72 }
73 REPLACE_BINARY_OP_IC_CALL(JSShiftLeft, Token::SHL) 73 REPLACE_BINARY_OP_IC_CALL(JSShiftLeft, Token::SHL)
74 REPLACE_BINARY_OP_IC_CALL(JSShiftRight, Token::SAR) 74 REPLACE_BINARY_OP_IC_CALL(JSShiftRight, Token::SAR)
75 REPLACE_BINARY_OP_IC_CALL(JSShiftRightLogical, Token::SHR) 75 REPLACE_BINARY_OP_IC_CALL(JSShiftRightLogical, Token::SHR)
76 REPLACE_BINARY_OP_IC_CALL(JSModulus, Token::MOD)
77 #undef REPLACE_BINARY_OP_IC_CALL 76 #undef REPLACE_BINARY_OP_IC_CALL
78 77
79 #define REPLACE_RUNTIME_CALL(op, fun) \ 78 #define REPLACE_RUNTIME_CALL(op, fun) \
80 void JSGenericLowering::Lower##op(Node* node) { \ 79 void JSGenericLowering::Lower##op(Node* node) { \
81 ReplaceWithRuntimeCall(node, fun); \ 80 ReplaceWithRuntimeCall(node, fun); \
82 } 81 }
83 REPLACE_RUNTIME_CALL(JSCreateWithContext, Runtime::kPushWithContext) 82 REPLACE_RUNTIME_CALL(JSCreateWithContext, Runtime::kPushWithContext)
84 REPLACE_RUNTIME_CALL(JSCreateModuleContext, Runtime::kPushModuleContext) 83 REPLACE_RUNTIME_CALL(JSCreateModuleContext, Runtime::kPushModuleContext)
85 REPLACE_RUNTIME_CALL(JSConvertReceiver, Runtime::kConvertReceiver) 84 REPLACE_RUNTIME_CALL(JSConvertReceiver, Runtime::kConvertReceiver)
86 #undef REPLACE_RUNTIME_CALL 85 #undef REPLACE_RUNTIME_CALL
87 86
88 #define REPLACE_STUB_CALL(Name) \ 87 #define REPLACE_STUB_CALL(Name) \
89 void JSGenericLowering::LowerJS##Name(Node* node) { \ 88 void JSGenericLowering::LowerJS##Name(Node* node) { \
90 CallDescriptor::Flags flags = AdjustFrameStatesForCall(node); \ 89 CallDescriptor::Flags flags = AdjustFrameStatesForCall(node); \
91 Callable callable = CodeFactory::Name(isolate()); \ 90 Callable callable = CodeFactory::Name(isolate()); \
92 ReplaceWithStubCall(node, callable, flags); \ 91 ReplaceWithStubCall(node, callable, flags); \
93 } 92 }
94 REPLACE_STUB_CALL(Add) 93 REPLACE_STUB_CALL(Add)
95 REPLACE_STUB_CALL(Subtract) 94 REPLACE_STUB_CALL(Subtract)
96 REPLACE_STUB_CALL(Multiply) 95 REPLACE_STUB_CALL(Multiply)
97 REPLACE_STUB_CALL(Divide) 96 REPLACE_STUB_CALL(Divide)
97 REPLACE_STUB_CALL(Modulus)
98 REPLACE_STUB_CALL(BitwiseAnd) 98 REPLACE_STUB_CALL(BitwiseAnd)
99 REPLACE_STUB_CALL(BitwiseOr) 99 REPLACE_STUB_CALL(BitwiseOr)
100 REPLACE_STUB_CALL(BitwiseXor) 100 REPLACE_STUB_CALL(BitwiseXor)
101 REPLACE_STUB_CALL(LessThan) 101 REPLACE_STUB_CALL(LessThan)
102 REPLACE_STUB_CALL(LessThanOrEqual) 102 REPLACE_STUB_CALL(LessThanOrEqual)
103 REPLACE_STUB_CALL(GreaterThan) 103 REPLACE_STUB_CALL(GreaterThan)
104 REPLACE_STUB_CALL(GreaterThanOrEqual) 104 REPLACE_STUB_CALL(GreaterThanOrEqual)
105 REPLACE_STUB_CALL(Equal) 105 REPLACE_STUB_CALL(Equal)
106 REPLACE_STUB_CALL(NotEqual) 106 REPLACE_STUB_CALL(NotEqual)
107 REPLACE_STUB_CALL(StrictEqual) 107 REPLACE_STUB_CALL(StrictEqual)
(...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after
746 } 746 }
747 747
748 748
749 MachineOperatorBuilder* JSGenericLowering::machine() const { 749 MachineOperatorBuilder* JSGenericLowering::machine() const {
750 return jsgraph()->machine(); 750 return jsgraph()->machine();
751 } 751 }
752 752
753 } // namespace compiler 753 } // namespace compiler
754 } // namespace internal 754 } // namespace internal
755 } // namespace v8 755 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/code-stub-assembler.h ('k') | src/interpreter/interpreter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698