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

Unified Diff: regexp2000/src/heap.cc

Issue 10942: Start IA32 implemenetation of regexp2k (Closed)
Patch Set: Addressed review comments Created 12 years, 1 month 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 | « regexp2000/src/heap.h ('k') | regexp2000/src/jsregexp.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: regexp2000/src/heap.cc
diff --git a/regexp2000/src/heap.cc b/regexp2000/src/heap.cc
index e62234f08d7478c5fc8d23b80712008b4003d5c6..2b5517418e0b4099e4ea2ec23354dbd733a6b761 100644
--- a/regexp2000/src/heap.cc
+++ b/regexp2000/src/heap.cc
@@ -1557,6 +1557,24 @@ Object* Heap::LookupSingleCharacterStringFromCode(uint16_t code) {
}
+Object* Heap::AllocateByteArray(int length, PretenureFlag pretenure) {
+ if (pretenure == NOT_TENURED) {
+ return AllocateByteArray(length);
+ }
+ int size = ByteArray::SizeFor(length);
+ AllocationSpace space =
+ size > MaxHeapObjectSize() ? LO_SPACE : OLD_DATA_SPACE;
+
+ Object* result = AllocateRaw(size, space, OLD_DATA_SPACE);
+
+ if (result->IsFailure()) return result;
+
+ reinterpret_cast<Array*>(result)->set_map(byte_array_map());
+ reinterpret_cast<Array*>(result)->set_length(length);
+ return result;
+}
+
+
Object* Heap::AllocateByteArray(int length) {
int size = ByteArray::SizeFor(length);
AllocationSpace space =
« no previous file with comments | « regexp2000/src/heap.h ('k') | regexp2000/src/jsregexp.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698