| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/v8.h" | 5 #include "src/v8.h" |
| 6 #include "test/cctest/cctest.h" | 6 #include "test/cctest/cctest.h" |
| 7 | 7 |
| 8 #include "src/compiler/code-generator.h" | 8 #include "src/compiler/code-generator.h" |
| 9 #include "src/compiler/common-operator.h" | 9 #include "src/compiler/common-operator.h" |
| 10 #include "src/compiler/graph.h" | 10 #include "src/compiler/graph.h" |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 | 113 |
| 114 Schedule* BuildGraphAndSchedule(Graph* graph) { | 114 Schedule* BuildGraphAndSchedule(Graph* graph) { |
| 115 Isolate* isolate = info.isolate(); | 115 Isolate* isolate = info.isolate(); |
| 116 CommonOperatorBuilder common(zone()); | 116 CommonOperatorBuilder common(zone()); |
| 117 | 117 |
| 118 // Manually construct a schedule for the function below: | 118 // Manually construct a schedule for the function below: |
| 119 // function foo() { | 119 // function foo() { |
| 120 // deopt(); | 120 // deopt(); |
| 121 // } | 121 // } |
| 122 | 122 |
| 123 MachineType parameter_reps[] = {kMachineTagged}; | 123 MachineType parameter_reps[] = {kMachAnyTagged}; |
| 124 MachineCallDescriptorBuilder descriptor_builder(kMachineTagged, 1, | 124 MachineCallDescriptorBuilder descriptor_builder(kMachAnyTagged, 1, |
| 125 parameter_reps); | 125 parameter_reps); |
| 126 | 126 |
| 127 RawMachineAssembler m(graph, &descriptor_builder); | 127 RawMachineAssembler m(graph, &descriptor_builder); |
| 128 | 128 |
| 129 Handle<Object> undef_object = | 129 Handle<Object> undef_object = |
| 130 Handle<Object>(isolate->heap()->undefined_value(), isolate); | 130 Handle<Object>(isolate->heap()->undefined_value(), isolate); |
| 131 PrintableUnique<Object> undef_constant = | 131 PrintableUnique<Object> undef_constant = |
| 132 PrintableUnique<Object>::CreateUninitialized(zone(), undef_object); | 132 PrintableUnique<Object>::CreateUninitialized(zone(), undef_object); |
| 133 Node* undef_node = m.NewNode(common.HeapConstant(undef_constant)); | 133 Node* undef_node = m.NewNode(common.HeapConstant(undef_constant)); |
| 134 | 134 |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 | 249 |
| 250 Schedule* BuildGraphAndSchedule(Graph* graph) { | 250 Schedule* BuildGraphAndSchedule(Graph* graph) { |
| 251 Isolate* isolate = info.isolate(); | 251 Isolate* isolate = info.isolate(); |
| 252 CommonOperatorBuilder common(zone()); | 252 CommonOperatorBuilder common(zone()); |
| 253 | 253 |
| 254 // Manually construct a schedule for the function below: | 254 // Manually construct a schedule for the function below: |
| 255 // function foo() { | 255 // function foo() { |
| 256 // %DeoptimizeFunction(foo); | 256 // %DeoptimizeFunction(foo); |
| 257 // } | 257 // } |
| 258 | 258 |
| 259 MachineType parameter_reps[] = {kMachineTagged}; | 259 MachineType parameter_reps[] = {kMachAnyTagged}; |
| 260 MachineCallDescriptorBuilder descriptor_builder(kMachineTagged, 2, | 260 MachineCallDescriptorBuilder descriptor_builder(kMachAnyTagged, 2, |
| 261 parameter_reps); | 261 parameter_reps); |
| 262 | 262 |
| 263 RawMachineAssembler m(graph, &descriptor_builder); | 263 RawMachineAssembler m(graph, &descriptor_builder); |
| 264 | 264 |
| 265 Handle<Object> undef_object = | 265 Handle<Object> undef_object = |
| 266 Handle<Object>(isolate->heap()->undefined_value(), isolate); | 266 Handle<Object>(isolate->heap()->undefined_value(), isolate); |
| 267 PrintableUnique<Object> undef_constant = | 267 PrintableUnique<Object> undef_constant = |
| 268 PrintableUnique<Object>::CreateUninitialized(zone(), undef_object); | 268 PrintableUnique<Object>::CreateUninitialized(zone(), undef_object); |
| 269 Node* undef_node = m.NewNode(common.HeapConstant(undef_constant)); | 269 Node* undef_node = m.NewNode(common.HeapConstant(undef_constant)); |
| 270 | 270 |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 Handle<Object> result; | 335 Handle<Object> result; |
| 336 bool has_pending_exception = | 336 bool has_pending_exception = |
| 337 !Execution::Call(isolate, t.function, | 337 !Execution::Call(isolate, t.function, |
| 338 isolate->factory()->undefined_value(), 0, NULL, | 338 isolate->factory()->undefined_value(), 0, NULL, |
| 339 false).ToHandle(&result); | 339 false).ToHandle(&result); |
| 340 CHECK(!has_pending_exception); | 340 CHECK(!has_pending_exception); |
| 341 CHECK(result->SameValue(Smi::FromInt(42))); | 341 CHECK(result->SameValue(Smi::FromInt(42))); |
| 342 } | 342 } |
| 343 | 343 |
| 344 #endif | 344 #endif |
| OLD | NEW |