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

Unified Diff: src/compiler/js-intrinsic-lowering.cc

Issue 1617503003: [Atomics] code stubs for atomic operations (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: call code stub from TF Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: src/compiler/js-intrinsic-lowering.cc
diff --git a/src/compiler/js-intrinsic-lowering.cc b/src/compiler/js-intrinsic-lowering.cc
index ca5cb932b4bd7606521b32ae63c7c8076779d74f..7b1059ffc612888d0386f9ea8f1dafefde739e0f 100644
--- a/src/compiler/js-intrinsic-lowering.cc
+++ b/src/compiler/js-intrinsic-lowering.cc
@@ -21,6 +21,19 @@ namespace v8 {
namespace internal {
namespace compiler {
+// TODO(binji): copied from js-generic-lowering.cc, combine?
+static CallDescriptor::Flags AdjustFrameStatesForCall(Node* node) {
Jarin 2016/01/28 08:11:12 I believe here you only need a simpler version bec
binji 2016/01/28 16:20:01 No, I think I was ending up with multiple frame st
Jarin 2016/02/01 07:42:43 What I am saying is that you should not adapt base
+ int count = OperatorProperties::GetFrameStateInputCount(node->op());
+ if (count > 1) {
+ int index = NodeProperties::FirstFrameStateIndex(node) + 1;
+ do {
+ node->RemoveInput(index);
+ } while (--count > 1);
+ }
+ return count > 0 ? CallDescriptor::kNeedsFrameState
+ : CallDescriptor::kNoFlags;
+}
+
JSIntrinsicLowering::JSIntrinsicLowering(Editor* editor, JSGraph* jsgraph,
DeoptimizationMode mode)
: AdvancedReducer(editor),
@@ -107,6 +120,8 @@ Reduction JSIntrinsicLowering::Reduce(Node* node) {
return ReduceTailCall(node);
case Runtime::kInlineGetSuperConstructor:
return ReduceGetSuperConstructor(node);
+ case Runtime::kInlineAtomicsLoad:
+ return ReduceAtomicsLoad(node);
default:
break;
}
@@ -471,12 +486,14 @@ Reduction JSIntrinsicLowering::ReduceFixedArraySet(Node* node) {
Reduction JSIntrinsicLowering::ReduceRegExpConstructResult(Node* node) {
// TODO(bmeurer): Introduce JSCreateRegExpResult?
- return Change(node, CodeFactory::RegExpConstructResult(isolate()), 0);
+ return Change(node, CodeFactory::RegExpConstructResult(isolate()), 0,
+ CallDescriptor::kNeedsFrameState);
}
Reduction JSIntrinsicLowering::ReduceRegExpExec(Node* node) {
- return Change(node, CodeFactory::RegExpExec(isolate()), 4);
+ return Change(node, CodeFactory::RegExpExec(isolate()), 4,
+ CallDescriptor::kNeedsFrameState);
}
@@ -501,7 +518,8 @@ Reduction JSIntrinsicLowering::ReduceRegExpSource(Node* node) {
Reduction JSIntrinsicLowering::ReduceSubString(Node* node) {
- return Change(node, CodeFactory::SubString(isolate()), 3);
+ return Change(node, CodeFactory::SubString(isolate()), 3,
+ CallDescriptor::kNeedsFrameState);
}
@@ -560,7 +578,8 @@ Reduction JSIntrinsicLowering::ReduceToLength(Node* node) {
ReplaceWithValue(node, value);
return Replace(value);
}
- return Change(node, CodeFactory::ToLength(isolate()), 0);
+ return Change(node, CodeFactory::ToLength(isolate()), 0,
+ CallDescriptor::kNeedsFrameState);
}
@@ -618,6 +637,10 @@ Reduction JSIntrinsicLowering::ReduceGetSuperConstructor(Node* node) {
active_function_map, effect, control);
}
+Reduction JSIntrinsicLowering::ReduceAtomicsLoad(Node* node) {
+ CallDescriptor::Flags flags = AdjustFrameStatesForCall(node);
+ return Change(node, CodeFactory::AtomicsLoad(isolate()), 0, flags);
+}
Reduction JSIntrinsicLowering::Change(Node* node, const Operator* op, Node* a,
Node* b) {
@@ -660,12 +683,12 @@ Reduction JSIntrinsicLowering::ChangeToUndefined(Node* node, Node* effect) {
return Changed(node);
}
-
Reduction JSIntrinsicLowering::Change(Node* node, Callable const& callable,
- int stack_parameter_count) {
+ int stack_parameter_count,
+ CallDescriptor::Flags flags) {
CallDescriptor const* const desc = Linkage::GetStubCallDescriptor(
isolate(), graph()->zone(), callable.descriptor(), stack_parameter_count,
- CallDescriptor::kNeedsFrameState, node->op()->properties());
+ flags, node->op()->properties());
node->InsertInput(graph()->zone(), 0,
jsgraph()->HeapConstant(callable.code()));
NodeProperties::ChangeOp(node, common()->Call(desc));

Powered by Google App Engine
This is Rietveld 408576698