Skip to content

Commit

Permalink
deps: V8: cherry-pick 98b1ef80c722
Browse files Browse the repository at this point in the history
Original commit message:

    Expose the %ObjProto_valueOf% intrinsic object to embedders

    https://html.spec.whatwg.org/multipage/history.html#the-location-interface
    HTML Location platform objects need to be initialized with using
    the %ObjProto_valueOf% intrinsic object.

    This patch exposes the %ObjProto_valueOf% intrinsic object to
    embedders.

    Example usage is: https://crrev.com/c/2102306

    Change-Id: Iec58135773e01aed5de330c0c5dea89a49835a52
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2102408
    Reviewed-by: Yang Guo <yangguo@chromium.org>
    Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
    Commit-Queue: Yuki Shiino <yukishiino@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#66747}

Refs: v8/v8@98b1ef8

PR-URL: #32885
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Ujjwal Sharma <ryzokuken@disroot.org>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com>
  • Loading branch information
addaleax authored and BethGriggs committed Apr 20, 2020
1 parent e8c7b7a commit a27852a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

# Reset this number to 0 on major V8 upgrades.
# Increment by one for each non-official patch applied to deps/v8.
'v8_embedder_string': '-node.25',
'v8_embedder_string': '-node.26',

##### V8 defaults for Node.js #####

Expand Down
15 changes: 8 additions & 7 deletions deps/v8/include/v8.h
Original file line number Diff line number Diff line change
Expand Up @@ -5926,13 +5926,14 @@ class V8_EXPORT External : public Value {
static void CheckCast(v8::Value* obj);
};

#define V8_INTRINSICS_LIST(F) \
F(ArrayProto_entries, array_entries_iterator) \
F(ArrayProto_forEach, array_for_each_iterator) \
F(ArrayProto_keys, array_keys_iterator) \
F(ArrayProto_values, array_values_iterator) \
F(ErrorPrototype, initial_error_prototype) \
F(IteratorPrototype, initial_iterator_prototype)
#define V8_INTRINSICS_LIST(F) \
F(ArrayProto_entries, array_entries_iterator) \
F(ArrayProto_forEach, array_for_each_iterator) \
F(ArrayProto_keys, array_keys_iterator) \
F(ArrayProto_values, array_values_iterator) \
F(ErrorPrototype, initial_error_prototype) \
F(IteratorPrototype, initial_iterator_prototype) \
F(ObjProto_valueOf, object_value_of_function)

enum Intrinsic {
#define V8_DECL_INTRINSIC(name, iname) k##name,
Expand Down
7 changes: 4 additions & 3 deletions deps/v8/src/init/bootstrapper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1551,9 +1551,10 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
isolate_, isolate_->initial_object_prototype(), "toString",
Builtins::kObjectPrototypeToString, 0, true);
native_context()->set_object_to_string(*object_to_string);
SimpleInstallFunction(isolate_, isolate_->initial_object_prototype(),
"valueOf", Builtins::kObjectPrototypeValueOf, 0,
true);
Handle<JSFunction> object_value_of = SimpleInstallFunction(
isolate_, isolate_->initial_object_prototype(), "valueOf",
Builtins::kObjectPrototypeValueOf, 0, true);
native_context()->set_object_value_of_function(*object_value_of);

SimpleInstallGetterSetter(
isolate_, isolate_->initial_object_prototype(), factory->proto_string(),
Expand Down
1 change: 1 addition & 0 deletions deps/v8/src/objects/contexts.h
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,7 @@ enum ContextLookupFlags {
V(MAP_SET_INDEX, JSFunction, map_set) \
V(FUNCTION_HAS_INSTANCE_INDEX, JSFunction, function_has_instance) \
V(OBJECT_TO_STRING, JSFunction, object_to_string) \
V(OBJECT_VALUE_OF_FUNCTION_INDEX, JSFunction, object_value_of_function) \
V(PROMISE_ALL_INDEX, JSFunction, promise_all) \
V(PROMISE_CATCH_INDEX, JSFunction, promise_catch) \
V(PROMISE_FUNCTION_INDEX, JSFunction, promise_function) \
Expand Down

0 comments on commit a27852a

Please sign in to comment.