Revision: 14330
Author: [email protected]
Date: Thu Apr 18 05:46:38 2013
Log: Fix debug print and wrong handle dereference in es6 typed array.
[email protected]
BUG=
Review URL: https://chromiumcodereview.appspot.com/14149009
http://code.google.com/p/v8/source/detail?r=14330
Modified:
/branches/bleeding_edge/src/api.cc
/branches/bleeding_edge/src/objects-printer.cc
/branches/bleeding_edge/src/runtime.cc
=======================================
--- /branches/bleeding_edge/src/api.cc Tue Apr 16 09:37:04 2013
+++ /branches/bleeding_edge/src/api.cc Thu Apr 18 05:46:38 2013
@@ -623,6 +623,9 @@
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();
}
=======================================
--- /branches/bleeding_edge/src/objects-printer.cc Tue Apr 16 07:16:30 2013
+++ /branches/bleeding_edge/src/objects-printer.cc Thu Apr 18 05:46:38 2013
@@ -187,8 +187,10 @@
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); \
=======================================
--- /branches/bleeding_edge/src/runtime.cc Thu Apr 18 02:50:46 2013
+++ /branches/bleeding_edge/src/runtime.cc Thu Apr 18 05:46:38 2013
@@ -706,9 +706,8 @@
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);
@@ -734,8 +733,7 @@
size_t start = static_cast<size_t>(first);
size_t target_length = NumberToSize(isolate, target->byte_length());
- if (target_length == 0)
- return isolate->heap()->undefined_value();
+ if (target_length == 0) return isolate->heap()->undefined_value();
ASSERT(NumberToSize(isolate, source->byte_length()) - target_length >=
start);
uint8_t* source_data =
reinterpret_cast<uint8_t*>(source->backing_store());
--
--
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.