diff options
author | Michaël Zasso <targos@protonmail.com> | 2017-12-05 16:41:55 +0100 |
---|---|---|
committer | Michaël Zasso <targos@protonmail.com> | 2017-12-06 12:52:07 +0100 |
commit | 1854ba04e9a68f062beb299dd6e1479279b26363 (patch) | |
tree | d5b2df9b8c1deb6388f7a728fca8e1c98c779abe /deps/v8/src/bootstrapper.h | |
parent | b52c23b75f96e1c9d2c7b3a7e5619170d0a0d8e1 (diff) | |
download | android-node-v8-1854ba04e9a68f062beb299dd6e1479279b26363.tar.gz android-node-v8-1854ba04e9a68f062beb299dd6e1479279b26363.tar.bz2 android-node-v8-1854ba04e9a68f062beb299dd6e1479279b26363.zip |
deps: update V8 to 6.3.292.46
PR-URL: https://github.com/nodejs/node/pull/16271
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Diffstat (limited to 'deps/v8/src/bootstrapper.h')
-rw-r--r-- | deps/v8/src/bootstrapper.h | 34 |
1 files changed, 3 insertions, 31 deletions
diff --git a/deps/v8/src/bootstrapper.h b/deps/v8/src/bootstrapper.h index 05eb74f091..d49180190e 100644 --- a/deps/v8/src/bootstrapper.h +++ b/deps/v8/src/bootstrapper.h @@ -22,44 +22,16 @@ class SourceCodeCache final BASE_EMBEDDED { public: explicit SourceCodeCache(Script::Type type): type_(type), cache_(NULL) { } - void Initialize(Isolate* isolate, bool create_heap_objects) { - cache_ = create_heap_objects ? isolate->heap()->empty_fixed_array() : NULL; - } + void Initialize(Isolate* isolate, bool create_heap_objects); void Iterate(RootVisitor* v) { v->VisitRootPointer(Root::kExtensions, bit_cast<Object**, FixedArray**>(&cache_)); } - bool Lookup(Vector<const char> name, Handle<SharedFunctionInfo>* handle) { - for (int i = 0; i < cache_->length(); i+=2) { - SeqOneByteString* str = SeqOneByteString::cast(cache_->get(i)); - if (str->IsUtf8EqualTo(name)) { - *handle = Handle<SharedFunctionInfo>( - SharedFunctionInfo::cast(cache_->get(i + 1))); - return true; - } - } - return false; - } + bool Lookup(Vector<const char> name, Handle<SharedFunctionInfo>* handle); - void Add(Vector<const char> name, Handle<SharedFunctionInfo> shared) { - Isolate* isolate = shared->GetIsolate(); - Factory* factory = isolate->factory(); - HandleScope scope(isolate); - int length = cache_->length(); - Handle<FixedArray> new_array = factory->NewFixedArray(length + 2, TENURED); - cache_->CopyTo(0, *new_array, 0, cache_->length()); - cache_ = *new_array; - Handle<String> str = - factory - ->NewStringFromOneByte(Vector<const uint8_t>::cast(name), TENURED) - .ToHandleChecked(); - DCHECK(!str.is_null()); - cache_->set(length, *str); - cache_->set(length + 1, *shared); - Script::cast(shared->script())->set_type(type_); - } + void Add(Vector<const char> name, Handle<SharedFunctionInfo> shared); private: Script::Type type_; |