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

Unified Diff: src/api.cc

Issue 6815029: Merge (7180:7265] from bleeding_edge to the experimental/gc branch.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/gc/
Patch Set: Created 9 years, 8 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 | « include/v8.h ('k') | src/arm/code-stubs-arm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
===================================================================
--- src/api.cc (revision 7557)
+++ src/api.cc (working copy)
@@ -3960,7 +3960,9 @@
EnsureInitialized("v8::Array::New()");
LOG_API("Array::New");
ENTER_V8;
- i::Handle<i::JSArray> obj = i::Factory::NewJSArray(length);
+ int real_length = length > 0 ? length : 0;
+ i::Handle<i::JSArray> obj = i::Factory::NewJSArray(real_length);
+ obj->set_length(*i::Factory::NewNumberFromInt(real_length));
return Utils::ToLocal(obj);
}
@@ -4126,11 +4128,22 @@
RetainedObjectInfo* info) {
if (IsDeadCheck("v8::V8::AddObjectGroup()")) return;
STATIC_ASSERT(sizeof(Persistent<Value>) == sizeof(i::Object**));
- i::GlobalHandles::AddGroup(
+ i::GlobalHandles::AddObjectGroup(
reinterpret_cast<i::Object***>(objects), length, info);
}
+void V8::AddImplicitReferences(Persistent<Object> parent,
+ Persistent<Value>* children,
+ size_t length) {
+ if (IsDeadCheck("v8::V8::AddImplicitReferences()")) return;
+ STATIC_ASSERT(sizeof(Persistent<Value>) == sizeof(i::Object**));
+ i::GlobalHandles::AddImplicitReferences(
+ *Utils::OpenHandle(*parent),
+ reinterpret_cast<i::Object***>(children), length);
+}
+
+
int V8::AdjustAmountOfExternalAllocatedMemory(int change_in_bytes) {
if (IsDeadCheck("v8::V8::AdjustAmountOfExternalAllocatedMemory()")) return 0;
return i::Heap::AdjustAmountOfExternalAllocatedMemory(change_in_bytes);
« no previous file with comments | « include/v8.h ('k') | src/arm/code-stubs-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698