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

Unified Diff: src/code-stubs.cc

Issue 1735803003: [turbofan] Adds an Allocate macro to the CodeStubAssembler. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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/code-stubs.cc
diff --git a/src/code-stubs.cc b/src/code-stubs.cc
index b56beb8d524bf449d67bc9bf34705e586f97727a..08ca32ed0d5fe76c65afe71f4b9e3b66a821c14c 100644
--- a/src/code-stubs.cc
+++ b/src/code-stubs.cc
@@ -472,6 +472,32 @@ void StringLengthStub::GenerateAssembly(
assembler->Return(result);
}
+void AllocateHeapNumberStub::GenerateAssembly(
+ compiler::CodeStubAssembler* assembler) const {
+ compiler::Node* result = assembler->Allocate(
+ HeapNumber::kSize, compiler::AllocationFlags::kTagObject);
+
+ assembler->StoreNoWriteBarrier(
+ MachineRepresentation::kTagged,
+ assembler->IntPtrAdd(
Benedikt Meurer 2016/02/25 13:00:40 Please don't nest these computations, add separate
epertoso 2016/02/25 13:26:53 Done.
+ result,
+ assembler->IntPtrConstant(HeapObject::kMapOffset - kHeapObjectTag)),
+ assembler->HeapConstant(isolate()->factory()->heap_number_map()));
+ assembler->Return(result);
+}
+
+void AllocateMutableHeapNumberStub::GenerateAssembly(
+ compiler::CodeStubAssembler* assembler) const {
+ compiler::Node* result = assembler->Allocate(
+ HeapNumber::kSize, compiler::AllocationFlags::kTagObject);
+ assembler->StoreNoWriteBarrier(
Benedikt Meurer 2016/02/25 13:00:40 Same here.
epertoso 2016/02/25 13:26:53 Done.
+ MachineRepresentation::kTagged,
+ assembler->IntPtrAdd(
+ result,
+ assembler->IntPtrConstant(HeapObject::kMapOffset - kHeapObjectTag)),
+ assembler->HeapConstant(isolate()->factory()->mutable_heap_number_map()));
+ assembler->Return(result);
+}
template<class StateType>
void HydrogenCodeStub::TraceTransition(StateType from, StateType to) {
« no previous file with comments | « src/code-stubs.h ('k') | src/code-stubs-hydrogen.cc » ('j') | src/compiler/code-stub-assembler.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698