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/interface-descriptors.cc

Issue 2002143002: [stubs] An easier way of defining a stub call interface descriptor. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 6 months 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/interface-descriptors.h ('k') | src/mips/interface-descriptors-mips.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 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/interface-descriptors.h" 5 #include "src/interface-descriptors.h"
6 6
7 namespace v8 { 7 namespace v8 {
8 namespace internal { 8 namespace internal {
9 9
10 namespace { 10 namespace {
(...skipping 25 matching lines...) Expand all
36 Zone* zone = isolate->interface_descriptor_zone(); 36 Zone* zone = isolate->interface_descriptor_zone();
37 FunctionType* function = 37 FunctionType* function =
38 Type::Function(AnyTagged(zone), Type::Undefined(), parameter_count, zone) 38 Type::Function(AnyTagged(zone), Type::Undefined(), parameter_count, zone)
39 ->AsFunction(); 39 ->AsFunction();
40 while (parameter_count-- != 0) { 40 while (parameter_count-- != 0) {
41 function->InitParameter(parameter_count, AnyTagged(zone)); 41 function->InitParameter(parameter_count, AnyTagged(zone));
42 } 42 }
43 return function; 43 return function;
44 } 44 }
45 45
46
47 void CallInterfaceDescriptorData::InitializePlatformSpecific( 46 void CallInterfaceDescriptorData::InitializePlatformSpecific(
48 int register_parameter_count, Register* registers, 47 int register_parameter_count, const Register* registers,
49 PlatformInterfaceDescriptor* platform_descriptor) { 48 PlatformInterfaceDescriptor* platform_descriptor) {
50 platform_specific_descriptor_ = platform_descriptor; 49 platform_specific_descriptor_ = platform_descriptor;
51 register_param_count_ = register_parameter_count; 50 register_param_count_ = register_parameter_count;
52 51
53 // InterfaceDescriptor owns a copy of the registers array. 52 // InterfaceDescriptor owns a copy of the registers array.
54 register_params_.Reset(NewArray<Register>(register_parameter_count)); 53 register_params_.Reset(NewArray<Register>(register_parameter_count));
55 for (int i = 0; i < register_parameter_count; i++) { 54 for (int i = 0; i < register_parameter_count; i++) {
56 register_params_[i] = registers[i]; 55 register_params_[i] = registers[i];
57 } 56 }
58 } 57 }
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 Register registers[] = {LeftRegister(), RightRegister()}; 182 Register registers[] = {LeftRegister(), RightRegister()};
184 data->InitializePlatformSpecific(arraysize(registers), registers); 183 data->InitializePlatformSpecific(arraysize(registers), registers);
185 } 184 }
186 185
187 void TypeConversionDescriptor::InitializePlatformSpecific( 186 void TypeConversionDescriptor::InitializePlatformSpecific(
188 CallInterfaceDescriptorData* data) { 187 CallInterfaceDescriptorData* data) {
189 Register registers[] = {ArgumentRegister()}; 188 Register registers[] = {ArgumentRegister()};
190 data->InitializePlatformSpecific(arraysize(registers), registers); 189 data->InitializePlatformSpecific(arraysize(registers), registers);
191 } 190 }
192 191
193 void HasPropertyDescriptor::InitializePlatformSpecific(
194 CallInterfaceDescriptorData* data) {
195 Register registers[] = {KeyRegister(), ObjectRegister()};
196 data->InitializePlatformSpecific(arraysize(registers), registers);
197 }
198
199 void MathPowTaggedDescriptor::InitializePlatformSpecific( 192 void MathPowTaggedDescriptor::InitializePlatformSpecific(
200 CallInterfaceDescriptorData* data) { 193 CallInterfaceDescriptorData* data) {
201 Register registers[] = {exponent()}; 194 Register registers[] = {exponent()};
202 data->InitializePlatformSpecific(arraysize(registers), registers); 195 data->InitializePlatformSpecific(arraysize(registers), registers);
203 } 196 }
204 197
205 198
206 void MathPowIntegerDescriptor::InitializePlatformSpecific( 199 void MathPowIntegerDescriptor::InitializePlatformSpecific(
207 CallInterfaceDescriptorData* data) { 200 CallInterfaceDescriptorData* data) {
208 Register registers[] = {exponent()}; 201 Register registers[] = {exponent()};
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
544 Type::Function(AnyTagged(zone), Type::Undefined(), 4, zone)->AsFunction(); 537 Type::Function(AnyTagged(zone), Type::Undefined(), 4, zone)->AsFunction();
545 function->InitParameter(kAccumulatorParameter, AnyTagged(zone)); 538 function->InitParameter(kAccumulatorParameter, AnyTagged(zone));
546 function->InitParameter(kBytecodeOffsetParameter, UntaggedIntegral32(zone)); 539 function->InitParameter(kBytecodeOffsetParameter, UntaggedIntegral32(zone));
547 function->InitParameter(kBytecodeArrayParameter, AnyTagged(zone)); 540 function->InitParameter(kBytecodeArrayParameter, AnyTagged(zone));
548 function->InitParameter(kDispatchTableParameter, AnyTagged(zone)); 541 function->InitParameter(kDispatchTableParameter, AnyTagged(zone));
549 return function; 542 return function;
550 } 543 }
551 544
552 } // namespace internal 545 } // namespace internal
553 } // namespace v8 546 } // namespace v8
OLDNEW
« no previous file with comments | « src/interface-descriptors.h ('k') | src/mips/interface-descriptors-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698