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/api.cc

Issue 6711027: [Isolates] Merge 7201:7258 from bleeding_edge to isolates. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/isolates/
Patch Set: Created 9 years, 9 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
Index: src/api.cc
===================================================================
--- src/api.cc (revision 7254)
+++ src/api.cc (working copy)
@@ -4195,7 +4195,9 @@
EnsureInitializedForIsolate(isolate, "v8::Array::New()");
LOG_API(isolate, "Array::New");
ENTER_V8;
- i::Handle<i::JSArray> obj = FACTORY->NewJSArray(length);
+ int real_length = length > 0 ? length : 0;
+ i::Handle<i::JSArray> obj = isolate->factory()->NewJSArray(real_length);
+ obj->set_length(*isolate->factory()->NewNumberFromInt(real_length));
return Utils::ToLocal(obj);
}
@@ -4378,11 +4380,23 @@
i::Isolate* isolate = i::Isolate::Current();
if (IsDeadCheck(isolate, "v8::V8::AddObjectGroup()")) return;
STATIC_ASSERT(sizeof(Persistent<Value>) == sizeof(i::Object**));
- isolate->global_handles()->AddGroup(
+ isolate->global_handles()->AddObjectGroup(
reinterpret_cast<i::Object***>(objects), length, info);
}
+void V8::AddImplicitReferences(Persistent<Object> parent,
+ Persistent<Value>* children,
+ size_t length) {
+ i::Isolate* isolate = i::Isolate::Current();
+ if (IsDeadCheck(isolate, "v8::V8::AddImplicitReferences()")) return;
+ STATIC_ASSERT(sizeof(Persistent<Value>) == sizeof(i::Object**));
+ isolate->global_handles()->AddImplicitReferences(
+ *Utils::OpenHandle(*parent),
+ reinterpret_cast<i::Object***>(children), length);
+}
+
+
int V8::AdjustAmountOfExternalAllocatedMemory(int change_in_bytes) {
i::Isolate* isolate = i::Isolate::Current();
if (IsDeadCheck(isolate, "v8::V8::AdjustAmountOfExternalAllocatedMemory()")) {
« no previous file with comments | « include/v8.h ('k') | src/arm/code-stubs-arm.cc » ('j') | src/global-handles.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698