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

Side by Side Diff: src/compiler/js-builtin-reducer.cc

Issue 2381523002: [Turbofan] Introduce OtherNumberConstant. (Closed)
Patch Set: Better DCHECK in HeapConstantType(). Created 4 years, 2 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 | « no previous file | src/compiler/js-create-lowering.cc » ('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/js-builtin-reducer.h" 5 #include "src/compiler/js-builtin-reducer.h"
6 6
7 #include "src/compilation-dependencies.h" 7 #include "src/compilation-dependencies.h"
8 #include "src/compiler/access-builder.h" 8 #include "src/compiler/access-builder.h"
9 #include "src/compiler/js-graph.h" 9 #include "src/compiler/js-graph.h"
10 #include "src/compiler/node-matchers.h" 10 #include "src/compiler/node-matchers.h"
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 323
324 bool HasInstanceTypeWitness(Node* receiver, Node* effect, 324 bool HasInstanceTypeWitness(Node* receiver, Node* effect,
325 InstanceType instance_type) { 325 InstanceType instance_type) {
326 for (Node* dominator = effect;;) { 326 for (Node* dominator = effect;;) {
327 if (dominator->opcode() == IrOpcode::kCheckMaps && 327 if (dominator->opcode() == IrOpcode::kCheckMaps &&
328 dominator->InputAt(0) == receiver) { 328 dominator->InputAt(0) == receiver) {
329 // Check if all maps have the given {instance_type}. 329 // Check if all maps have the given {instance_type}.
330 for (int i = 1; i < dominator->op()->ValueInputCount(); ++i) { 330 for (int i = 1; i < dominator->op()->ValueInputCount(); ++i) {
331 Node* const map = NodeProperties::GetValueInput(dominator, i); 331 Node* const map = NodeProperties::GetValueInput(dominator, i);
332 Type* const map_type = NodeProperties::GetType(map); 332 Type* const map_type = NodeProperties::GetType(map);
333 if (!map_type->IsConstant()) return false; 333 if (!map_type->IsHeapConstant()) return false;
334 Handle<Map> const map_value = 334 Handle<Map> const map_value =
335 Handle<Map>::cast(map_type->AsConstant()->Value()); 335 Handle<Map>::cast(map_type->AsHeapConstant()->Value());
336 if (map_value->instance_type() != instance_type) return false; 336 if (map_value->instance_type() != instance_type) return false;
337 } 337 }
338 return true; 338 return true;
339 } 339 }
340 switch (dominator->opcode()) { 340 switch (dominator->opcode()) {
341 case IrOpcode::kStoreField: { 341 case IrOpcode::kStoreField: {
342 FieldAccess const& access = FieldAccessOf(dominator->op()); 342 FieldAccess const& access = FieldAccessOf(dominator->op());
343 if (access.base_is_tagged == kTaggedBase && 343 if (access.base_is_tagged == kTaggedBase &&
344 access.offset == HeapObject::kMapOffset) { 344 access.offset == HeapObject::kMapOffset) {
345 return false; 345 return false;
(...skipping 1043 matching lines...) Expand 10 before | Expand all | Expand 10 after
1389 return jsgraph()->simplified(); 1389 return jsgraph()->simplified();
1390 } 1390 }
1391 1391
1392 JSOperatorBuilder* JSBuiltinReducer::javascript() const { 1392 JSOperatorBuilder* JSBuiltinReducer::javascript() const {
1393 return jsgraph()->javascript(); 1393 return jsgraph()->javascript();
1394 } 1394 }
1395 1395
1396 } // namespace compiler 1396 } // namespace compiler
1397 } // namespace internal 1397 } // namespace internal
1398 } // namespace v8 1398 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/compiler/js-create-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698