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

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

Issue 1513543003: [turbofan] Make MachineType a pair of enums. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Moar rebase Created 5 years 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/c-linkage.cc ('k') | src/compiler/code-generator.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/change-lowering.h" 5 #include "src/compiler/change-lowering.h"
6 6
7 #include "src/address-map.h" 7 #include "src/address-map.h"
8 #include "src/code-factory.h" 8 #include "src/code-factory.h"
9 #include "src/compiler/js-graph.h" 9 #include "src/compiler/js-graph.h"
10 #include "src/compiler/linkage.h" 10 #include "src/compiler/linkage.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 Node* context = jsgraph()->NoContextConstant(); 80 Node* context = jsgraph()->NoContextConstant();
81 Node* effect = graph()->NewNode(common()->BeginRegion(), graph()->start()); 81 Node* effect = graph()->NewNode(common()->BeginRegion(), graph()->start());
82 if (!allocate_heap_number_operator_.is_set()) { 82 if (!allocate_heap_number_operator_.is_set()) {
83 CallDescriptor* descriptor = Linkage::GetStubCallDescriptor( 83 CallDescriptor* descriptor = Linkage::GetStubCallDescriptor(
84 isolate(), jsgraph()->zone(), callable.descriptor(), 0, 84 isolate(), jsgraph()->zone(), callable.descriptor(), 0,
85 CallDescriptor::kNoFlags, Operator::kNoThrow); 85 CallDescriptor::kNoFlags, Operator::kNoThrow);
86 allocate_heap_number_operator_.set(common()->Call(descriptor)); 86 allocate_heap_number_operator_.set(common()->Call(descriptor));
87 } 87 }
88 Node* heap_number = graph()->NewNode(allocate_heap_number_operator_.get(), 88 Node* heap_number = graph()->NewNode(allocate_heap_number_operator_.get(),
89 target, context, effect, control); 89 target, context, effect, control);
90 Node* store = graph()->NewNode( 90 Node* store = graph()->NewNode(machine()->Store(StoreRepresentation(
91 machine()->Store(StoreRepresentation(kMachFloat64, kNoWriteBarrier)), 91 MachineType::Float64(), kNoWriteBarrier)),
92 heap_number, HeapNumberValueIndexConstant(), value, heap_number, control); 92 heap_number, HeapNumberValueIndexConstant(),
93 value, heap_number, control);
93 return graph()->NewNode(common()->FinishRegion(), heap_number, store); 94 return graph()->NewNode(common()->FinishRegion(), heap_number, store);
94 } 95 }
95 96
96 97
97 Node* ChangeLowering::ChangeInt32ToFloat64(Node* value) { 98 Node* ChangeLowering::ChangeInt32ToFloat64(Node* value) {
98 return graph()->NewNode(machine()->ChangeInt32ToFloat64(), value); 99 return graph()->NewNode(machine()->ChangeInt32ToFloat64(), value);
99 } 100 }
100 101
101 102
102 Node* ChangeLowering::ChangeInt32ToSmi(Node* value) { 103 Node* ChangeLowering::ChangeInt32ToSmi(Node* value) {
(...skipping 25 matching lines...) Expand all
128 129
129 Node* ChangeLowering::ChangeUint32ToSmi(Node* value) { 130 Node* ChangeLowering::ChangeUint32ToSmi(Node* value) {
130 if (machine()->Is64()) { 131 if (machine()->Is64()) {
131 value = graph()->NewNode(machine()->ChangeUint32ToUint64(), value); 132 value = graph()->NewNode(machine()->ChangeUint32ToUint64(), value);
132 } 133 }
133 return graph()->NewNode(machine()->WordShl(), value, SmiShiftBitsConstant()); 134 return graph()->NewNode(machine()->WordShl(), value, SmiShiftBitsConstant());
134 } 135 }
135 136
136 137
137 Node* ChangeLowering::LoadHeapNumberValue(Node* value, Node* control) { 138 Node* ChangeLowering::LoadHeapNumberValue(Node* value, Node* control) {
138 return graph()->NewNode(machine()->Load(kMachFloat64), value, 139 return graph()->NewNode(machine()->Load(MachineType::Float64()), value,
139 HeapNumberValueIndexConstant(), graph()->start(), 140 HeapNumberValueIndexConstant(), graph()->start(),
140 control); 141 control);
141 } 142 }
142 143
143 144
144 Node* ChangeLowering::TestNotSmi(Node* value) { 145 Node* ChangeLowering::TestNotSmi(Node* value) {
145 STATIC_ASSERT(kSmiTag == 0); 146 STATIC_ASSERT(kSmiTag == 0);
146 STATIC_ASSERT(kSmiTagMask == 1); 147 STATIC_ASSERT(kSmiTagMask == 1);
147 return graph()->NewNode(machine()->WordAnd(), value, 148 return graph()->NewNode(machine()->WordAnd(), value,
148 jsgraph()->IntPtrConstant(kSmiTagMask)); 149 jsgraph()->IntPtrConstant(kSmiTagMask));
149 } 150 }
150 151
151 152
152 Reduction ChangeLowering::ChangeBitToBool(Node* value, Node* control) { 153 Reduction ChangeLowering::ChangeBitToBool(Node* value, Node* control) {
153 return Replace(graph()->NewNode(common()->Select(kMachAnyTagged), value, 154 return Replace(
154 jsgraph()->TrueConstant(), 155 graph()->NewNode(common()->Select(MachineRepresentation::kTagged), value,
155 jsgraph()->FalseConstant())); 156 jsgraph()->TrueConstant(), jsgraph()->FalseConstant()));
156 } 157 }
157 158
158 159
159 Reduction ChangeLowering::ChangeBoolToBit(Node* value) { 160 Reduction ChangeLowering::ChangeBoolToBit(Node* value) {
160 return Replace(graph()->NewNode(machine()->WordEqual(), value, 161 return Replace(graph()->NewNode(machine()->WordEqual(), value,
161 jsgraph()->TrueConstant())); 162 jsgraph()->TrueConstant()));
162 } 163 }
163 164
164 165
165 Reduction ChangeLowering::ChangeFloat64ToTagged(Node* value, Node* control) { 166 Reduction ChangeLowering::ChangeFloat64ToTagged(Node* value, Node* control) {
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 if_box = graph()->NewNode(common()->Merge(2), if_ovf, if_box); 226 if_box = graph()->NewNode(common()->Merge(2), if_ovf, if_box);
226 227
227 if_smi = graph()->NewNode(common()->IfFalse(), branch_ovf); 228 if_smi = graph()->NewNode(common()->IfFalse(), branch_ovf);
228 vsmi = graph()->NewNode(common()->Projection(0), smi_tag); 229 vsmi = graph()->NewNode(common()->Projection(0), smi_tag);
229 } 230 }
230 231
231 // Allocate the box for the {value}. 232 // Allocate the box for the {value}.
232 vbox = AllocateHeapNumberWithValue(value, if_box); 233 vbox = AllocateHeapNumberWithValue(value, if_box);
233 234
234 control = graph()->NewNode(common()->Merge(2), if_smi, if_box); 235 control = graph()->NewNode(common()->Merge(2), if_smi, if_box);
235 value = 236 value = graph()->NewNode(common()->Phi(MachineRepresentation::kTagged, 2),
236 graph()->NewNode(common()->Phi(kMachAnyTagged, 2), vsmi, vbox, control); 237 vsmi, vbox, control);
237 return Replace(value); 238 return Replace(value);
238 } 239 }
239 240
240 241
241 Reduction ChangeLowering::ChangeInt32ToTagged(Node* value, Node* control) { 242 Reduction ChangeLowering::ChangeInt32ToTagged(Node* value, Node* control) {
242 if (machine()->Is64() || 243 if (machine()->Is64() ||
243 NodeProperties::GetType(value)->Is(Type::SignedSmall())) { 244 NodeProperties::GetType(value)->Is(Type::SignedSmall())) {
244 return Replace(ChangeInt32ToSmi(value)); 245 return Replace(ChangeInt32ToSmi(value));
245 } 246 }
246 247
247 Node* add = graph()->NewNode(machine()->Int32AddWithOverflow(), value, value); 248 Node* add = graph()->NewNode(machine()->Int32AddWithOverflow(), value, value);
248 249
249 Node* ovf = graph()->NewNode(common()->Projection(1), add); 250 Node* ovf = graph()->NewNode(common()->Projection(1), add);
250 Node* branch = 251 Node* branch =
251 graph()->NewNode(common()->Branch(BranchHint::kFalse), ovf, control); 252 graph()->NewNode(common()->Branch(BranchHint::kFalse), ovf, control);
252 253
253 Node* if_true = graph()->NewNode(common()->IfTrue(), branch); 254 Node* if_true = graph()->NewNode(common()->IfTrue(), branch);
254 Node* vtrue = 255 Node* vtrue =
255 AllocateHeapNumberWithValue(ChangeInt32ToFloat64(value), if_true); 256 AllocateHeapNumberWithValue(ChangeInt32ToFloat64(value), if_true);
256 257
257 Node* if_false = graph()->NewNode(common()->IfFalse(), branch); 258 Node* if_false = graph()->NewNode(common()->IfFalse(), branch);
258 Node* vfalse = graph()->NewNode(common()->Projection(0), add); 259 Node* vfalse = graph()->NewNode(common()->Projection(0), add);
259 260
260 Node* merge = graph()->NewNode(common()->Merge(2), if_true, if_false); 261 Node* merge = graph()->NewNode(common()->Merge(2), if_true, if_false);
261 Node* phi = 262 Node* phi = graph()->NewNode(common()->Phi(MachineRepresentation::kTagged, 2),
262 graph()->NewNode(common()->Phi(kMachAnyTagged, 2), vtrue, vfalse, merge); 263 vtrue, vfalse, merge);
263 264
264 return Replace(phi); 265 return Replace(phi);
265 } 266 }
266 267
267 268
268 Reduction ChangeLowering::ChangeTaggedToUI32(Node* value, Node* control, 269 Reduction ChangeLowering::ChangeTaggedToUI32(Node* value, Node* control,
269 Signedness signedness) { 270 Signedness signedness) {
270 if (NodeProperties::GetType(value)->Is(Type::TaggedSigned())) { 271 if (NodeProperties::GetType(value)->Is(Type::TaggedSigned())) {
271 return Replace(ChangeSmiToInt32(value)); 272 return Replace(ChangeSmiToInt32(value));
272 } 273 }
273 274
274 const MachineType type = (signedness == kSigned) ? kMachInt32 : kMachUint32;
275 const Operator* op = (signedness == kSigned) 275 const Operator* op = (signedness == kSigned)
276 ? machine()->ChangeFloat64ToInt32() 276 ? machine()->ChangeFloat64ToInt32()
277 : machine()->ChangeFloat64ToUint32(); 277 : machine()->ChangeFloat64ToUint32();
278 278
279 if (NodeProperties::GetType(value)->Is(Type::TaggedPointer())) { 279 if (NodeProperties::GetType(value)->Is(Type::TaggedPointer())) {
280 return Replace(graph()->NewNode(op, LoadHeapNumberValue(value, control))); 280 return Replace(graph()->NewNode(op, LoadHeapNumberValue(value, control)));
281 } 281 }
282 282
283 Node* check = TestNotSmi(value); 283 Node* check = TestNotSmi(value);
284 Node* branch = 284 Node* branch =
285 graph()->NewNode(common()->Branch(BranchHint::kFalse), check, control); 285 graph()->NewNode(common()->Branch(BranchHint::kFalse), check, control);
286 286
287 Node* if_true = graph()->NewNode(common()->IfTrue(), branch); 287 Node* if_true = graph()->NewNode(common()->IfTrue(), branch);
288 Node* vtrue = graph()->NewNode(op, LoadHeapNumberValue(value, if_true)); 288 Node* vtrue = graph()->NewNode(op, LoadHeapNumberValue(value, if_true));
289 289
290 Node* if_false = graph()->NewNode(common()->IfFalse(), branch); 290 Node* if_false = graph()->NewNode(common()->IfFalse(), branch);
291 Node* vfalse = ChangeSmiToInt32(value); 291 Node* vfalse = ChangeSmiToInt32(value);
292 292
293 Node* merge = graph()->NewNode(common()->Merge(2), if_true, if_false); 293 Node* merge = graph()->NewNode(common()->Merge(2), if_true, if_false);
294 Node* phi = graph()->NewNode(common()->Phi(type, 2), vtrue, vfalse, merge); 294 Node* phi = graph()->NewNode(common()->Phi(MachineRepresentation::kWord32, 2),
295 vtrue, vfalse, merge);
295 296
296 return Replace(phi); 297 return Replace(phi);
297 } 298 }
298 299
299 300
300 namespace { 301 namespace {
301 302
302 bool CanCover(Node* value, IrOpcode::Value opcode) { 303 bool CanCover(Node* value, IrOpcode::Value opcode) {
303 if (value->opcode() != opcode) return false; 304 if (value->opcode() != opcode) return false;
304 bool first = true; 305 bool first = true;
(...skipping 18 matching lines...) Expand all
323 // if IsSmi(y) then ChangeSmiToFloat64(y) 324 // if IsSmi(y) then ChangeSmiToFloat64(y)
324 // else LoadHeapNumberValue(y) 325 // else LoadHeapNumberValue(y)
325 Node* const object = NodeProperties::GetValueInput(value, 0); 326 Node* const object = NodeProperties::GetValueInput(value, 0);
326 Node* const context = NodeProperties::GetContextInput(value); 327 Node* const context = NodeProperties::GetContextInput(value);
327 Node* const frame_state = NodeProperties::GetFrameStateInput(value, 0); 328 Node* const frame_state = NodeProperties::GetFrameStateInput(value, 0);
328 Node* const effect = NodeProperties::GetEffectInput(value); 329 Node* const effect = NodeProperties::GetEffectInput(value);
329 Node* const control = NodeProperties::GetControlInput(value); 330 Node* const control = NodeProperties::GetControlInput(value);
330 331
331 const Operator* merge_op = common()->Merge(2); 332 const Operator* merge_op = common()->Merge(2);
332 const Operator* ephi_op = common()->EffectPhi(2); 333 const Operator* ephi_op = common()->EffectPhi(2);
333 const Operator* phi_op = common()->Phi(kMachFloat64, 2); 334 const Operator* phi_op = common()->Phi(MachineRepresentation::kFloat64, 2);
334 335
335 Node* check1 = TestNotSmi(object); 336 Node* check1 = TestNotSmi(object);
336 Node* branch1 = 337 Node* branch1 =
337 graph()->NewNode(common()->Branch(BranchHint::kFalse), check1, control); 338 graph()->NewNode(common()->Branch(BranchHint::kFalse), check1, control);
338 339
339 Node* if_true1 = graph()->NewNode(common()->IfTrue(), branch1); 340 Node* if_true1 = graph()->NewNode(common()->IfTrue(), branch1);
340 Node* vtrue1 = graph()->NewNode(value->op(), object, context, frame_state, 341 Node* vtrue1 = graph()->NewNode(value->op(), object, context, frame_state,
341 effect, if_true1); 342 effect, if_true1);
342 Node* etrue1 = vtrue1; 343 Node* etrue1 = vtrue1;
343 344
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 Node* branch = 381 Node* branch =
381 graph()->NewNode(common()->Branch(BranchHint::kFalse), check, control); 382 graph()->NewNode(common()->Branch(BranchHint::kFalse), check, control);
382 383
383 Node* if_true = graph()->NewNode(common()->IfTrue(), branch); 384 Node* if_true = graph()->NewNode(common()->IfTrue(), branch);
384 Node* vtrue = LoadHeapNumberValue(value, if_true); 385 Node* vtrue = LoadHeapNumberValue(value, if_true);
385 386
386 Node* if_false = graph()->NewNode(common()->IfFalse(), branch); 387 Node* if_false = graph()->NewNode(common()->IfFalse(), branch);
387 Node* vfalse = ChangeSmiToFloat64(value); 388 Node* vfalse = ChangeSmiToFloat64(value);
388 389
389 Node* merge = graph()->NewNode(common()->Merge(2), if_true, if_false); 390 Node* merge = graph()->NewNode(common()->Merge(2), if_true, if_false);
390 Node* phi = 391 Node* phi = graph()->NewNode(
391 graph()->NewNode(common()->Phi(kMachFloat64, 2), vtrue, vfalse, merge); 392 common()->Phi(MachineRepresentation::kFloat64, 2), vtrue, vfalse, merge);
392 393
393 return Replace(phi); 394 return Replace(phi);
394 } 395 }
395 396
396 397
397 Reduction ChangeLowering::ChangeUint32ToTagged(Node* value, Node* control) { 398 Reduction ChangeLowering::ChangeUint32ToTagged(Node* value, Node* control) {
398 if (NodeProperties::GetType(value)->Is(Type::UnsignedSmall())) { 399 if (NodeProperties::GetType(value)->Is(Type::UnsignedSmall())) {
399 return Replace(ChangeUint32ToSmi(value)); 400 return Replace(ChangeUint32ToSmi(value));
400 } 401 }
401 402
402 Node* check = graph()->NewNode(machine()->Uint32LessThanOrEqual(), value, 403 Node* check = graph()->NewNode(machine()->Uint32LessThanOrEqual(), value,
403 SmiMaxValueConstant()); 404 SmiMaxValueConstant());
404 Node* branch = 405 Node* branch =
405 graph()->NewNode(common()->Branch(BranchHint::kTrue), check, control); 406 graph()->NewNode(common()->Branch(BranchHint::kTrue), check, control);
406 407
407 Node* if_true = graph()->NewNode(common()->IfTrue(), branch); 408 Node* if_true = graph()->NewNode(common()->IfTrue(), branch);
408 Node* vtrue = ChangeUint32ToSmi(value); 409 Node* vtrue = ChangeUint32ToSmi(value);
409 410
410 Node* if_false = graph()->NewNode(common()->IfFalse(), branch); 411 Node* if_false = graph()->NewNode(common()->IfFalse(), branch);
411 Node* vfalse = 412 Node* vfalse =
412 AllocateHeapNumberWithValue(ChangeUint32ToFloat64(value), if_false); 413 AllocateHeapNumberWithValue(ChangeUint32ToFloat64(value), if_false);
413 414
414 Node* merge = graph()->NewNode(common()->Merge(2), if_true, if_false); 415 Node* merge = graph()->NewNode(common()->Merge(2), if_true, if_false);
415 Node* phi = 416 Node* phi = graph()->NewNode(common()->Phi(MachineRepresentation::kTagged, 2),
416 graph()->NewNode(common()->Phi(kMachAnyTagged, 2), vtrue, vfalse, merge); 417 vtrue, vfalse, merge);
417 418
418 return Replace(phi); 419 return Replace(phi);
419 } 420 }
420 421
421 422
422 namespace { 423 namespace {
423 424
424 WriteBarrierKind ComputeWriteBarrierKind(BaseTaggedness base_is_tagged, 425 WriteBarrierKind ComputeWriteBarrierKind(BaseTaggedness base_is_tagged,
425 MachineType representation, 426 MachineRepresentation representation,
426 Type* field_type, Type* input_type) { 427 Type* field_type, Type* input_type) {
427 if (field_type->Is(Type::TaggedSigned()) || 428 if (field_type->Is(Type::TaggedSigned()) ||
428 input_type->Is(Type::TaggedSigned())) { 429 input_type->Is(Type::TaggedSigned())) {
429 // Write barriers are only for writes of heap objects. 430 // Write barriers are only for writes of heap objects.
430 return kNoWriteBarrier; 431 return kNoWriteBarrier;
431 } 432 }
432 if (input_type->Is(Type::BooleanOrNullOrUndefined())) { 433 if (input_type->Is(Type::BooleanOrNullOrUndefined())) {
433 // Write barriers are not necessary when storing true, false, null or 434 // Write barriers are not necessary when storing true, false, null or
434 // undefined, because these special oddballs are always in the root set. 435 // undefined, because these special oddballs are always in the root set.
435 return kNoWriteBarrier; 436 return kNoWriteBarrier;
436 } 437 }
437 if (base_is_tagged == kTaggedBase && 438 if (base_is_tagged == kTaggedBase &&
438 RepresentationOf(representation) == kRepTagged) { 439 representation == MachineRepresentation::kTagged) {
439 if (input_type->IsConstant() && 440 if (input_type->IsConstant() &&
440 input_type->AsConstant()->Value()->IsHeapObject()) { 441 input_type->AsConstant()->Value()->IsHeapObject()) {
441 Handle<HeapObject> input = 442 Handle<HeapObject> input =
442 Handle<HeapObject>::cast(input_type->AsConstant()->Value()); 443 Handle<HeapObject>::cast(input_type->AsConstant()->Value());
443 if (input->IsMap()) { 444 if (input->IsMap()) {
444 // Write barriers for storing maps are cheaper. 445 // Write barriers for storing maps are cheaper.
445 return kMapWriteBarrier; 446 return kMapWriteBarrier;
446 } 447 }
447 Isolate* const isolate = input->GetIsolate(); 448 Isolate* const isolate = input->GetIsolate();
448 RootIndexMap root_index_map(isolate); 449 RootIndexMap root_index_map(isolate);
(...skipping 24 matching lines...) Expand all
473 node->InsertInput(graph()->zone(), 1, offset); 474 node->InsertInput(graph()->zone(), 1, offset);
474 NodeProperties::ChangeOp(node, machine()->Load(access.machine_type)); 475 NodeProperties::ChangeOp(node, machine()->Load(access.machine_type));
475 return Changed(node); 476 return Changed(node);
476 } 477 }
477 478
478 479
479 Reduction ChangeLowering::StoreField(Node* node) { 480 Reduction ChangeLowering::StoreField(Node* node) {
480 const FieldAccess& access = FieldAccessOf(node->op()); 481 const FieldAccess& access = FieldAccessOf(node->op());
481 Type* type = NodeProperties::GetType(node->InputAt(1)); 482 Type* type = NodeProperties::GetType(node->InputAt(1));
482 WriteBarrierKind kind = ComputeWriteBarrierKind( 483 WriteBarrierKind kind = ComputeWriteBarrierKind(
483 access.base_is_tagged, access.machine_type, access.type, type); 484 access.base_is_tagged, access.machine_type.representation(), access.type,
485 type);
484 Node* offset = jsgraph()->IntPtrConstant(access.offset - access.tag()); 486 Node* offset = jsgraph()->IntPtrConstant(access.offset - access.tag());
485 node->InsertInput(graph()->zone(), 1, offset); 487 node->InsertInput(graph()->zone(), 1, offset);
486 NodeProperties::ChangeOp( 488 NodeProperties::ChangeOp(
487 node, machine()->Store(StoreRepresentation(access.machine_type, kind))); 489 node, machine()->Store(StoreRepresentation(access.machine_type, kind)));
488 return Changed(node); 490 return Changed(node);
489 } 491 }
490 492
491 493
492 Node* ChangeLowering::ComputeIndex(const ElementAccess& access, 494 Node* ChangeLowering::ComputeIndex(const ElementAccess& access,
493 Node* const key) { 495 Node* const key) {
494 Node* index = key; 496 Node* index = key;
495 const int element_size_shift = ElementSizeLog2Of(access.machine_type); 497 const int element_size_shift =
498 ElementSizeLog2Of(access.machine_type.representation());
496 if (element_size_shift) { 499 if (element_size_shift) {
497 index = graph()->NewNode(machine()->Word32Shl(), index, 500 index = graph()->NewNode(machine()->Word32Shl(), index,
498 jsgraph()->Int32Constant(element_size_shift)); 501 jsgraph()->Int32Constant(element_size_shift));
499 } 502 }
500 const int fixed_offset = access.header_size - access.tag(); 503 const int fixed_offset = access.header_size - access.tag();
501 if (fixed_offset) { 504 if (fixed_offset) {
502 index = graph()->NewNode(machine()->Int32Add(), index, 505 index = graph()->NewNode(machine()->Int32Add(), index,
503 jsgraph()->Int32Constant(fixed_offset)); 506 jsgraph()->Int32Constant(fixed_offset));
504 } 507 }
505 if (machine()->Is64()) { 508 if (machine()->Is64()) {
(...skipping 12 matching lines...) Expand all
518 NodeProperties::ChangeOp(node, machine()->Load(access.machine_type)); 521 NodeProperties::ChangeOp(node, machine()->Load(access.machine_type));
519 return Changed(node); 522 return Changed(node);
520 } 523 }
521 524
522 525
523 Reduction ChangeLowering::StoreElement(Node* node) { 526 Reduction ChangeLowering::StoreElement(Node* node) {
524 const ElementAccess& access = ElementAccessOf(node->op()); 527 const ElementAccess& access = ElementAccessOf(node->op());
525 Type* type = NodeProperties::GetType(node->InputAt(2)); 528 Type* type = NodeProperties::GetType(node->InputAt(2));
526 node->ReplaceInput(1, ComputeIndex(access, node->InputAt(1))); 529 node->ReplaceInput(1, ComputeIndex(access, node->InputAt(1)));
527 NodeProperties::ChangeOp( 530 NodeProperties::ChangeOp(
528 node, 531 node, machine()->Store(StoreRepresentation(
529 machine()->Store(StoreRepresentation( 532 access.machine_type,
530 access.machine_type, 533 ComputeWriteBarrierKind(access.base_is_tagged,
531 ComputeWriteBarrierKind(access.base_is_tagged, access.machine_type, 534 access.machine_type.representation(),
532 access.type, type)))); 535 access.type, type))));
533 return Changed(node); 536 return Changed(node);
534 } 537 }
535 538
536 539
537 Reduction ChangeLowering::Allocate(Node* node) { 540 Reduction ChangeLowering::Allocate(Node* node) {
538 PretenureFlag pretenure = OpParameter<PretenureFlag>(node->op()); 541 PretenureFlag pretenure = OpParameter<PretenureFlag>(node->op());
539 if (pretenure == NOT_TENURED) { 542 if (pretenure == NOT_TENURED) {
540 Callable callable = CodeFactory::AllocateInNewSpace(isolate()); 543 Callable callable = CodeFactory::AllocateInNewSpace(isolate());
541 Node* target = jsgraph()->HeapConstant(callable.code()); 544 Node* target = jsgraph()->HeapConstant(callable.code());
542 CallDescriptor* descriptor = Linkage::GetStubCallDescriptor( 545 CallDescriptor* descriptor = Linkage::GetStubCallDescriptor(
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
577 } 580 }
578 581
579 582
580 MachineOperatorBuilder* ChangeLowering::machine() const { 583 MachineOperatorBuilder* ChangeLowering::machine() const {
581 return jsgraph()->machine(); 584 return jsgraph()->machine();
582 } 585 }
583 586
584 } // namespace compiler 587 } // namespace compiler
585 } // namespace internal 588 } // namespace internal
586 } // namespace v8 589 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/c-linkage.cc ('k') | src/compiler/code-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698