OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/code-stubs.h" | 5 #include "src/code-stubs.h" |
6 | 6 |
7 #include <sstream> | 7 #include <sstream> |
8 | 8 |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
482 HeapNumber::kSize, compiler::CodeStubAssembler::kNone); | 482 HeapNumber::kSize, compiler::CodeStubAssembler::kNone); |
483 compiler::Node* map_offset = | 483 compiler::Node* map_offset = |
484 assembler->IntPtrConstant(HeapObject::kMapOffset - kHeapObjectTag); | 484 assembler->IntPtrConstant(HeapObject::kMapOffset - kHeapObjectTag); |
485 compiler::Node* map = assembler->IntPtrAdd(result, map_offset); | 485 compiler::Node* map = assembler->IntPtrAdd(result, map_offset); |
486 assembler->StoreNoWriteBarrier( | 486 assembler->StoreNoWriteBarrier( |
487 MachineRepresentation::kTagged, map, | 487 MachineRepresentation::kTagged, map, |
488 assembler->HeapConstant(isolate()->factory()->mutable_heap_number_map())); | 488 assembler->HeapConstant(isolate()->factory()->mutable_heap_number_map())); |
489 assembler->Return(result); | 489 assembler->Return(result); |
490 } | 490 } |
491 | 491 |
| 492 #define SIMD128_GEN_ASM(TYPE, Type, type, lane_count, lane_type) \ |
| 493 void Allocate##Type##Stub::GenerateAssembly( \ |
| 494 compiler::CodeStubAssembler* assembler) const { \ |
| 495 compiler::Node* result = assembler->Allocate( \ |
| 496 Simd128Value::kSize, compiler::CodeStubAssembler::kNone); \ |
| 497 compiler::Node* map_offset = \ |
| 498 assembler->IntPtrConstant(HeapObject::kMapOffset - kHeapObjectTag); \ |
| 499 compiler::Node* map = assembler->IntPtrAdd(result, map_offset); \ |
| 500 assembler->StoreNoWriteBarrier( \ |
| 501 MachineRepresentation::kTagged, map, \ |
| 502 assembler->HeapConstant(isolate()->factory()->type##_map())); \ |
| 503 assembler->Return(result); \ |
| 504 } |
| 505 SIMD128_TYPES(SIMD128_GEN_ASM) |
| 506 #undef SIMD128_GEN_ASM |
| 507 |
492 void StringLengthStub::GenerateAssembly( | 508 void StringLengthStub::GenerateAssembly( |
493 compiler::CodeStubAssembler* assembler) const { | 509 compiler::CodeStubAssembler* assembler) const { |
494 compiler::Node* value = assembler->Parameter(0); | 510 compiler::Node* value = assembler->Parameter(0); |
495 compiler::Node* string = | 511 compiler::Node* string = |
496 assembler->LoadObjectField(value, JSValue::kValueOffset); | 512 assembler->LoadObjectField(value, JSValue::kValueOffset); |
497 compiler::Node* result = | 513 compiler::Node* result = |
498 assembler->LoadObjectField(string, String::kLengthOffset); | 514 assembler->LoadObjectField(string, String::kLengthOffset); |
499 assembler->Return(result); | 515 assembler->Return(result); |
500 } | 516 } |
501 | 517 |
(...skipping 2042 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2544 descriptor->Initialize( | 2560 descriptor->Initialize( |
2545 Runtime::FunctionForId(Runtime::kAllocateHeapNumber)->entry); | 2561 Runtime::FunctionForId(Runtime::kAllocateHeapNumber)->entry); |
2546 } | 2562 } |
2547 | 2563 |
2548 | 2564 |
2549 void AllocateMutableHeapNumberStub::InitializeDescriptor( | 2565 void AllocateMutableHeapNumberStub::InitializeDescriptor( |
2550 CodeStubDescriptor* descriptor) { | 2566 CodeStubDescriptor* descriptor) { |
2551 descriptor->Initialize(); | 2567 descriptor->Initialize(); |
2552 } | 2568 } |
2553 | 2569 |
| 2570 #define SIMD128_INIT_DESC(TYPE, Type, type, lane_count, lane_type) \ |
| 2571 void Allocate##Type##Stub::InitializeDescriptor( \ |
| 2572 CodeStubDescriptor* descriptor) { \ |
| 2573 descriptor->Initialize( \ |
| 2574 Runtime::FunctionForId(Runtime::kCreate##Type)->entry); \ |
| 2575 } |
| 2576 SIMD128_TYPES(SIMD128_INIT_DESC) |
| 2577 #undef SIMD128_INIT_DESC |
2554 | 2578 |
2555 void AllocateInNewSpaceStub::InitializeDescriptor( | 2579 void AllocateInNewSpaceStub::InitializeDescriptor( |
2556 CodeStubDescriptor* descriptor) { | 2580 CodeStubDescriptor* descriptor) { |
2557 descriptor->Initialize(); | 2581 descriptor->Initialize(); |
2558 } | 2582 } |
2559 | 2583 |
2560 void ToBooleanICStub::InitializeDescriptor(CodeStubDescriptor* descriptor) { | 2584 void ToBooleanICStub::InitializeDescriptor(CodeStubDescriptor* descriptor) { |
2561 descriptor->Initialize(FUNCTION_ADDR(Runtime_ToBooleanIC_Miss)); | 2585 descriptor->Initialize(FUNCTION_ADDR(Runtime_ToBooleanIC_Miss)); |
2562 descriptor->SetMissHandler(ExternalReference( | 2586 descriptor->SetMissHandler(ExternalReference( |
2563 Runtime::FunctionForId(Runtime::kToBooleanIC_Miss), isolate())); | 2587 Runtime::FunctionForId(Runtime::kToBooleanIC_Miss), isolate())); |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2793 if (type->Is(Type::UntaggedPointer())) { | 2817 if (type->Is(Type::UntaggedPointer())) { |
2794 return Representation::External(); | 2818 return Representation::External(); |
2795 } | 2819 } |
2796 | 2820 |
2797 DCHECK(!type->Is(Type::Untagged())); | 2821 DCHECK(!type->Is(Type::Untagged())); |
2798 return Representation::Tagged(); | 2822 return Representation::Tagged(); |
2799 } | 2823 } |
2800 | 2824 |
2801 } // namespace internal | 2825 } // namespace internal |
2802 } // namespace v8 | 2826 } // namespace v8 |
OLD | NEW |