Chromium Code Reviews| Index: src/compiler/code-stub-assembler.cc |
| diff --git a/src/compiler/code-stub-assembler.cc b/src/compiler/code-stub-assembler.cc |
| index ac10a98c5c0fc10b6aca5ebc258924806a0c3e1e..c32745fd5e862edf9f4e35284a96b6c95f7a1a06 100644 |
| --- a/src/compiler/code-stub-assembler.cc |
| +++ b/src/compiler/code-stub-assembler.cc |
| @@ -28,24 +28,27 @@ CodeStubAssembler::CodeStubAssembler(Isolate* isolate, Zone* zone, |
| const CallInterfaceDescriptor& descriptor, |
| Code::Flags flags, const char* name, |
| size_t result_size) |
| - : raw_assembler_(new RawMachineAssembler( |
| - isolate, new (zone) Graph(zone), |
| + : CodeStubAssembler( |
| + isolate, zone, |
| Linkage::GetStubCallDescriptor( |
| isolate, zone, descriptor, descriptor.GetStackParameterCount(), |
| CallDescriptor::kNoFlags, Operator::kNoProperties, |
| - MachineType::AnyTagged(), result_size))), |
| - flags_(flags), |
| - name_(name), |
| - code_generated_(false), |
| - variables_(zone) {} |
| + MachineType::AnyTagged(), result_size), |
| + flags, name) {} |
| CodeStubAssembler::CodeStubAssembler(Isolate* isolate, Zone* zone, |
| int parameter_count, Code::Flags flags, |
| const char* name) |
| - : raw_assembler_(new RawMachineAssembler( |
| - isolate, new (zone) Graph(zone), |
| - Linkage::GetJSCallDescriptor(zone, false, parameter_count, |
| - CallDescriptor::kNoFlags))), |
| + : CodeStubAssembler(isolate, zone, Linkage::GetJSCallDescriptor( |
| + zone, false, parameter_count, |
| + CallDescriptor::kNoFlags), |
| + flags, name) {} |
| + |
| +CodeStubAssembler::CodeStubAssembler(Isolate* isolate, Zone* zone, |
| + CallDescriptor* call_descriptor, |
| + Code::Flags flags, const char* name) |
| + : raw_assembler_(new RawMachineAssembler(isolate, new (zone) Graph(zone), |
| + call_descriptor)), |
| flags_(flags), |
| name_(name), |
| code_generated_(false), |
| @@ -109,10 +112,26 @@ Node* CodeStubAssembler::HeapNumberMapConstant() { |
| return HeapConstant(isolate()->factory()->heap_number_map()); |
| } |
| +Node* CodeStubAssembler::NullConstant() { |
| + return LoadRoot(Heap::kNullValueRootIndex); |
| +} |
| + |
| +Node* CodeStubAssembler::UndefinedConstant() { |
| + return LoadRoot(Heap::kUndefinedValueRootIndex); |
| +} |
| + |
| Node* CodeStubAssembler::Parameter(int value) { |
| return raw_assembler_->Parameter(value); |
| } |
| +Node* CodeStubAssembler::ContextParameter() { |
| + const CallDescriptor* descriptor = raw_assembler_->call_descriptor(); |
| + int param_count = static_cast<int>(descriptor->StackParameterCount()); |
| + int param = descriptor->IsJSFunctionCall() |
| + ? Linkage::GetJSCallContextParamIndex(param_count) |
| + : Linkage::GetStubCallContextParamIndex(param_count); |
|
Michael Starzinger
2016/03/09 13:22:05
I am not convinced this computation is correct for
vogelheim
2016/03/09 13:33:08
Done, by making it JSCall only.
Moving it into th
|
| + return Parameter(param); |
| +} |
| void CodeStubAssembler::Return(Node* value) { |
| return raw_assembler_->Return(value); |
| @@ -207,13 +226,14 @@ Node* CodeStubAssembler::WordIsSmi(Node* a) { |
| IntPtrConstant(0)); |
| } |
| -Node* CodeStubAssembler::LoadBufferObject(Node* buffer, int offset) { |
| - return raw_assembler_->Load(MachineType::AnyTagged(), buffer, |
| - IntPtrConstant(offset)); |
| +Node* CodeStubAssembler::LoadBufferObject(Node* buffer, int offset, |
| + MachineType rep) { |
| + return raw_assembler_->Load(rep, buffer, IntPtrConstant(offset)); |
| } |
| -Node* CodeStubAssembler::LoadObjectField(Node* object, int offset) { |
| - return raw_assembler_->Load(MachineType::AnyTagged(), object, |
| +Node* CodeStubAssembler::LoadObjectField(Node* object, int offset, |
| + MachineType rep) { |
| + return raw_assembler_->Load(rep, object, |
| IntPtrConstant(offset - kHeapObjectTag)); |
| } |