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

Unified Diff: src/compiler/code-assembler.cc

Issue 1980483003: [es6] Reintroduce the instanceof operator in the backends. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Igors comments. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/code-assembler.h ('k') | src/compiler/js-intrinsic-lowering.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/code-assembler.cc
diff --git a/src/compiler/code-assembler.cc b/src/compiler/code-assembler.cc
index d78677e0f55768ca52460cb37d39a8e41169993f..0a90b9e9251130c1b5fe1d872aa9d3d24f73ef8d 100644
--- a/src/compiler/code-assembler.cc
+++ b/src/compiler/code-assembler.cc
@@ -205,14 +205,10 @@ Node* CodeAssembler::LoadRoot(Heap::RootListIndex root_index) {
}
}
- compiler::Node* roots_array_start =
+ Node* roots_array_start =
ExternalConstant(ExternalReference::roots_array_start(isolate()));
- USE(roots_array_start);
-
- // TODO(danno): Implement the root-access case where the root is not constant
- // and must be loaded from the root array.
- UNIMPLEMENTED();
- return nullptr;
+ return Load(MachineType::AnyTagged(), roots_array_start,
+ IntPtrConstant(root_index * kPointerSize));
}
Node* CodeAssembler::Store(MachineRepresentation rep, Node* base, Node* value) {
@@ -239,6 +235,14 @@ Node* CodeAssembler::AtomicStore(MachineRepresentation rep, Node* base,
return raw_assembler_->AtomicStore(rep, base, index, value);
}
+Node* CodeAssembler::StoreRoot(Heap::RootListIndex root_index, Node* value) {
+ DCHECK(Heap::RootCanBeWrittenAfterInitialization(root_index));
+ Node* roots_array_start =
+ ExternalConstant(ExternalReference::roots_array_start(isolate()));
+ return StoreNoWriteBarrier(MachineRepresentation::kTagged, roots_array_start,
+ IntPtrConstant(root_index * kPointerSize), value);
+}
+
Node* CodeAssembler::Projection(int index, Node* value) {
return raw_assembler_->Projection(index, value);
}
« no previous file with comments | « src/compiler/code-assembler.h ('k') | src/compiler/js-intrinsic-lowering.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698