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

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: Update. 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
« no previous file with comments | « src/code-stubs.h ('k') | src/code-stubs-hydrogen.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/code-stubs.cc
diff --git a/src/code-stubs.cc b/src/code-stubs.cc
index 2c4445f59ddf22316137d67c95693bdd3bb1e411..48282ade7763ae63949ab9fef29a39814db53d80 100644
--- a/src/code-stubs.cc
+++ b/src/code-stubs.cc
@@ -462,6 +462,31 @@ Handle<Code> TurboFanCodeStub::GenerateCode() {
return assembler.GenerateCode();
}
+void AllocateHeapNumberStub::GenerateAssembly(
+ compiler::CodeStubAssembler* assembler) const {
+ compiler::Node* result = assembler->Allocate(
+ HeapNumber::kSize, compiler::CodeStubAssembler::kNone);
+ compiler::Node* map_offset =
+ assembler->IntPtrConstant(HeapObject::kMapOffset - kHeapObjectTag);
+ compiler::Node* map = assembler->IntPtrAdd(result, map_offset);
+ assembler->StoreNoWriteBarrier(
+ MachineRepresentation::kTagged, map,
+ 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::CodeStubAssembler::kNone);
+ compiler::Node* map_offset =
+ assembler->IntPtrConstant(HeapObject::kMapOffset - kHeapObjectTag);
+ compiler::Node* map = assembler->IntPtrAdd(result, map_offset);
+ assembler->StoreNoWriteBarrier(
+ MachineRepresentation::kTagged, map,
+ assembler->HeapConstant(isolate()->factory()->mutable_heap_number_map()));
+ assembler->Return(result);
+}
void StringLengthStub::GenerateAssembly(
compiler::CodeStubAssembler* assembler) const {
« no previous file with comments | « src/code-stubs.h ('k') | src/code-stubs-hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698