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

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

Issue 1617503003: [Atomics] code stubs for atomic operations (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: remove Context() Created 4 years, 10 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/code-stub-assembler.cc
diff --git a/src/compiler/code-stub-assembler.cc b/src/compiler/code-stub-assembler.cc
index f4ecab605bc2977eda7de9d79d3fd1291cc9db29..8d33576ed1671df9c369d86580b0218e3a7f9060 100644
--- a/src/compiler/code-stub-assembler.cc
+++ b/src/compiler/code-stub-assembler.cc
@@ -39,6 +39,19 @@ CodeStubAssembler::CodeStubAssembler(Isolate* isolate, Zone* zone,
code_generated_(false),
variables_(zone) {}
+
+CodeStubAssembler::CodeStubAssembler(Isolate* isolate, Zone* zone,
+ int parameter_count, Code::Flags flags,
+ const char* name)
+ : raw_assembler_(new RawMachineAssembler(
+ isolate, new (zone) Graph(zone),
+ Linkage::GetJSCallDescriptor(zone, false, parameter_count,
+ CallDescriptor::kNoFlags))),
+ flags_(flags),
+ name_(name),
+ code_generated_(false),
+ variables_(zone) {}
+
CodeStubAssembler::~CodeStubAssembler() {}
void CodeStubAssembler::CallPrologue() {}
@@ -128,14 +141,17 @@ Node* CodeStubAssembler::SmiUntag(Node* value) {
CODE_STUB_ASSEMBLER_BINARY_OP_LIST(DEFINE_CODE_STUB_ASSEMBER_BINARY_OP)
#undef DEFINE_CODE_STUB_ASSEMBER_BINARY_OP
-Node* CodeStubAssembler::ChangeInt32ToInt64(Node* value) {
- return raw_assembler_->ChangeInt32ToInt64(value);
-}
-
Node* CodeStubAssembler::WordShl(Node* value, int shift) {
return raw_assembler_->WordShl(value, Int32Constant(shift));
}
+
+#define DEFINE_CODE_STUB_ASSEMBER_UNARY_OP(name) \
+ Node* CodeStubAssembler::name(Node* a) { return raw_assembler_->name(a); }
+CODE_STUB_ASSEMBLER_UNARY_OP_LIST(DEFINE_CODE_STUB_ASSEMBER_UNARY_OP)
+#undef DEFINE_CODE_STUB_ASSEMBER_UNARY_OP
+
+
Node* CodeStubAssembler::WordIsSmi(Node* a) {
return WordEqual(raw_assembler_->WordAnd(a, Int32Constant(kSmiTagMask)),
Int32Constant(0));
@@ -151,6 +167,11 @@ Node* CodeStubAssembler::LoadObjectField(Node* object, int offset) {
IntPtrConstant(offset - kHeapObjectTag));
}
+Node* CodeStubAssembler::LoadHeapNumber(Node* object) {
+ return raw_assembler_->Load(MachineType::Float64(), object,
+ IntPtrConstant(HeapNumber::kValueOffset));
+}
+
Node* CodeStubAssembler::LoadFixedArrayElementSmiIndex(Node* object,
Node* smi_index,
int additional_offset) {
@@ -226,6 +247,20 @@ Node* CodeStubAssembler::Projection(int index, Node* value) {
return raw_assembler_->Projection(index, value);
}
+Node* CodeStubAssembler::InstanceType(Node* object) {
+ return raw_assembler_->WordAnd(
+ LoadObjectField(LoadObjectField(object, HeapObject::kMapOffset),
+ Map::kInstanceTypeOffset),
+ raw_assembler_->Int32Constant(255));
+}
+
+Node* CodeStubAssembler::BitFieldValue(Node* word32, uint32_t shift,
+ uint32_t mask) {
+ return raw_assembler_->Word32Shr(
+ raw_assembler_->Word32And(word32, raw_assembler_->Int32Constant(mask)),
+ raw_assembler_->Int32Constant(shift));
+}
+
Node* CodeStubAssembler::CallN(CallDescriptor* descriptor, Node* code_target,
Node** args) {
CallPrologue();
@@ -286,6 +321,11 @@ Node* CodeStubAssembler::CallRuntime(Runtime::FunctionId function_id,
}
Node* CodeStubAssembler::TailCallRuntime(Runtime::FunctionId function_id,
+ Node* context) {
+ return raw_assembler_->TailCallRuntime0(function_id, context);
+}
+
+Node* CodeStubAssembler::TailCallRuntime(Runtime::FunctionId function_id,
Node* context, Node* arg1) {
return raw_assembler_->TailCallRuntime1(function_id, arg1, context);
}

Powered by Google App Engine
This is Rietveld 408576698