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 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 !frame_->receiver()->IsTheHole(isolate_)) { | 254 !frame_->receiver()->IsTheHole(isolate_)) { |
255 recv = handle(frame_->receiver(), isolate_); | 255 recv = handle(frame_->receiver(), isolate_); |
256 } | 256 } |
257 JSObject::SetOwnPropertyIgnoreAttributes(target, name, recv, NONE).Check(); | 257 JSObject::SetOwnPropertyIgnoreAttributes(target, name, recv, NONE).Check(); |
258 } | 258 } |
259 | 259 |
260 namespace { | 260 namespace { |
261 | 261 |
262 bool IntrinsicHasNoSideEffect(Runtime::FunctionId id) { | 262 bool IntrinsicHasNoSideEffect(Runtime::FunctionId id) { |
263 switch (id) { | 263 switch (id) { |
264 // Whitelist for intrinsics amd runtime functions. | 264 // Whitelist for intrinsics and 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 case Runtime::kToNumber: | 274 case Runtime::kToNumber: |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
398 PrintF("[debug-evaluate] bytecode %s may cause side effect.\n", | 398 PrintF("[debug-evaluate] bytecode %s may cause side effect.\n", |
399 Bytecodes::ToString(bytecode)); | 399 Bytecodes::ToString(bytecode)); |
400 } | 400 } |
401 return false; | 401 return false; |
402 } | 402 } |
403 } | 403 } |
404 | 404 |
405 bool BuiltinHasNoSideEffect(Builtins::Name id) { | 405 bool BuiltinHasNoSideEffect(Builtins::Name id) { |
406 switch (id) { | 406 switch (id) { |
407 // Whitelist for builtins. | 407 // Whitelist for builtins. |
| 408 // Object builtins. |
| 409 case Builtins::kObjectPrototypeValueOf: |
408 // Array builtins. | 410 // Array builtins. |
409 case Builtins::kArrayCode: | 411 case Builtins::kArrayCode: |
410 case Builtins::kArrayIndexOf: | 412 case Builtins::kArrayIndexOf: |
411 case Builtins::kArrayPrototypeValues: | 413 case Builtins::kArrayPrototypeValues: |
412 case Builtins::kArrayIncludes: | 414 case Builtins::kArrayIncludes: |
413 case Builtins::kArrayPrototypeEntries: | 415 case Builtins::kArrayPrototypeEntries: |
414 case Builtins::kArrayPrototypeKeys: | 416 case Builtins::kArrayPrototypeKeys: |
415 case Builtins::kArrayForEach: | 417 case Builtins::kArrayForEach: |
416 // Math builtins. | 418 // Math builtins. |
417 case Builtins::kMathAbs: | 419 case Builtins::kMathAbs: |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
565 | 567 |
566 if (FLAG_trace_side_effect_free_debug_evaluate) { | 568 if (FLAG_trace_side_effect_free_debug_evaluate) { |
567 PrintF("[debug-evaluate] API Callback at %p may cause side effect.\n", | 569 PrintF("[debug-evaluate] API Callback at %p may cause side effect.\n", |
568 reinterpret_cast<void*>(function_addr)); | 570 reinterpret_cast<void*>(function_addr)); |
569 } | 571 } |
570 return false; | 572 return false; |
571 } | 573 } |
572 | 574 |
573 } // namespace internal | 575 } // namespace internal |
574 } // namespace v8 | 576 } // namespace v8 |
OLD | NEW |