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

Unified Diff: src/compiler/code-generator.cc

Issue 2188533002: [turbofan] Generate loop exits in the bytecode graph builder. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address review comments Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/bytecode-loop-analysis.cc ('k') | src/v8.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/code-generator.cc
diff --git a/src/compiler/code-generator.cc b/src/compiler/code-generator.cc
index acda1d2c5a0237e707585dd44b873e24673bf9be..e73016e62fd9cddbc989d3a4fb553b4ecacda9ef 100644
--- a/src/compiler/code-generator.cc
+++ b/src/compiler/code-generator.cc
@@ -864,14 +864,20 @@ void CodeGenerator::AddTranslationForOperand(Translation* translation,
Handle<Object> constant_object;
switch (constant.type()) {
case Constant::kInt32:
- DCHECK(type == MachineType::Int32() || type == MachineType::Uint32() ||
- type.representation() == MachineRepresentation::kBit ||
- type.representation() == MachineRepresentation::kNone);
- DCHECK(type.representation() != MachineRepresentation::kNone ||
- constant.ToInt32() == FrameStateDescriptor::kImpossibleValue);
-
- constant_object =
- isolate()->factory()->NewNumberFromInt(constant.ToInt32());
+ if (type.representation() == MachineRepresentation::kTagged) {
Benedikt Meurer 2016/08/01 17:33:44 As discussed offline, this should only ever happen
+ constant_object =
+ handle(reinterpret_cast<Smi*>(constant.ToInt32()), isolate());
+ } else {
+ DCHECK(type == MachineType::Int32() ||
+ type == MachineType::Uint32() ||
+ type.representation() == MachineRepresentation::kBit ||
+ type.representation() == MachineRepresentation::kNone);
+ DCHECK(type.representation() != MachineRepresentation::kNone ||
+ constant.ToInt32() == FrameStateDescriptor::kImpossibleValue);
+
+ constant_object =
+ isolate()->factory()->NewNumberFromInt(constant.ToInt32());
+ }
break;
case Constant::kFloat32:
DCHECK(type.representation() == MachineRepresentation::kFloat32 ||
« no previous file with comments | « src/compiler/bytecode-loop-analysis.cc ('k') | src/v8.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698