Upgrade V8 to version 4.9.385.28
https://chromium.googlesource.com/v8/v8/+/4.9.385.28
FPIIM-449
Change-Id: I4b2e74289d4bf3667f2f3dc8aa2e541f63e26eb4
diff --git a/src/bootstrapper.h b/src/bootstrapper.h
index 9d4f270..44f0f1b 100644
--- a/src/bootstrapper.h
+++ b/src/bootstrapper.h
@@ -15,7 +15,7 @@
// (runtime.js, etc.) to precompiled functions. Instead of mapping
// names to functions it might make sense to let the JS2C tool
// generate an index for each native JS file.
-class SourceCodeCache FINAL BASE_EMBEDDED {
+class SourceCodeCache final BASE_EMBEDDED {
public:
explicit SourceCodeCache(Script::Type type): type_(type), cache_(NULL) { }
@@ -52,7 +52,7 @@
DCHECK(!str.is_null());
cache_->set(length, *str);
cache_->set(length + 1, *shared);
- Script::cast(shared->script())->set_type(Smi::FromInt(type_));
+ Script::cast(shared->script())->set_type(type_);
}
private:
@@ -61,10 +61,11 @@
DISALLOW_COPY_AND_ASSIGN(SourceCodeCache);
};
+enum ContextType { FULL_CONTEXT, THIN_CONTEXT, DEBUG_CONTEXT };
// The Boostrapper is the public interface for creating a JavaScript global
// context.
-class Bootstrapper FINAL {
+class Bootstrapper final {
public:
static void InitializeOncePerProcess();
static void TearDownExtensions();
@@ -77,8 +78,9 @@
// The returned value is a global handle casted to V8Environment*.
Handle<Context> CreateEnvironment(
MaybeHandle<JSGlobalProxy> maybe_global_proxy,
- v8::Handle<v8::ObjectTemplate> global_object_template,
- v8::ExtensionConfiguration* extensions);
+ v8::Local<v8::ObjectTemplate> global_object_template,
+ v8::ExtensionConfiguration* extensions,
+ ContextType context_type = FULL_CONTEXT);
// Detach the environment from its outer global object.
void DetachGlobal(Handle<Context> env);
@@ -87,7 +89,8 @@
void Iterate(ObjectVisitor* v);
// Accessor for the native scripts source code.
- Handle<String> NativesSourceLookup(int index);
+ template <class Source>
+ Handle<String> SourceLookup(int index);
// Tells whether bootstrapping is active.
bool IsActive() const { return nesting_ != 0; }
@@ -98,25 +101,29 @@
char* RestoreState(char* from);
void FreeThreadResources();
- // This will allocate a char array that is deleted when V8 is shut down.
- // It should only be used for strictly finite allocations.
- char* AllocateAutoDeletedArray(int bytes);
-
// Used for new context creation.
bool InstallExtensions(Handle<Context> native_context,
v8::ExtensionConfiguration* extensions);
SourceCodeCache* extensions_cache() { return &extensions_cache_; }
+ static bool CompileNative(Isolate* isolate, Vector<const char> name,
+ Handle<String> source, int argc,
+ Handle<Object> argv[]);
+ static bool CompileBuiltin(Isolate* isolate, int index);
+ static bool CompileExperimentalBuiltin(Isolate* isolate, int index);
+ static bool CompileExtraBuiltin(Isolate* isolate, int index);
+ static bool CompileExperimentalExtraBuiltin(Isolate* isolate, int index);
+
+ static void ExportFromRuntime(Isolate* isolate, Handle<JSObject> container);
+ static void ExportExperimentalFromRuntime(Isolate* isolate,
+ Handle<JSObject> container);
+
private:
Isolate* isolate_;
typedef int NestingCounterType;
NestingCounterType nesting_;
SourceCodeCache extensions_cache_;
- // This is for delete, not delete[].
- List<char*>* delete_these_non_arrays_on_tear_down_;
- // This is for delete[]
- List<char*>* delete_these_arrays_on_tear_down_;
friend class BootstrapperActive;
friend class Isolate;
@@ -134,7 +141,7 @@
};
-class BootstrapperActive FINAL BASE_EMBEDDED {
+class BootstrapperActive final BASE_EMBEDDED {
public:
explicit BootstrapperActive(Bootstrapper* bootstrapper)
: bootstrapper_(bootstrapper) {
@@ -152,20 +159,20 @@
};
-class NativesExternalStringResource FINAL
+class NativesExternalStringResource final
: public v8::String::ExternalOneByteStringResource {
public:
- NativesExternalStringResource(Bootstrapper* bootstrapper,
- const char* source,
- size_t length);
- const char* data() const OVERRIDE { return data_; }
- size_t length() const OVERRIDE { return length_; }
+ NativesExternalStringResource(const char* source, size_t length)
+ : data_(source), length_(length) {}
+ const char* data() const override { return data_; }
+ size_t length() const override { return length_; }
private:
const char* data_;
size_t length_;
};
-}} // namespace v8::internal
+} // namespace internal
+} // namespace v8
#endif // V8_BOOTSTRAPPER_H_