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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 virtual ~DeoptCodegenTester() { delete code; } | 58 virtual ~DeoptCodegenTester() { delete code; } |
59 | 59 |
60 void GenerateCodeFromSchedule(Schedule* schedule) { | 60 void GenerateCodeFromSchedule(Schedule* schedule) { |
61 OFStream os(stdout); | 61 OFStream os(stdout); |
62 if (FLAG_trace_turbo) { | 62 if (FLAG_trace_turbo) { |
63 os << *schedule; | 63 os << *schedule; |
64 } | 64 } |
65 | 65 |
66 // Initialize the codegen and generate code. | 66 // Initialize the codegen and generate code. |
67 Linkage* linkage = new (scope_->main_zone()) Linkage(info.zone(), &info); | 67 Linkage* linkage = new (scope_->main_zone()) Linkage(info.zone(), &info); |
| 68 InstructionBlocks* instruction_blocks = |
| 69 InstructionSequence::InstructionBlocksFor(scope_->main_zone(), |
| 70 schedule); |
68 code = new v8::internal::compiler::InstructionSequence(scope_->main_zone(), | 71 code = new v8::internal::compiler::InstructionSequence(scope_->main_zone(), |
69 schedule); | 72 instruction_blocks); |
70 SourcePositionTable source_positions(graph); | 73 SourcePositionTable source_positions(graph); |
71 InstructionSelector selector(scope_->main_zone(), graph, linkage, code, | 74 InstructionSelector selector(scope_->main_zone(), graph, linkage, code, |
72 schedule, &source_positions); | 75 schedule, &source_positions); |
73 selector.SelectInstructions(); | 76 selector.SelectInstructions(); |
74 | 77 |
75 if (FLAG_trace_turbo) { | 78 if (FLAG_trace_turbo) { |
76 os << "----- Instruction sequence before register allocation -----\n" | 79 os << "----- Instruction sequence before register allocation -----\n" |
77 << *code; | 80 << *code; |
78 } | 81 } |
79 | 82 |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 Handle<Object> result; | 312 Handle<Object> result; |
310 bool has_pending_exception = | 313 bool has_pending_exception = |
311 !Execution::Call(isolate, t.function, | 314 !Execution::Call(isolate, t.function, |
312 isolate->factory()->undefined_value(), 0, NULL, | 315 isolate->factory()->undefined_value(), 0, NULL, |
313 false).ToHandle(&result); | 316 false).ToHandle(&result); |
314 CHECK(!has_pending_exception); | 317 CHECK(!has_pending_exception); |
315 CHECK(result->SameValue(Smi::FromInt(42))); | 318 CHECK(result->SameValue(Smi::FromInt(42))); |
316 } | 319 } |
317 | 320 |
318 #endif | 321 #endif |
OLD | NEW |