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 4417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4428 | 4428 |
4429 | 4429 |
4430 static void* ExternalValue(i::Object* obj) { | 4430 static void* ExternalValue(i::Object* obj) { |
4431 // Obscure semantics for undefined, but somehow checked in our unit tests... | 4431 // Obscure semantics for undefined, but somehow checked in our unit tests... |
4432 if (obj->IsUndefined()) return NULL; | 4432 if (obj->IsUndefined()) return NULL; |
4433 i::Object* foreign = i::JSObject::cast(obj)->GetInternalField(0); | 4433 i::Object* foreign = i::JSObject::cast(obj)->GetInternalField(0); |
4434 return i::Foreign::cast(foreign)->foreign_address(); | 4434 return i::Foreign::cast(foreign)->foreign_address(); |
4435 } | 4435 } |
4436 | 4436 |
4437 | 4437 |
4438 void* Object::GetPointerFromInternalField(int index) { | |
4439 i::Handle<i::JSObject> obj = Utils::OpenHandle(this); | |
4440 const char* location = "v8::Object::GetPointerFromInternalField()"; | |
4441 if (!InternalFieldOK(obj, index, location)) return NULL; | |
4442 return ExternalValue(obj->GetInternalField(index)); | |
4443 } | |
4444 | |
4445 | |
4446 // --- E n v i r o n m e n t --- | 4438 // --- E n v i r o n m e n t --- |
4447 | 4439 |
4448 | 4440 |
4449 bool v8::V8::Initialize() { | 4441 bool v8::V8::Initialize() { |
4450 i::Isolate* isolate = i::Isolate::UncheckedCurrent(); | 4442 i::Isolate* isolate = i::Isolate::UncheckedCurrent(); |
4451 if (isolate != NULL && isolate->IsInitialized()) { | 4443 if (isolate != NULL && isolate->IsInitialized()) { |
4452 return true; | 4444 return true; |
4453 } | 4445 } |
4454 return InitializeHelper(); | 4446 return InitializeHelper(); |
4455 } | 4447 } |
(...skipping 2319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6775 | 6767 |
6776 v->VisitPointers(blocks_.first(), first_block_limit_); | 6768 v->VisitPointers(blocks_.first(), first_block_limit_); |
6777 | 6769 |
6778 for (int i = 1; i < blocks_.length(); i++) { | 6770 for (int i = 1; i < blocks_.length(); i++) { |
6779 v->VisitPointers(blocks_[i], &blocks_[i][kHandleBlockSize]); | 6771 v->VisitPointers(blocks_[i], &blocks_[i][kHandleBlockSize]); |
6780 } | 6772 } |
6781 } | 6773 } |
6782 | 6774 |
6783 | 6775 |
6784 } } // namespace v8::internal | 6776 } } // namespace v8::internal |
OLD | NEW |