Reviewers: Dmitry Lomov (chromium),
Description:
Fix debug print and wrong handle dereference in es6 typed array.
[email protected]
BUG=
Please review this at https://chromiumcodereview.appspot.com/14149009/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files:
M src/api.cc
M src/objects-printer.cc
M src/runtime.cc
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index
dddcd7dcf502bb3f3216763b9477dcf724a0299f..15831ec6a878d7d68a094958940e9da461752f18
100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -623,6 +623,9 @@ i::Object** V8::GlobalizeReference(i::Isolate* isolate,
i::Object** obj) {
if (IsDeadCheck(isolate, "V8::Persistent::New")) return NULL;
LOG_API(isolate, "Persistent::New");
i::Handle<i::Object> result = isolate->global_handles()->Create(*obj);
+#ifdef DEBUG
+ (*obj)->Verify();
+#endif // DEBUG
return result.location();
}
Index: src/objects-printer.cc
diff --git a/src/objects-printer.cc b/src/objects-printer.cc
index
aa71a961be5c87ff693e3bc73ddf00b7cd7de396..f21481ab0bbbd37f4023e2fdfcaefed23f73925e
100644
--- a/src/objects-printer.cc
+++ b/src/objects-printer.cc
@@ -187,8 +187,10 @@ void HeapObject::HeapObjectPrint(FILE* out) {
break;
case JS_ARRAY_BUFFER_TYPE:
JSArrayBuffer::cast(this)->JSArrayBufferPrint(out);
+ break;
case JS_TYPED_ARRAY_TYPE:
JSTypedArray::cast(this)->JSTypedArrayPrint(out);
+ break;
#define MAKE_STRUCT_CASE(NAME, Name, name) \
case NAME##_TYPE: \
Name::cast(this)->Name##Print(out); \
Index: src/runtime.cc
diff --git a/src/runtime.cc b/src/runtime.cc
index
2a34b84c3674ce77afe441d96f71886b547aa045..1648ea88a965b3141e209bda1d6f4166f62a27ea
100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -706,9 +706,8 @@ RUNTIME_FUNCTION(MaybeObject*,
Runtime_ArrayBufferInitialize) {
holder->set_byte_length(byte_length);
v8::Isolate* external_isolate = reinterpret_cast<v8::Isolate*>(isolate);
- v8::Handle<Object> external_holder(*holder);
- Persistent<Object> weak_handle = Persistent<Object>::New(
- external_isolate, external_holder);
+ v8::Persistent<v8::Value> weak_handle = v8::Persistent<v8::Value>::New(
+ external_isolate, v8::Utils::ToLocal(Handle<Object>::cast(holder)));
weak_handle.MakeWeak(external_isolate, data, ArrayBufferWeakCallback);
weak_handle.MarkIndependent(external_isolate);
isolate->heap()->AdjustAmountOfExternalAllocatedMemory(allocated_length);
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.