OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 6144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6155 void v8::ArrayBuffer::Neuter() { | 6155 void v8::ArrayBuffer::Neuter() { |
6156 i::Handle<i::JSArrayBuffer> obj = Utils::OpenHandle(this); | 6156 i::Handle<i::JSArrayBuffer> obj = Utils::OpenHandle(this); |
6157 i::Isolate* isolate = obj->GetIsolate(); | 6157 i::Isolate* isolate = obj->GetIsolate(); |
6158 ApiCheck(obj->is_external(), | 6158 ApiCheck(obj->is_external(), |
6159 "v8::ArrayBuffer::Neuter", | 6159 "v8::ArrayBuffer::Neuter", |
6160 "Only externalized ArrayBuffers can be neutered"); | 6160 "Only externalized ArrayBuffers can be neutered"); |
6161 LOG_API(obj->GetIsolate(), "v8::ArrayBuffer::Neuter()"); | 6161 LOG_API(obj->GetIsolate(), "v8::ArrayBuffer::Neuter()"); |
6162 ENTER_V8(isolate); | 6162 ENTER_V8(isolate); |
6163 | 6163 |
6164 for (i::Handle<i::Object> array_obj(obj->weak_first_array(), isolate); | 6164 for (i::Handle<i::Object> array_obj(obj->weak_first_array(), isolate); |
6165 *array_obj != i::Smi::FromInt(0);) { | 6165 !array_obj->IsUndefined();) { |
6166 i::Handle<i::JSTypedArray> typed_array(i::JSTypedArray::cast(*array_obj)); | 6166 i::Handle<i::JSTypedArray> typed_array(i::JSTypedArray::cast(*array_obj)); |
6167 typed_array->Neuter(); | 6167 typed_array->Neuter(); |
6168 array_obj = i::handle(typed_array->weak_next(), isolate); | 6168 array_obj = i::handle(typed_array->weak_next(), isolate); |
6169 } | 6169 } |
6170 obj->Neuter(); | 6170 obj->Neuter(); |
6171 } | 6171 } |
6172 | 6172 |
6173 | 6173 |
6174 size_t v8::ArrayBuffer::ByteLength() const { | 6174 size_t v8::ArrayBuffer::ByteLength() const { |
6175 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); | 6175 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); |
(...skipping 1820 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7996 | 7996 |
7997 v->VisitPointers(blocks_.first(), first_block_limit_); | 7997 v->VisitPointers(blocks_.first(), first_block_limit_); |
7998 | 7998 |
7999 for (int i = 1; i < blocks_.length(); i++) { | 7999 for (int i = 1; i < blocks_.length(); i++) { |
8000 v->VisitPointers(blocks_[i], &blocks_[i][kHandleBlockSize]); | 8000 v->VisitPointers(blocks_[i], &blocks_[i][kHandleBlockSize]); |
8001 } | 8001 } |
8002 } | 8002 } |
8003 | 8003 |
8004 | 8004 |
8005 } } // namespace v8::internal | 8005 } } // namespace v8::internal |
OLD | NEW |