| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/debug/debug-evaluate.h" | 5 #include "src/debug/debug-evaluate.h" |
| 6 | 6 |
| 7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
| 8 #include "src/compiler.h" | 8 #include "src/compiler.h" |
| 9 #include "src/contexts.h" | 9 #include "src/contexts.h" |
| 10 #include "src/debug/debug-frames.h" | 10 #include "src/debug/debug-frames.h" |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 // Whitelist for intrinsics amd runtime functions. | 262 // Whitelist for intrinsics amd runtime functions. |
| 263 // Conversions. | 263 // Conversions. |
| 264 case Runtime::kToInteger: | 264 case Runtime::kToInteger: |
| 265 case Runtime::kInlineToInteger: | 265 case Runtime::kInlineToInteger: |
| 266 case Runtime::kToObject: | 266 case Runtime::kToObject: |
| 267 case Runtime::kInlineToObject: | 267 case Runtime::kInlineToObject: |
| 268 case Runtime::kToString: | 268 case Runtime::kToString: |
| 269 case Runtime::kInlineToString: | 269 case Runtime::kInlineToString: |
| 270 case Runtime::kToLength: | 270 case Runtime::kToLength: |
| 271 case Runtime::kInlineToLength: | 271 case Runtime::kInlineToLength: |
| 272 // Type checks. |
| 273 case Runtime::kIsJSReceiver: |
| 274 case Runtime::kInlineIsJSReceiver: |
| 275 case Runtime::kIsSmi: |
| 276 case Runtime::kInlineIsSmi: |
| 277 case Runtime::kIsArray: |
| 278 case Runtime::kIsFunction: |
| 279 case Runtime::kIsDate: |
| 280 case Runtime::kIsJSProxy: |
| 281 case Runtime::kIsRegExp: |
| 282 case Runtime::kIsTypedArray: |
| 272 // Loads. | 283 // Loads. |
| 273 case Runtime::kLoadLookupSlotForCall: | 284 case Runtime::kLoadLookupSlotForCall: |
| 274 // Errors. | 285 // Errors. |
| 286 case Runtime::kReThrow: |
| 275 case Runtime::kThrowReferenceError: | 287 case Runtime::kThrowReferenceError: |
| 288 case Runtime::kThrowSymbolIteratorInvalid: |
| 289 case Runtime::kThrowIteratorResultNotAnObject: |
| 290 case Runtime::kNewTypeError: |
| 276 // Strings. | 291 // Strings. |
| 277 case Runtime::kInlineStringCharCodeAt: | 292 case Runtime::kInlineStringCharCodeAt: |
| 278 case Runtime::kStringCharCodeAt: | 293 case Runtime::kStringCharCodeAt: |
| 279 case Runtime::kStringIndexOf: | 294 case Runtime::kStringIndexOf: |
| 280 case Runtime::kStringReplaceOneCharWithString: | 295 case Runtime::kStringReplaceOneCharWithString: |
| 281 case Runtime::kSubString: | 296 case Runtime::kSubString: |
| 282 case Runtime::kInlineSubString: | 297 case Runtime::kInlineSubString: |
| 283 case Runtime::kStringToLowerCase: | 298 case Runtime::kStringToLowerCase: |
| 284 case Runtime::kStringToUpperCase: | 299 case Runtime::kStringToUpperCase: |
| 285 case Runtime::kRegExpInternalReplace: | 300 case Runtime::kRegExpInternalReplace: |
| 286 // Literals. | 301 // Literals. |
| 287 case Runtime::kCreateArrayLiteral: | 302 case Runtime::kCreateArrayLiteral: |
| 288 case Runtime::kCreateObjectLiteral: | 303 case Runtime::kCreateObjectLiteral: |
| 289 case Runtime::kCreateRegExpLiteral: | 304 case Runtime::kCreateRegExpLiteral: |
| 290 // Misc. | 305 // Misc. |
| 306 case Runtime::kForInPrepare: |
| 291 case Runtime::kInlineCall: | 307 case Runtime::kInlineCall: |
| 292 case Runtime::kCall: | 308 case Runtime::kCall: |
| 293 case Runtime::kInlineMaxSmi: | 309 case Runtime::kInlineMaxSmi: |
| 294 case Runtime::kMaxSmi: | 310 case Runtime::kMaxSmi: |
| 295 return true; | 311 return true; |
| 296 default: | 312 default: |
| 297 if (FLAG_trace_side_effect_free_debug_evaluate) { | 313 if (FLAG_trace_side_effect_free_debug_evaluate) { |
| 298 PrintF("[debug-evaluate] intrinsic %s may cause side effect.\n", | 314 PrintF("[debug-evaluate] intrinsic %s may cause side effect.\n", |
| 299 Runtime::FunctionForId(id)->name); | 315 Runtime::FunctionForId(id)->name); |
| 300 } | 316 } |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 // Contexts. | 359 // Contexts. |
| 344 case Bytecode::kCreateBlockContext: | 360 case Bytecode::kCreateBlockContext: |
| 345 case Bytecode::kCreateCatchContext: | 361 case Bytecode::kCreateCatchContext: |
| 346 case Bytecode::kCreateFunctionContext: | 362 case Bytecode::kCreateFunctionContext: |
| 347 case Bytecode::kCreateEvalContext: | 363 case Bytecode::kCreateEvalContext: |
| 348 case Bytecode::kCreateWithContext: | 364 case Bytecode::kCreateWithContext: |
| 349 // Literals. | 365 // Literals. |
| 350 case Bytecode::kCreateArrayLiteral: | 366 case Bytecode::kCreateArrayLiteral: |
| 351 case Bytecode::kCreateObjectLiteral: | 367 case Bytecode::kCreateObjectLiteral: |
| 352 case Bytecode::kCreateRegExpLiteral: | 368 case Bytecode::kCreateRegExpLiteral: |
| 369 // Allocations. |
| 370 case Bytecode::kCreateClosure: |
| 371 case Bytecode::kCreateUnmappedArguments: |
| 372 // Conversions. |
| 373 case Bytecode::kToObject: |
| 353 // Misc. | 374 // Misc. |
| 354 case Bytecode::kCreateUnmappedArguments: | 375 case Bytecode::kForInPrepare: |
| 376 case Bytecode::kForInContinue: |
| 377 case Bytecode::kForInNext: |
| 378 case Bytecode::kForInStep: |
| 355 case Bytecode::kThrow: | 379 case Bytecode::kThrow: |
| 380 case Bytecode::kReThrow: |
| 356 case Bytecode::kIllegal: | 381 case Bytecode::kIllegal: |
| 357 case Bytecode::kCallJSRuntime: | 382 case Bytecode::kCallJSRuntime: |
| 358 case Bytecode::kStackCheck: | 383 case Bytecode::kStackCheck: |
| 359 case Bytecode::kReturn: | 384 case Bytecode::kReturn: |
| 360 case Bytecode::kSetPendingMessage: | 385 case Bytecode::kSetPendingMessage: |
| 361 return true; | 386 return true; |
| 362 default: | 387 default: |
| 363 if (FLAG_trace_side_effect_free_debug_evaluate) { | 388 if (FLAG_trace_side_effect_free_debug_evaluate) { |
| 364 PrintF("[debug-evaluate] bytecode %s may cause side effect.\n", | 389 PrintF("[debug-evaluate] bytecode %s may cause side effect.\n", |
| 365 Bytecodes::ToString(bytecode)); | 390 Bytecodes::ToString(bytecode)); |
| 366 } | 391 } |
| 367 return false; | 392 return false; |
| 368 } | 393 } |
| 369 } | 394 } |
| 370 | 395 |
| 371 bool BuiltinHasNoSideEffect(Builtins::Name id) { | 396 bool BuiltinHasNoSideEffect(Builtins::Name id) { |
| 372 switch (id) { | 397 switch (id) { |
| 373 // Whitelist for builtins. | 398 // Whitelist for builtins. |
| 399 // Array builtins. |
| 400 case Builtins::kArrayPrototypeValues: |
| 374 // Math builtins. | 401 // Math builtins. |
| 375 case Builtins::kMathAbs: | 402 case Builtins::kMathAbs: |
| 376 case Builtins::kMathAcos: | 403 case Builtins::kMathAcos: |
| 377 case Builtins::kMathAcosh: | 404 case Builtins::kMathAcosh: |
| 378 case Builtins::kMathAsin: | 405 case Builtins::kMathAsin: |
| 379 case Builtins::kMathAsinh: | 406 case Builtins::kMathAsinh: |
| 380 case Builtins::kMathAtan: | 407 case Builtins::kMathAtan: |
| 381 case Builtins::kMathAtanh: | 408 case Builtins::kMathAtanh: |
| 382 case Builtins::kMathAtan2: | 409 case Builtins::kMathAtan2: |
| 383 case Builtins::kMathCeil: | 410 case Builtins::kMathCeil: |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 510 | 537 |
| 511 if (FLAG_trace_side_effect_free_debug_evaluate) { | 538 if (FLAG_trace_side_effect_free_debug_evaluate) { |
| 512 PrintF("[debug-evaluate] API Callback at %p may cause side effect.\n", | 539 PrintF("[debug-evaluate] API Callback at %p may cause side effect.\n", |
| 513 reinterpret_cast<void*>(function_addr)); | 540 reinterpret_cast<void*>(function_addr)); |
| 514 } | 541 } |
| 515 return false; | 542 return false; |
| 516 } | 543 } |
| 517 | 544 |
| 518 } // namespace internal | 545 } // namespace internal |
| 519 } // namespace v8 | 546 } // namespace v8 |
| OLD | NEW |