@@ -1567,7 +1567,9 @@ class V8_EXPORT ScriptCompiler {
1567
1567
static V8_WARN_UNUSED_RESULT MaybeLocal<Function> CompileFunctionInContext (
1568
1568
Local<Context> context, Source* source, size_t arguments_count,
1569
1569
Local<String> arguments[], size_t context_extension_count,
1570
- Local<Object> context_extensions[]);
1570
+ Local<Object> context_extensions[],
1571
+ CompileOptions options = kNoCompileOptions ,
1572
+ NoCacheReason no_cache_reason = kNoCacheNoReason );
1571
1573
1572
1574
/* *
1573
1575
* Creates and returns code cache for the specified unbound_script.
@@ -1641,7 +1643,7 @@ class V8_EXPORT Message {
1641
1643
* Returns the index within the line of the first character where
1642
1644
* the error occurred.
1643
1645
*/
1644
- V8_DEPRECATED ( " Use maybe version " , int GetStartColumn () const ) ;
1646
+ int GetStartColumn () const ;
1645
1647
V8_WARN_UNUSED_RESULT Maybe<int > GetStartColumn (Local<Context> context) const ;
1646
1648
1647
1649
/* *
@@ -3075,6 +3077,8 @@ enum PropertyFilter {
3075
3077
SKIP_SYMBOLS = 16
3076
3078
};
3077
3079
3080
+ enum class SideEffectType { kHasSideEffect , kHasNoSideEffect };
3081
+
3078
3082
/* *
3079
3083
* Keys/Properties filter enums:
3080
3084
*
@@ -3207,13 +3211,12 @@ class V8_EXPORT Object : public Value {
3207
3211
V8_WARN_UNUSED_RESULT Maybe<bool > Delete (Local<Context> context,
3208
3212
uint32_t index);
3209
3213
3210
- V8_WARN_UNUSED_RESULT Maybe<bool > SetAccessor (Local<Context> context,
3211
- Local<Name> name,
3212
- AccessorNameGetterCallback getter,
3213
- AccessorNameSetterCallback setter = 0 ,
3214
- MaybeLocal<Value> data = MaybeLocal<Value>(),
3215
- AccessControl settings = DEFAULT,
3216
- PropertyAttribute attribute = None);
3214
+ V8_WARN_UNUSED_RESULT Maybe<bool > SetAccessor (
3215
+ Local<Context> context, Local<Name> name,
3216
+ AccessorNameGetterCallback getter, AccessorNameSetterCallback setter = 0 ,
3217
+ MaybeLocal<Value> data = MaybeLocal<Value>(),
3218
+ AccessControl settings = DEFAULT, PropertyAttribute attribute = None,
3219
+ SideEffectType getter_side_effect_type = SideEffectType::kHasSideEffect);
3217
3220
3218
3221
void SetAccessorProperty (Local<Name> name, Local<Function> getter,
3219
3222
Local<Function> setter = Local<Function>(),
@@ -3228,7 +3231,8 @@ class V8_EXPORT Object : public Value {
3228
3231
Local<Context> context, Local<Name> name,
3229
3232
AccessorNameGetterCallback getter,
3230
3233
AccessorNameSetterCallback setter = nullptr ,
3231
- Local<Value> data = Local<Value>(), PropertyAttribute attributes = None);
3234
+ Local<Value> data = Local<Value>(), PropertyAttribute attributes = None,
3235
+ SideEffectType getter_side_effect_type = SideEffectType::kHasSideEffect);
3232
3236
3233
3237
/* *
3234
3238
* Attempts to create a property with the given name which behaves like a data
@@ -3241,7 +3245,8 @@ class V8_EXPORT Object : public Value {
3241
3245
V8_WARN_UNUSED_RESULT Maybe<bool > SetLazyDataProperty (
3242
3246
Local<Context> context, Local<Name> name,
3243
3247
AccessorNameGetterCallback getter, Local<Value> data = Local<Value>(),
3244
- PropertyAttribute attributes = None);
3248
+ PropertyAttribute attributes = None,
3249
+ SideEffectType getter_side_effect_type = SideEffectType::kHasSideEffect);
3245
3250
3246
3251
/* *
3247
3252
* Functionality for private properties.
@@ -3496,7 +3501,7 @@ class V8_EXPORT Object : public Value {
3496
3501
/* *
3497
3502
* Return the isolate to which the Object belongs to.
3498
3503
*/
3499
- V8_DEPRECATE_SOON ( " Keep track of isolate correctly " , Isolate* GetIsolate () );
3504
+ Isolate* GetIsolate ();
3500
3505
3501
3506
static Local<Object> New (Isolate* isolate);
3502
3507
@@ -3833,7 +3838,8 @@ class V8_EXPORT Function : public Object {
3833
3838
static MaybeLocal<Function> New (
3834
3839
Local<Context> context, FunctionCallback callback,
3835
3840
Local<Value> data = Local<Value>(), int length = 0,
3836
- ConstructorBehavior behavior = ConstructorBehavior::kAllow);
3841
+ ConstructorBehavior behavior = ConstructorBehavior::kAllow,
3842
+ SideEffectType side_effect_type = SideEffectType::kHasSideEffect);
3837
3843
static V8_DEPRECATE_SOON (
3838
3844
" Use maybe version" ,
3839
3845
Local<Function> New (Isolate* isolate, FunctionCallback callback,
@@ -4271,13 +4277,6 @@ class V8_EXPORT ArrayBuffer : public Object {
4271
4277
*/
4272
4278
virtual void * AllocateUninitialized (size_t length) = 0;
4273
4279
4274
- /* *
4275
- * Reserved |length| bytes, but do not commit the memory. Must call
4276
- * |SetProtection| to make memory accessible.
4277
- */
4278
- // TODO(eholk): make this pure virtual once blink implements this.
4279
- virtual void * Reserve (size_t length);
4280
-
4281
4280
/* *
4282
4281
* Free the memory block of size |length|, pointed to by |data|.
4283
4282
* That memory is guaranteed to be previously allocated by |Allocate|.
@@ -4286,27 +4285,6 @@ class V8_EXPORT ArrayBuffer : public Object {
4286
4285
4287
4286
enum class AllocationMode { kNormal , kReservation };
4288
4287
4289
- /* *
4290
- * Free the memory block of size |length|, pointed to by |data|.
4291
- * That memory is guaranteed to be previously allocated by |Allocate| or
4292
- * |Reserve|, depending on |mode|.
4293
- */
4294
- // TODO(eholk): make this pure virtual once blink implements this.
4295
- virtual void Free (void * data, size_t length, AllocationMode mode);
4296
-
4297
- enum class Protection { kNoAccess , kReadWrite };
4298
-
4299
- /* *
4300
- * Change the protection on a region of memory.
4301
- *
4302
- * On platforms that make a distinction between reserving and committing
4303
- * memory, changing the protection to kReadWrite must also ensure the memory
4304
- * is committed.
4305
- */
4306
- // TODO(eholk): make this pure virtual once blink implements this.
4307
- virtual void SetProtection (void * data, size_t length,
4308
- Protection protection);
4309
-
4310
4288
/* *
4311
4289
* malloc/free based convenience allocator.
4312
4290
*
@@ -5496,7 +5474,8 @@ class V8_EXPORT FunctionTemplate : public Template {
5496
5474
Isolate* isolate, FunctionCallback callback = 0 ,
5497
5475
Local<Value> data = Local<Value>(),
5498
5476
Local<Signature> signature = Local<Signature>(), int length = 0,
5499
- ConstructorBehavior behavior = ConstructorBehavior::kAllow);
5477
+ ConstructorBehavior behavior = ConstructorBehavior::kAllow,
5478
+ SideEffectType side_effect_type = SideEffectType::kHasSideEffect);
5500
5479
5501
5480
/* * Get a template included in the snapshot by index. */
5502
5481
static MaybeLocal<FunctionTemplate> FromSnapshot (Isolate* isolate,
@@ -5508,7 +5487,8 @@ class V8_EXPORT FunctionTemplate : public Template {
5508
5487
static Local<FunctionTemplate> NewWithCache (
5509
5488
Isolate* isolate, FunctionCallback callback,
5510
5489
Local<Private> cache_property, Local<Value> data = Local<Value>(),
5511
- Local<Signature> signature = Local<Signature>(), int length = 0);
5490
+ Local<Signature> signature = Local<Signature>(), int length = 0,
5491
+ SideEffectType side_effect_type = SideEffectType::kHasSideEffect);
5512
5492
5513
5493
/* * Returns the unique function instance in the current execution context.*/
5514
5494
V8_DEPRECATE_SOON (" Use maybe version" , Local<Function> GetFunction ());
@@ -5529,8 +5509,9 @@ class V8_EXPORT FunctionTemplate : public Template {
5529
5509
* callback is called whenever the function created from this
5530
5510
* FunctionTemplate is called.
5531
5511
*/
5532
- void SetCallHandler (FunctionCallback callback,
5533
- Local<Value> data = Local<Value>());
5512
+ void SetCallHandler (
5513
+ FunctionCallback callback, Local<Value> data = Local<Value>(),
5514
+ SideEffectType side_effect_type = SideEffectType::kHasSideEffect);
5534
5515
5535
5516
/* * Set the predefined length property for the FunctionTemplate. */
5536
5517
void SetLength (int length);
@@ -5828,7 +5809,7 @@ class V8_EXPORT ObjectTemplate : public Template {
5828
5809
* \param data A piece of data that will be passed to the callbacks
5829
5810
* whenever they are invoked.
5830
5811
*/
5831
- V8_DEPRECATE_SOON (
5812
+ V8_DEPRECATED (
5832
5813
" Use SetHandler(const NamedPropertyHandlerConfiguration) "
5833
5814
" with the kOnlyInterceptStrings flag set." ,
5834
5815
void SetNamedPropertyHandler (
@@ -6586,8 +6567,11 @@ struct JitCodeEvent {
6586
6567
// statement, and is used to indicate possible break locations.
6587
6568
enum PositionType { POSITION, STATEMENT_POSITION };
6588
6569
6570
+ enum CodeType { BYTE_CODE, JIT_CODE };
6571
+
6589
6572
// Type of event.
6590
6573
EventType type;
6574
+ CodeType code_type;
6591
6575
// Start of the instructions.
6592
6576
void * code_start;
6593
6577
// Size of the instructions.
@@ -8025,7 +8009,8 @@ class V8_EXPORT V8 {
8025
8009
* Enable the default signal handler rather than using one provided by the
8026
8010
* embedder.
8027
8011
*/
8028
- static bool RegisterDefaultSignalHandler ();
8012
+ V8_DEPRECATE_SOON (" Use EnableWebAssemblyTrapHandler" ,
8013
+ static bool RegisterDefaultSignalHandler ());
8029
8014
8030
8015
private:
8031
8016
V8 ();
0 commit comments