File tree 2 files changed +15
-12
lines changed
2 files changed +15
-12
lines changed Original file line number Diff line number Diff line change 36
36
37
37
namespace node {
38
38
39
- // Create string properties as internalized one byte strings.
39
+ inline IsolateData::IsolateData (v8::Isolate* isolate, uv_loop_t * event_loop,
40
+ uint32_t * zero_fill_field) :
41
+
42
+ // Create string and private symbol properties as internalized one byte strings.
40
43
//
41
44
// Internalized because it makes property lookups a little faster and because
42
45
// the string is created in the old space straight away. It's going to end up
@@ -45,9 +48,6 @@ namespace node {
45
48
//
46
49
// One byte because our strings are ASCII and we can safely skip V8's UTF-8
47
50
// decoding step. It's a one-time cost, but why pay it when you don't have to?
48
- inline IsolateData::IsolateData (v8::Isolate* isolate, uv_loop_t * event_loop,
49
- uint32_t * zero_fill_field)
50
- :
51
51
#define V (PropertyName, StringValue ) \
52
52
PropertyName ## _( \
53
53
isolate, \
Original file line number Diff line number Diff line change 40
40
#include < stdint.h>
41
41
#include < vector>
42
42
43
- // Caveat emptor: we're going slightly crazy with macros here but the end
44
- // hopefully justifies the means. We have a lot of per-context properties
45
- // and adding and maintaining their getters and setters by hand would be
46
- // a nightmare so let's make the preprocessor generate them for us.
47
- //
48
- // Make sure that any macros defined here are undefined again at the bottom
49
- // of context-inl.h. The exceptions are NODE_CONTEXT_EMBEDDER_DATA_INDEX
50
- // and NODE_ISOLATE_SLOT, they may have been defined externally.
51
43
namespace node {
52
44
53
45
// Pick an index that's hopefully out of the way when we're embedded inside
@@ -64,6 +56,17 @@ namespace node {
64
56
#define NODE_PUSH_VAL_TO_ARRAY_MAX 8
65
57
#endif
66
58
59
+ // PER_ISOLATE_* macros: We have a lot of per-isolate properties
60
+ // and adding and maintaining their getters and setters by hand would be
61
+ // difficult so let's make the preprocessor generate them for us.
62
+ //
63
+ // In each macro, `V` is expected to be the name of a macro or function which
64
+ // accepts the number of arguments provided in each tuple in the macro body,
65
+ // typically two. The named function will be invoked against each tuple.
66
+ //
67
+ // Make sure that any macro V defined for use with the PER_ISOLATE_* macros is
68
+ // undefined again after use.
69
+
67
70
// Private symbols are per-isolate primitives but Environment proxies them
68
71
// for the sake of convenience. Strings should be ASCII-only and have a
69
72
// "node:" prefix to avoid name clashes with third-party code.
You can’t perform that action at this time.
0 commit comments