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 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
455 } | 455 } |
456 | 456 |
457 void AllocateHeapNumberStub::GenerateAssembly( | 457 void AllocateHeapNumberStub::GenerateAssembly( |
458 CodeStubAssembler* assembler) const { | 458 CodeStubAssembler* assembler) const { |
459 typedef compiler::Node Node; | 459 typedef compiler::Node Node; |
460 | 460 |
461 Node* result = assembler->AllocateHeapNumber(); | 461 Node* result = assembler->AllocateHeapNumber(); |
462 assembler->Return(result); | 462 assembler->Return(result); |
463 } | 463 } |
464 | 464 |
465 void AllocateMutableHeapNumberStub::GenerateAssembly( | |
466 CodeStubAssembler* assembler) const { | |
467 typedef compiler::Node Node; | |
468 | |
469 Node* result = assembler->Allocate(HeapNumber::kSize); | |
470 assembler->StoreMapNoWriteBarrier( | |
471 result, | |
472 assembler->HeapConstant(isolate()->factory()->mutable_heap_number_map())); | |
473 assembler->Return(result); | |
474 } | |
475 | |
476 #define SIMD128_GEN_ASM(TYPE, Type, type, lane_count, lane_type) \ | 465 #define SIMD128_GEN_ASM(TYPE, Type, type, lane_count, lane_type) \ |
477 void Allocate##Type##Stub::GenerateAssembly(CodeStubAssembler* assembler) \ | 466 void Allocate##Type##Stub::GenerateAssembly(CodeStubAssembler* assembler) \ |
478 const { \ | 467 const { \ |
479 compiler::Node* result = \ | 468 compiler::Node* result = \ |
480 assembler->Allocate(Simd128Value::kSize, CodeStubAssembler::kNone); \ | 469 assembler->Allocate(Simd128Value::kSize, CodeStubAssembler::kNone); \ |
481 compiler::Node* map_offset = \ | 470 compiler::Node* map_offset = \ |
482 assembler->IntPtrConstant(HeapObject::kMapOffset - kHeapObjectTag); \ | 471 assembler->IntPtrConstant(HeapObject::kMapOffset - kHeapObjectTag); \ |
483 compiler::Node* map = assembler->IntPtrAdd(result, map_offset); \ | 472 compiler::Node* map = assembler->IntPtrAdd(result, map_offset); \ |
484 assembler->StoreNoWriteBarrier( \ | 473 assembler->StoreNoWriteBarrier( \ |
485 MachineRepresentation::kTagged, map, \ | 474 MachineRepresentation::kTagged, map, \ |
(...skipping 3549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4035 } | 4024 } |
4036 | 4025 |
4037 | 4026 |
4038 void AllocateHeapNumberStub::InitializeDescriptor( | 4027 void AllocateHeapNumberStub::InitializeDescriptor( |
4039 CodeStubDescriptor* descriptor) { | 4028 CodeStubDescriptor* descriptor) { |
4040 descriptor->Initialize( | 4029 descriptor->Initialize( |
4041 Runtime::FunctionForId(Runtime::kAllocateHeapNumber)->entry); | 4030 Runtime::FunctionForId(Runtime::kAllocateHeapNumber)->entry); |
4042 } | 4031 } |
4043 | 4032 |
4044 | 4033 |
4045 void AllocateMutableHeapNumberStub::InitializeDescriptor( | |
4046 CodeStubDescriptor* descriptor) { | |
4047 descriptor->Initialize(); | |
4048 } | |
4049 | |
4050 #define SIMD128_INIT_DESC(TYPE, Type, type, lane_count, lane_type) \ | 4034 #define SIMD128_INIT_DESC(TYPE, Type, type, lane_count, lane_type) \ |
4051 void Allocate##Type##Stub::InitializeDescriptor( \ | 4035 void Allocate##Type##Stub::InitializeDescriptor( \ |
4052 CodeStubDescriptor* descriptor) { \ | 4036 CodeStubDescriptor* descriptor) { \ |
4053 descriptor->Initialize( \ | 4037 descriptor->Initialize( \ |
4054 Runtime::FunctionForId(Runtime::kCreate##Type)->entry); \ | 4038 Runtime::FunctionForId(Runtime::kCreate##Type)->entry); \ |
4055 } | 4039 } |
4056 SIMD128_TYPES(SIMD128_INIT_DESC) | 4040 SIMD128_TYPES(SIMD128_INIT_DESC) |
4057 #undef SIMD128_INIT_DESC | 4041 #undef SIMD128_INIT_DESC |
4058 | 4042 |
4059 void ToBooleanICStub::InitializeDescriptor(CodeStubDescriptor* descriptor) { | 4043 void ToBooleanICStub::InitializeDescriptor(CodeStubDescriptor* descriptor) { |
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4444 if (type->Is(Type::UntaggedPointer())) { | 4428 if (type->Is(Type::UntaggedPointer())) { |
4445 return Representation::External(); | 4429 return Representation::External(); |
4446 } | 4430 } |
4447 | 4431 |
4448 DCHECK(!type->Is(Type::Untagged())); | 4432 DCHECK(!type->Is(Type::Untagged())); |
4449 return Representation::Tagged(); | 4433 return Representation::Tagged(); |
4450 } | 4434 } |
4451 | 4435 |
4452 } // namespace internal | 4436 } // namespace internal |
4453 } // namespace v8 | 4437 } // namespace v8 |
OLD | NEW |