-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1. Put the v8 binding data class into a header so we can reuse the class definition during deserialization. 2. Put the v8 binding code into node::v8_utils namespace for clarity. 3. Move the binding data property initialization into its constructor so that we can reuse it during deserialization 4. Reorder the v8 binding initialization so that we don't unnecessarily initialize the properties in a loop PR-URL: #37112 Refs: #36943 Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
- Loading branch information
1 parent
54d36b0
commit 1a9bcdf
Showing
3 changed files
with
77 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#ifndef SRC_NODE_V8_H_ | ||
#define SRC_NODE_V8_H_ | ||
|
||
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS | ||
|
||
#include "aliased_buffer.h" | ||
#include "base_object.h" | ||
#include "util.h" | ||
#include "v8.h" | ||
|
||
namespace node { | ||
class Environment; | ||
|
||
namespace v8_utils { | ||
class BindingData : public BaseObject { | ||
public: | ||
BindingData(Environment* env, v8::Local<v8::Object> obj); | ||
|
||
static constexpr FastStringKey type_name{"node::v8::BindingData"}; | ||
|
||
AliasedFloat64Array heap_statistics_buffer; | ||
AliasedFloat64Array heap_space_statistics_buffer; | ||
AliasedFloat64Array heap_code_statistics_buffer; | ||
|
||
void MemoryInfo(MemoryTracker* tracker) const override; | ||
SET_SELF_SIZE(BindingData) | ||
SET_MEMORY_INFO_NAME(BindingData) | ||
}; | ||
|
||
} // namespace v8_utils | ||
|
||
} // namespace node | ||
|
||
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS | ||
|
||
#endif // SRC_NODE_V8_H_ |