Fix debug print and wrong handle dereference in es6 typed array.
R=dslomov@chromium.org BUG= Review URL: https://chromiumcodereview.appspot.com/14149009 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14330 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
parent
e210d8325f
commit
373bdbc951
@ -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();
|
||||
}
|
||||
|
||||
|
@ -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); \
|
||||
|
@ -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);
|
||||
@ -734,8 +733,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_ArrayBufferSliceImpl) {
|
||||
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());
|
||||
|
Loading…
Reference in New Issue
Block a user