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/interface-descriptors.h" | 6 #include "src/interface-descriptors.h" |
7 #include "src/isolate.h" | 7 #include "src/isolate.h" |
8 #include "test/cctest/compiler/function-tester.h" | 8 #include "test/cctest/compiler/function-tester.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 1072 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1083 m.Bind(&loop); | 1083 m.Bind(&loop); |
1084 { | 1084 { |
1085 Node* map = m.LoadMap(var_object.value()); | 1085 Node* map = m.LoadMap(var_object.value()); |
1086 var_object.Bind(map); | 1086 var_object.Bind(map); |
1087 m.Goto(&loop); | 1087 m.Goto(&loop); |
1088 } | 1088 } |
1089 } | 1089 } |
1090 CHECK(!m.GenerateCode().is_null()); | 1090 CHECK(!m.GenerateCode().is_null()); |
1091 } | 1091 } |
1092 | 1092 |
| 1093 TEST(TestOutOfScopeVariable) { |
| 1094 typedef CodeStubAssembler::Label Label; |
| 1095 typedef CodeStubAssembler::Variable Variable; |
| 1096 Isolate* isolate(CcTest::InitIsolateOnce()); |
| 1097 VoidDescriptor descriptor(isolate); |
| 1098 CodeStubAssemblerTester m(isolate, descriptor); |
| 1099 Label block1(&m); |
| 1100 Label block2(&m); |
| 1101 Label block3(&m); |
| 1102 Label block4(&m); |
| 1103 m.Branch(m.WordEqual(m.Parameter(0), m.IntPtrConstant(0)), &block1, &block4); |
| 1104 m.Bind(&block4); |
| 1105 { |
| 1106 Variable var_object(&m, MachineRepresentation::kTagged); |
| 1107 m.Branch(m.WordEqual(m.Parameter(0), m.IntPtrConstant(0)), &block2, |
| 1108 &block3); |
| 1109 |
| 1110 m.Bind(&block2); |
| 1111 var_object.Bind(m.IntPtrConstant(55)); |
| 1112 m.Goto(&block1); |
| 1113 |
| 1114 m.Bind(&block3); |
| 1115 var_object.Bind(m.IntPtrConstant(66)); |
| 1116 m.Goto(&block1); |
| 1117 } |
| 1118 m.Bind(&block1); |
| 1119 CHECK(!m.GenerateCode().is_null()); |
| 1120 } |
| 1121 |
1093 } // namespace internal | 1122 } // namespace internal |
1094 } // namespace v8 | 1123 } // namespace v8 |
OLD | NEW |