Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(52)

Side by Side Diff: src/compiler/simplified-lowering.cc

Issue 2236443004: [turbofan] Introduce a dedicated ConvertTaggedHoleToUndefined operator. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix verify heap. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/compiler/opcodes.h ('k') | src/compiler/simplified-operator.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/compiler/simplified-lowering.h" 5 #include "src/compiler/simplified-lowering.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "src/address-map.h" 9 #include "src/address-map.h"
10 #include "src/base/bits.h" 10 #include "src/base/bits.h"
(...skipping 2374 matching lines...) Expand 10 before | Expand all | Expand 10 after
2385 ProcessInput(node, 0, UseInfo::TruncatingFloat64()); 2385 ProcessInput(node, 0, UseInfo::TruncatingFloat64());
2386 ProcessRemainingInputs(node, 1); 2386 ProcessRemainingInputs(node, 1);
2387 SetOutput(node, MachineRepresentation::kFloat64); 2387 SetOutput(node, MachineRepresentation::kFloat64);
2388 if (truncation.IsUsedAsFloat64() && 2388 if (truncation.IsUsedAsFloat64() &&
2389 mode == CheckFloat64HoleMode::kAllowReturnHole) { 2389 mode == CheckFloat64HoleMode::kAllowReturnHole) {
2390 if (lower()) DeferReplacement(node, node->InputAt(0)); 2390 if (lower()) DeferReplacement(node, node->InputAt(0));
2391 } 2391 }
2392 return; 2392 return;
2393 } 2393 }
2394 case IrOpcode::kCheckTaggedHole: { 2394 case IrOpcode::kCheckTaggedHole: {
2395 CheckTaggedHoleMode mode = CheckTaggedHoleModeOf(node->op()); 2395 VisitUnop(node, UseInfo::AnyTagged(), MachineRepresentation::kTagged);
2396 if (truncation.IsUsedAsWord32() && 2396 return;
2397 mode == CheckTaggedHoleMode::kConvertHoleToUndefined) { 2397 }
2398 ProcessInput(node, 0, UseInfo::CheckedSigned32AsWord32()); 2398 case IrOpcode::kConvertTaggedHoleToUndefined: {
2399 ProcessRemainingInputs(node, 1); 2399 if (InputIs(node, Type::NumberOrOddball()) &&
2400 SetOutput(node, MachineRepresentation::kWord32); 2400 truncation.IsUsedAsWord32()) {
2401 // Propagate the Word32 truncation.
2402 VisitUnop(node, UseInfo::TruncatingWord32(),
2403 MachineRepresentation::kWord32);
2404 if (lower()) DeferReplacement(node, node->InputAt(0));
2405 } else if (InputIs(node, Type::NumberOrOddball()) &&
2406 truncation.IsUsedAsFloat64()) {
2407 // Propagate the Float64 truncation.
2408 VisitUnop(node, UseInfo::TruncatingFloat64(),
2409 MachineRepresentation::kFloat64);
2410 if (lower()) DeferReplacement(node, node->InputAt(0));
2411 } else if (InputIs(node, Type::NonInternal())) {
2412 VisitUnop(node, UseInfo::AnyTagged(), MachineRepresentation::kTagged);
2401 if (lower()) DeferReplacement(node, node->InputAt(0)); 2413 if (lower()) DeferReplacement(node, node->InputAt(0));
2402 } else { 2414 } else {
2403 ProcessInput(node, 0, UseInfo::AnyTagged()); 2415 // TODO(turbofan): Add a (Tagged) truncation that identifies hole
2404 ProcessRemainingInputs(node, 1); 2416 // and undefined, i.e. for a[i] === obj cases.
2405 SetOutput(node, MachineRepresentation::kTagged); 2417 VisitUnop(node, UseInfo::AnyTagged(), MachineRepresentation::kTagged);
2406 } 2418 }
2407 return; 2419 return;
2408 } 2420 }
2409 case IrOpcode::kCheckMaps: 2421 case IrOpcode::kCheckMaps:
2410 case IrOpcode::kTransitionElementsKind: { 2422 case IrOpcode::kTransitionElementsKind: {
2411 VisitInputs(node); 2423 VisitInputs(node);
2412 return SetOutput(node, MachineRepresentation::kNone); 2424 return SetOutput(node, MachineRepresentation::kNone);
2413 } 2425 }
2414 case IrOpcode::kEnsureWritableFastElements: 2426 case IrOpcode::kEnsureWritableFastElements:
2415 return VisitBinop(node, UseInfo::AnyTagged(), 2427 return VisitBinop(node, UseInfo::AnyTagged(),
(...skipping 928 matching lines...) Expand 10 before | Expand all | Expand 10 after
3344 isolate(), graph()->zone(), callable.descriptor(), 0, flags, 3356 isolate(), graph()->zone(), callable.descriptor(), 0, flags,
3345 Operator::kNoProperties); 3357 Operator::kNoProperties);
3346 to_number_operator_.set(common()->Call(desc)); 3358 to_number_operator_.set(common()->Call(desc));
3347 } 3359 }
3348 return to_number_operator_.get(); 3360 return to_number_operator_.get();
3349 } 3361 }
3350 3362
3351 } // namespace compiler 3363 } // namespace compiler
3352 } // namespace internal 3364 } // namespace internal
3353 } // namespace v8 3365 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/opcodes.h ('k') | src/compiler/simplified-operator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698