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

Unified Diff: src/objects.cc

Issue 7516: - Optimized copying of FixedArray. (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/heap.h ('K') | « src/objects.h ('k') | src/objects-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
===================================================================
--- src/objects.cc (revision 523)
+++ src/objects.cc (working copy)
@@ -889,13 +889,12 @@
String* JSObject::class_name() {
if (IsJSFunction()) return Heap::function_class_symbol();
- // If the constructor is not present "Object" is returned.
- String* result = Heap::Object_symbol();
if (map()->constructor()->IsJSFunction()) {
JSFunction* constructor = JSFunction::cast(map()->constructor());
return String::cast(constructor->shared()->instance_class_name());
}
- return result;
+ // If the constructor is not present, return "Object".
+ return Heap::Object_symbol();
}
@@ -2538,21 +2537,6 @@
}
-Object* FixedArray::Copy() {
- int len = length();
- if (len == 0) return this;
- Object* obj = Heap::AllocateFixedArray(len);
- if (obj->IsFailure()) return obj;
- FixedArray* result = FixedArray::cast(obj);
- WriteBarrierMode mode = result->GetWriteBarrierMode();
- // Copy the content
- for (int i = 0; i < len; i++) {
- result->set(i, get(i), mode);
- }
- result->set_map(map());
- return result;
-}
-
Object* FixedArray::CopySize(int new_length) {
if (new_length == 0) return Heap::empty_fixed_array();
Object* obj = Heap::AllocateFixedArray(new_length);
« src/heap.h ('K') | « src/objects.h ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698