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 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
264 // Whitelist for intrinsics amd runtime functions. | 264 // Whitelist for intrinsics amd runtime functions. |
265 // Conversions. | 265 // Conversions. |
266 case Runtime::kToInteger: | 266 case Runtime::kToInteger: |
267 case Runtime::kInlineToInteger: | 267 case Runtime::kInlineToInteger: |
268 case Runtime::kToObject: | 268 case Runtime::kToObject: |
269 case Runtime::kInlineToObject: | 269 case Runtime::kInlineToObject: |
270 case Runtime::kToString: | 270 case Runtime::kToString: |
271 case Runtime::kInlineToString: | 271 case Runtime::kInlineToString: |
272 case Runtime::kToLength: | 272 case Runtime::kToLength: |
273 case Runtime::kInlineToLength: | 273 case Runtime::kInlineToLength: |
274 // Type checks. | |
275 case Runtime::kIsJSReceiver: | |
276 case Runtime::kInlineIsJSReceiver: | |
277 case Runtime::kIsSmi: | |
278 case Runtime::kInlineIsSmi: | |
279 case Runtime::kIsArray: | |
280 case Runtime::kIsFunction: | |
281 case Runtime::kIsDate: | |
282 case Runtime::kIsJSProxy: | |
283 case Runtime::kIsRegExp: | |
284 case Runtime::kIsTypedArray: | |
274 // Loads. | 285 // Loads. |
275 case Runtime::kLoadLookupSlotForCall: | 286 case Runtime::kLoadLookupSlotForCall: |
276 // Errors. | 287 // Errors. |
288 case Runtime::kReThrow: | |
277 case Runtime::kThrowReferenceError: | 289 case Runtime::kThrowReferenceError: |
290 case Runtime::kThrowSymbolIteratorInvalid: | |
291 case Runtime::kThrowIteratorResultNotAnObject: | |
292 case Runtime::kNewTypeError: | |
278 // Strings. | 293 // Strings. |
279 case Runtime::kInlineStringCharCodeAt: | 294 case Runtime::kInlineStringCharCodeAt: |
280 case Runtime::kStringCharCodeAt: | 295 case Runtime::kStringCharCodeAt: |
281 case Runtime::kStringIndexOf: | 296 case Runtime::kStringIndexOf: |
282 case Runtime::kStringReplaceOneCharWithString: | 297 case Runtime::kStringReplaceOneCharWithString: |
283 case Runtime::kSubString: | 298 case Runtime::kSubString: |
284 case Runtime::kInlineSubString: | 299 case Runtime::kInlineSubString: |
285 case Runtime::kStringToLowerCase: | 300 case Runtime::kStringToLowerCase: |
286 case Runtime::kStringToUpperCase: | 301 case Runtime::kStringToUpperCase: |
287 case Runtime::kRegExpInternalReplace: | 302 case Runtime::kRegExpInternalReplace: |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
345 // Contexts. | 360 // Contexts. |
346 case Bytecode::kCreateBlockContext: | 361 case Bytecode::kCreateBlockContext: |
347 case Bytecode::kCreateCatchContext: | 362 case Bytecode::kCreateCatchContext: |
348 case Bytecode::kCreateFunctionContext: | 363 case Bytecode::kCreateFunctionContext: |
349 case Bytecode::kCreateEvalContext: | 364 case Bytecode::kCreateEvalContext: |
350 case Bytecode::kCreateWithContext: | 365 case Bytecode::kCreateWithContext: |
351 // Literals. | 366 // Literals. |
352 case Bytecode::kCreateArrayLiteral: | 367 case Bytecode::kCreateArrayLiteral: |
353 case Bytecode::kCreateObjectLiteral: | 368 case Bytecode::kCreateObjectLiteral: |
354 case Bytecode::kCreateRegExpLiteral: | 369 case Bytecode::kCreateRegExpLiteral: |
370 // Allocations. | |
371 case Bytecode::kCreateClosure: | |
372 case Bytecode::kCreateUnmappedArguments: | |
373 // Conversions. | |
374 case Bytecode::kToObject: | |
355 // Misc. | 375 // Misc. |
356 case Bytecode::kCreateUnmappedArguments: | 376 case Bytecode::kForInPrepare: |
jgruber
2017/02/09 10:47:45
There's also a corresponding runtime function you
Yang
2017/02/09 11:23:00
Done.
| |
377 case Bytecode::kForInNext: | |
378 case Bytecode::kForInStep: | |
357 case Bytecode::kThrow: | 379 case Bytecode::kThrow: |
380 case Bytecode::kReThrow: | |
358 case Bytecode::kIllegal: | 381 case Bytecode::kIllegal: |
359 case Bytecode::kCallJSRuntime: | 382 case Bytecode::kCallJSRuntime: |
360 case Bytecode::kStackCheck: | 383 case Bytecode::kStackCheck: |
361 case Bytecode::kReturn: | 384 case Bytecode::kReturn: |
362 case Bytecode::kSetPendingMessage: | 385 case Bytecode::kSetPendingMessage: |
363 return true; | 386 return true; |
364 default: | 387 default: |
365 if (FLAG_trace_side_effect_free_debug_evaluate) { | 388 if (FLAG_trace_side_effect_free_debug_evaluate) { |
366 PrintF("[debug-evaluate] bytecode %s may cause side effect.\n", | 389 PrintF("[debug-evaluate] bytecode %s may cause side effect.\n", |
367 Bytecodes::ToString(bytecode)); | 390 Bytecodes::ToString(bytecode)); |
368 } | 391 } |
369 return false; | 392 return false; |
370 } | 393 } |
371 } | 394 } |
372 | 395 |
373 bool BuiltinHasNoSideEffect(Builtins::Name id) { | 396 bool BuiltinHasNoSideEffect(Builtins::Name id) { |
374 switch (id) { | 397 switch (id) { |
375 // Whitelist for builtins. | 398 // Whitelist for builtins. |
399 // Array builtins. | |
400 case Builtins::kArrayPrototypeValues: | |
376 // Math builtins. | 401 // Math builtins. |
377 case Builtins::kMathAbs: | 402 case Builtins::kMathAbs: |
378 case Builtins::kMathAcos: | 403 case Builtins::kMathAcos: |
379 case Builtins::kMathAcosh: | 404 case Builtins::kMathAcosh: |
380 case Builtins::kMathAsin: | 405 case Builtins::kMathAsin: |
381 case Builtins::kMathAsinh: | 406 case Builtins::kMathAsinh: |
382 case Builtins::kMathAtan: | 407 case Builtins::kMathAtan: |
383 case Builtins::kMathAtanh: | 408 case Builtins::kMathAtanh: |
384 case Builtins::kMathAtan2: | 409 case Builtins::kMathAtan2: |
385 case Builtins::kMathCeil: | 410 case Builtins::kMathCeil: |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
512 | 537 |
513 if (FLAG_trace_side_effect_free_debug_evaluate) { | 538 if (FLAG_trace_side_effect_free_debug_evaluate) { |
514 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", |
515 reinterpret_cast<void*>(function_addr)); | 540 reinterpret_cast<void*>(function_addr)); |
516 } | 541 } |
517 return false; | 542 return false; |
518 } | 543 } |
519 | 544 |
520 } // namespace internal | 545 } // namespace internal |
521 } // namespace v8 | 546 } // namespace v8 |
OLD | NEW |