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/base/utils/random-number-generator.h" | 5 #include "src/base/utils/random-number-generator.h" |
6 #include "src/builtins/builtins-promise.h" | 6 #include "src/builtins/builtins-promise.h" |
7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
8 #include "src/code-stub-assembler.h" | 8 #include "src/code-stub-assembler.h" |
9 #include "src/compiler/node.h" | 9 #include "src/compiler/node.h" |
10 #include "src/isolate.h" | 10 #include "src/isolate.h" |
(...skipping 1561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1572 m.Branch(m.IsDebugActive(), &if_active, &if_not_active); | 1572 m.Branch(m.IsDebugActive(), &if_active, &if_not_active); |
1573 m.Bind(&if_active); | 1573 m.Bind(&if_active); |
1574 m.Return(m.TrueConstant()); | 1574 m.Return(m.TrueConstant()); |
1575 m.Bind(&if_not_active); | 1575 m.Bind(&if_not_active); |
1576 m.Return(m.FalseConstant()); | 1576 m.Return(m.FalseConstant()); |
1577 | 1577 |
1578 Handle<Code> code = data.GenerateCode(); | 1578 Handle<Code> code = data.GenerateCode(); |
1579 CHECK(!code.is_null()); | 1579 CHECK(!code.is_null()); |
1580 | 1580 |
1581 FunctionTester ft(code, kNumParams); | 1581 FunctionTester ft(code, kNumParams); |
1582 CHECK_EQ(false, isolate->debug()->is_active()); | 1582 CHECK(!isolate->debug()->is_active()); |
1583 Handle<Object> result = | 1583 Handle<Object> result = |
1584 ft.Call(isolate->factory()->undefined_value()).ToHandleChecked(); | 1584 ft.Call(isolate->factory()->undefined_value()).ToHandleChecked(); |
1585 CHECK_EQ(isolate->heap()->false_value(), *result); | 1585 CHECK_EQ(isolate->heap()->false_value(), *result); |
1586 | 1586 |
1587 bool* debug_is_active = reinterpret_cast<bool*>( | 1587 bool* debug_is_active = reinterpret_cast<bool*>( |
1588 ExternalReference::debug_is_active_address(isolate).address()); | 1588 ExternalReference::debug_is_active_address(isolate).address()); |
1589 | 1589 |
1590 // Cheat to enable debug (TODO: do this properly). | 1590 // Cheat to enable debug (TODO: do this properly). |
1591 *debug_is_active = true; | 1591 *debug_is_active = true; |
1592 | 1592 |
(...skipping 862 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2455 m.Return(m.SmiConstant(0)); | 2455 m.Return(m.SmiConstant(0)); |
2456 | 2456 |
2457 Handle<Code> code = data.GenerateCode(); | 2457 Handle<Code> code = data.GenerateCode(); |
2458 CHECK(!code.is_null()); | 2458 CHECK(!code.is_null()); |
2459 FunctionTester ft(code, kNumParams); | 2459 FunctionTester ft(code, kNumParams); |
2460 CHECK_EQ(1, Handle<Smi>::cast(ft.Call().ToHandleChecked())->value()); | 2460 CHECK_EQ(1, Handle<Smi>::cast(ft.Call().ToHandleChecked())->value()); |
2461 } | 2461 } |
2462 | 2462 |
2463 } // namespace internal | 2463 } // namespace internal |
2464 } // namespace v8 | 2464 } // namespace v8 |
OLD | NEW |