@@ -1732,8 +1732,14 @@ class V8_EXPORT ScriptCompiler {
17321732 Local<String> arguments[], size_t context_extension_count,
17331733 Local<Object> context_extensions[],
17341734 CompileOptions options = kNoCompileOptions ,
1735- NoCacheReason no_cache_reason = kNoCacheNoReason ,
1736- Local<ScriptOrModule>* script_or_module_out = nullptr );
1735+ NoCacheReason no_cache_reason = kNoCacheNoReason );
1736+
1737+ static V8_WARN_UNUSED_RESULT MaybeLocal<Function> CompileFunctionInContext (
1738+ Local<Context> context, Source* source, size_t arguments_count,
1739+ Local<String> arguments[], size_t context_extension_count,
1740+ Local<Object> context_extensions[], CompileOptions options,
1741+ NoCacheReason no_cache_reason,
1742+ Local<ScriptOrModule>* script_or_module_out);
17371743
17381744 /* *
17391745 * Creates and returns code cache for the specified unbound_script.
@@ -3393,13 +3399,17 @@ enum class IntegrityLevel { kFrozen, kSealed };
33933399 */
33943400class V8_EXPORT Object : public Value {
33953401 public:
3402+ V8_DEPRECATED (" Use maybe version" ,
3403+ bool Set (Local<Value> key, Local<Value> value));
33963404 /* *
33973405 * Set only return Just(true) or Empty(), so if it should never fail, use
33983406 * result.Check().
33993407 */
34003408 V8_WARN_UNUSED_RESULT Maybe<bool > Set (Local<Context> context,
34013409 Local<Value> key, Local<Value> value);
34023410
3411+ V8_DEPRECATED (" Use maybe version" ,
3412+ bool Set (uint32_t index, Local<Value> value));
34033413 V8_WARN_UNUSED_RESULT Maybe<bool > Set (Local<Context> context, uint32_t index,
34043414 Local<Value> value);
34053415
@@ -3444,9 +3454,11 @@ class V8_EXPORT Object : public Value {
34443454 Local<Context> context, Local<Name> key,
34453455 PropertyDescriptor& descriptor); // NOLINT(runtime/references)
34463456
3457+ V8_DEPRECATED (" Use maybe version" , Local<Value> Get (Local<Value> key));
34473458 V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get (Local<Context> context,
34483459 Local<Value> key);
34493460
3461+ V8_DEPRECATED (" Use maybe version" , Local<Value> Get (uint32_t index));
34503462 V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get (Local<Context> context,
34513463 uint32_t index);
34523464
@@ -6560,19 +6572,7 @@ V8_INLINE Local<Boolean> False(Isolate* isolate);
65606572 */
65616573class V8_EXPORT ResourceConstraints {
65626574 public:
6563- /* *
6564- * Configures the constraints with reasonable default values based on the
6565- * provided heap size limit. The heap size includes both the young and
6566- * the old generation.
6567- *
6568- * \param maximum_heap_size_in_bytes The hard limit for the heap size.
6569- * When the heap size approaches this limit, V8 will perform series of
6570- * garbage collections and invoke the NearHeapLimitCallback.
6571- * If the garbage collections do not help and the callback does not
6572- * increase the limit, then V8 will crash with V8::FatalProcessOutOfMemory.
6573- */
6574- void ConfigureDefaultsFromHeapSize (size_t initial_heap_size_in_bytes,
6575- size_t maximum_heap_size_in_bytes);
6575+ ResourceConstraints ();
65766576
65776577 /* *
65786578 * Configures the constraints with reasonable default values based on the
@@ -6596,8 +6596,12 @@ class V8_EXPORT ResourceConstraints {
65966596 * The amount of virtual memory reserved for generated code. This is relevant
65976597 * for 64-bit architectures that rely on code range for calls in code.
65986598 */
6599- size_t code_range_size_in_bytes () const { return code_range_size_; }
6600- void set_code_range_size_in_bytes (size_t limit) { code_range_size_ = limit; }
6599+ size_t code_range_size_in_bytes () const {
6600+ return code_range_size_ * kMB ;
6601+ }
6602+ void set_code_range_size_in_bytes (size_t limit) {
6603+ code_range_size_ = limit / kMB ;
6604+ }
66016605
66026606 /* *
66036607 * The maximum size of the old generation.
@@ -6607,60 +6611,60 @@ class V8_EXPORT ResourceConstraints {
66076611 * increase the limit, then V8 will crash with V8::FatalProcessOutOfMemory.
66086612 */
66096613 size_t max_old_generation_size_in_bytes () const {
6610- return max_old_generation_size_ ;
6614+ return max_old_space_size_ * kMB ;
66116615 }
66126616 void set_max_old_generation_size_in_bytes (size_t limit) {
6613- max_old_generation_size_ = limit;
6617+ max_old_space_size_ = limit / kMB ;
66146618 }
66156619
66166620 /* *
66176621 * The maximum size of the young generation, which consists of two semi-spaces
66186622 * and a large object space. This affects frequency of Scavenge garbage
66196623 * collections and should be typically much smaller that the old generation.
66206624 */
6621- size_t max_young_generation_size_in_bytes () const {
6622- return max_young_generation_size_;
6623- }
6624- void set_max_young_generation_size_in_bytes (size_t limit) {
6625- max_young_generation_size_ = limit;
6626- }
6625+ size_t max_young_generation_size_in_bytes () const ;
6626+ void set_max_young_generation_size_in_bytes (size_t limit);
66276627
66286628 size_t initial_old_generation_size_in_bytes () const {
6629- return initial_old_generation_size_ ;
6629+ return 0 ;
66306630 }
66316631 void set_initial_old_generation_size_in_bytes (size_t initial_size) {
6632- initial_old_generation_size_ = initial_size;
6632+ // Not available on Node 12.
66336633 }
66346634
66356635 size_t initial_young_generation_size_in_bytes () const {
6636- return initial_young_generation_size_ ;
6636+ return 0 ;
66376637 }
66386638 void set_initial_young_generation_size_in_bytes (size_t initial_size) {
6639- initial_young_generation_size_ = initial_size;
6639+ // Not available on Node 12.
66406640 }
66416641
66426642 /* *
66436643 * Deprecated functions. Do not use in new code.
66446644 */
66456645 V8_DEPRECATE_SOON (" Use code_range_size_in_bytes." ,
66466646 size_t code_range_size () const ) {
6647- return code_range_size_ / kMB ;
6647+ return code_range_size_;
66486648 }
66496649 V8_DEPRECATE_SOON (" Use set_code_range_size_in_bytes." ,
66506650 void set_code_range_size (size_t limit_in_mb)) {
6651- code_range_size_ = limit_in_mb * kMB ;
6651+ code_range_size_ = limit_in_mb;
66526652 }
66536653 V8_DEPRECATE_SOON (" Use max_young_generation_size_in_bytes." ,
6654- size_t max_semi_space_size_in_kb () const );
6654+ size_t max_semi_space_size_in_kb () const ) {
6655+ return max_semi_space_size_in_kb_;
6656+ }
66556657 V8_DEPRECATE_SOON (" Use set_max_young_generation_size_in_bytes." ,
6656- void set_max_semi_space_size_in_kb (size_t limit_in_kb));
6658+ void set_max_semi_space_size_in_kb (size_t limit_in_kb)) {
6659+ max_semi_space_size_in_kb_ = limit_in_kb;
6660+ }
66576661 V8_DEPRECATE_SOON (" Use max_old_generation_size_in_bytes." ,
66586662 size_t max_old_space_size () const ) {
6659- return max_old_generation_size_ / kMB ;
6663+ return max_old_space_size_ ;
66606664 }
66616665 V8_DEPRECATE_SOON (" Use set_max_old_generation_size_in_bytes." ,
66626666 void set_max_old_space_size (size_t limit_in_mb)) {
6663- max_old_generation_size_ = limit_in_mb * kMB ;
6667+ max_old_space_size_ = limit_in_mb;
66646668 }
66656669 V8_DEPRECATE_SOON (" Zone does not pool memory any more." ,
66666670 size_t max_zone_pool_size () const ) {
@@ -6673,13 +6677,15 @@ class V8_EXPORT ResourceConstraints {
66736677
66746678 private:
66756679 static constexpr size_t kMB = 1048576u ;
6680+
6681+ // max_semi_space_size_ is in KB
6682+ size_t max_semi_space_size_in_kb_ = 0 ;
6683+
6684+ // The remaining limits are in MB
6685+ size_t max_old_space_size_ = 0 ;
6686+ uint32_t * stack_limit_ = nullptr ;
66766687 size_t code_range_size_ = 0 ;
6677- size_t max_old_generation_size_ = 0 ;
6678- size_t max_young_generation_size_ = 0 ;
66796688 size_t max_zone_pool_size_ = 0 ;
6680- size_t initial_old_generation_size_ = 0 ;
6681- size_t initial_young_generation_size_ = 0 ;
6682- uint32_t * stack_limit_ = nullptr ;
66836689};
66846690
66856691
0 commit comments