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

Unified Diff: src/objects-inl.h

Issue 7863: - Optimized CopyFixedArray and CopyJSObject. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 12 years, 2 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
« src/objects.h ('K') | « src/objects.cc ('k') | src/runtime.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-inl.h
===================================================================
--- src/objects-inl.h (revision 546)
+++ src/objects-inl.h (working copy)
@@ -595,6 +595,17 @@
}
+Failure* Failure::RetryAfterGC(int requested_bytes) {
+ int requested = requested_bytes >> kObjectAlignmentBits;
+ int value = (requested << kSpaceTagSize) | NEW_SPACE;
+ ASSERT(value >> kSpaceTagSize == requested);
+ ASSERT(Smi::IsValid(value));
+ ASSERT(value == ((value << kFailureTypeTagSize) >> kFailureTypeTagSize));
+ ASSERT(Smi::IsValid(value << kFailureTypeTagSize));
+ return Construct(RETRY_AFTER_GC, value);
+}
+
+
Failure* Failure::Construct(Type type, int value) {
int info = (value << kFailureTypeTagSize) | type;
ASSERT(Smi::IsValid(info)); // Same validation check as in Smi
@@ -791,21 +802,6 @@
}
-void HeapObject::CopyBody(JSObject* from) {
- ASSERT(map() == from->map());
- ASSERT(Size() == from->Size());
- int object_size = Size();
- for (int offset = kHeaderSize;
- offset < object_size;
- offset += kPointerSize) {
- Object* value = READ_FIELD(from, offset);
- // Note: WRITE_FIELD does not update the write barrier.
- WRITE_FIELD(this, offset, value);
- WRITE_BARRIER(this, offset);
- }
-}
-
-
bool HeapObject::IsMarked() {
return map_word().IsMarked();
}
@@ -963,15 +959,17 @@
void JSObject::InitializeBody(int object_size) {
+ Object* value = Heap::undefined_value();
for (int offset = kHeaderSize; offset < object_size; offset += kPointerSize) {
- WRITE_FIELD(this, offset, Heap::undefined_value());
+ WRITE_FIELD(this, offset, value);
}
}
void Struct::InitializeBody(int object_size) {
+ Object* value = Heap::undefined_value();
for (int offset = kHeaderSize; offset < object_size; offset += kPointerSize) {
- WRITE_FIELD(this, offset, Heap::undefined_value());
+ WRITE_FIELD(this, offset, value);
}
}
« src/objects.h ('K') | « src/objects.cc ('k') | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698