OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
438 } | 438 } |
439 | 439 |
440 | 440 |
441 void LCodeGen::DoCallNew(LCallNew* instr) { | 441 void LCodeGen::DoCallNew(LCallNew* instr) { |
442 ASSERT(ToRegister(instr->context()).is(cp)); | 442 ASSERT(ToRegister(instr->context()).is(cp)); |
443 ASSERT(instr->IsMarkedAsCall()); | 443 ASSERT(instr->IsMarkedAsCall()); |
444 ASSERT(ToRegister(instr->constructor()).is(x1)); | 444 ASSERT(ToRegister(instr->constructor()).is(x1)); |
445 | 445 |
446 __ Mov(x0, instr->arity()); | 446 __ Mov(x0, instr->arity()); |
447 // No cell in x2 for construct type feedback in optimized code. | 447 // No cell in x2 for construct type feedback in optimized code. |
448 Handle<Object> undefined_value(isolate()->factory()->undefined_value()); | 448 Handle<Object> megamorphic_symbol = |
449 __ Mov(x2, Operand(undefined_value)); | 449 TypeFeedbackInfo::MegamorphicSentinel(isolate()); |
| 450 __ Mov(x2, Operand(megamorphic_symbol)); |
450 | 451 |
451 CallConstructStub stub(NO_CALL_FUNCTION_FLAGS); | 452 CallConstructStub stub(NO_CALL_FUNCTION_FLAGS); |
452 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); | 453 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); |
453 | 454 |
454 ASSERT(ToRegister(instr->result()).is(x0)); | 455 ASSERT(ToRegister(instr->result()).is(x0)); |
455 } | 456 } |
456 | 457 |
457 | 458 |
458 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { | 459 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { |
459 ASSERT(instr->IsMarkedAsCall()); | 460 ASSERT(instr->IsMarkedAsCall()); |
460 ASSERT(ToRegister(instr->context()).is(cp)); | 461 ASSERT(ToRegister(instr->context()).is(cp)); |
461 ASSERT(ToRegister(instr->constructor()).is(x1)); | 462 ASSERT(ToRegister(instr->constructor()).is(x1)); |
462 | 463 |
463 __ Mov(x0, Operand(instr->arity())); | 464 __ Mov(x0, Operand(instr->arity())); |
464 __ Mov(x2, Operand(factory()->undefined_value())); | 465 __ Mov(x2, Operand(TypeFeedbackInfo::MegamorphicSentinel(isolate()))); |
465 | 466 |
466 ElementsKind kind = instr->hydrogen()->elements_kind(); | 467 ElementsKind kind = instr->hydrogen()->elements_kind(); |
467 AllocationSiteOverrideMode override_mode = | 468 AllocationSiteOverrideMode override_mode = |
468 (AllocationSite::GetMode(kind) == TRACK_ALLOCATION_SITE) | 469 (AllocationSite::GetMode(kind) == TRACK_ALLOCATION_SITE) |
469 ? DISABLE_ALLOCATION_SITES | 470 ? DISABLE_ALLOCATION_SITES |
470 : DONT_OVERRIDE; | 471 : DONT_OVERRIDE; |
471 | 472 |
472 if (instr->arity() == 0) { | 473 if (instr->arity() == 0) { |
473 ArrayNoArgumentConstructorStub stub(kind, override_mode); | 474 ArrayNoArgumentConstructorStub stub(kind, override_mode); |
474 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); | 475 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); |
(...skipping 5191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5666 __ Bind(&out_of_object); | 5667 __ Bind(&out_of_object); |
5667 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); | 5668 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); |
5668 // Index is equal to negated out of object property index plus 1. | 5669 // Index is equal to negated out of object property index plus 1. |
5669 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); | 5670 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); |
5670 __ Ldr(result, FieldMemOperand(result, | 5671 __ Ldr(result, FieldMemOperand(result, |
5671 FixedArray::kHeaderSize - kPointerSize)); | 5672 FixedArray::kHeaderSize - kPointerSize)); |
5672 __ Bind(&done); | 5673 __ Bind(&done); |
5673 } | 5674 } |
5674 | 5675 |
5675 } } // namespace v8::internal | 5676 } } // namespace v8::internal |
OLD | NEW |