Chromium Code Reviews

Side by Side Diff: src/compiler/ia32/instruction-selector-ia32.cc

Issue 1158563008: [turbofan] Introduce prediction for exception handlers. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
OLDNEW
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/base/adapters.h" 5 #include "src/base/adapters.h"
6 #include "src/compiler/instruction-selector-impl.h" 6 #include "src/compiler/instruction-selector-impl.h"
7 #include "src/compiler/node-matchers.h" 7 #include "src/compiler/node-matchers.h"
8 #include "src/compiler/node-properties.h" 8 #include "src/compiler/node-properties.h"
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 825 matching lines...)
836 InstructionOperand value = 836 InstructionOperand value =
837 g.CanBeImmediate(node) 837 g.CanBeImmediate(node)
838 ? g.UseImmediate(node) 838 ? g.UseImmediate(node)
839 : IsSupported(ATOM) ? g.UseRegister(node) : g.Use(node); 839 : IsSupported(ATOM) ? g.UseRegister(node) : g.Use(node);
840 Emit(kIA32Push, g.NoOutput(), value); 840 Emit(kIA32Push, g.NoOutput(), value);
841 } 841 }
842 842
843 // Pass label of exception handler block. 843 // Pass label of exception handler block.
844 CallDescriptor::Flags flags = descriptor->flags(); 844 CallDescriptor::Flags flags = descriptor->flags();
845 if (handler) { 845 if (handler) {
846 DCHECK_EQ(IrOpcode::kIfException, handler->front()->opcode());
847 bool caught_locally = OpParameter<bool>(handler->front());
848 if (caught_locally) flags |= CallDescriptor::kHasLocalCatchHandler;
846 flags |= CallDescriptor::kHasExceptionHandler; 849 flags |= CallDescriptor::kHasExceptionHandler;
847 buffer.instruction_args.push_back(g.Label(handler)); 850 buffer.instruction_args.push_back(g.Label(handler));
848 } 851 }
849 852
850 // Select the appropriate opcode based on the call type. 853 // Select the appropriate opcode based on the call type.
851 InstructionCode opcode; 854 InstructionCode opcode;
852 switch (descriptor->kind()) { 855 switch (descriptor->kind()) {
853 case CallDescriptor::kCallCodeObject: { 856 case CallDescriptor::kCallCodeObject: {
854 opcode = kArchCallCodeObject; 857 opcode = kArchCallCodeObject;
855 break; 858 break;
(...skipping 458 matching lines...)
1314 if (CpuFeatures::IsSupported(SSE4_1)) { 1317 if (CpuFeatures::IsSupported(SSE4_1)) {
1315 flags |= MachineOperatorBuilder::kFloat64RoundDown | 1318 flags |= MachineOperatorBuilder::kFloat64RoundDown |
1316 MachineOperatorBuilder::kFloat64RoundTruncate; 1319 MachineOperatorBuilder::kFloat64RoundTruncate;
1317 } 1320 }
1318 return flags; 1321 return flags;
1319 } 1322 }
1320 1323
1321 } // namespace compiler 1324 } // namespace compiler
1322 } // namespace internal 1325 } // namespace internal
1323 } // namespace v8 1326 } // namespace v8
OLDNEW

Powered by Google App Engine