Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(665)

Side by Side Diff: src/interface-descriptors.cc

Issue 1416953006: [types] Use unified integral representation bits. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month 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/compiler/typer.cc ('k') | src/type-cache.h » ('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 {
11 // Constructors for common combined semantic and representation types. 11 // Constructors for common combined semantic and representation types.
12 Type* SmiType(Zone* zone) { 12 Type* SmiType(Zone* zone) {
13 return Type::Intersect(Type::SignedSmall(), Type::TaggedSigned(), zone); 13 return Type::Intersect(Type::SignedSmall(), Type::TaggedSigned(), zone);
14 } 14 }
15 15
16 16
17 Type* UntaggedSigned32(Zone* zone) { 17 Type* UntaggedIntegral32(Zone* zone) {
18 return Type::Intersect(Type::Signed32(), Type::UntaggedSigned32(), zone); 18 return Type::Intersect(Type::Signed32(), Type::UntaggedIntegral32(), zone);
19 } 19 }
20 20
21 21
22 Type* AnyTagged(Zone* zone) { 22 Type* AnyTagged(Zone* zone) {
23 return Type::Intersect( 23 return Type::Intersect(
24 Type::Any(), 24 Type::Any(),
25 Type::Union(Type::TaggedPointer(), Type::TaggedSigned(), zone), zone); 25 Type::Union(Type::TaggedPointer(), Type::TaggedSigned(), zone), zone);
26 } 26 }
27 27
28 28
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 return function; 143 return function;
144 } 144 }
145 145
146 146
147 Type::FunctionType* 147 Type::FunctionType*
148 LoadGlobalViaContextDescriptor::BuildCallInterfaceDescriptorFunctionType( 148 LoadGlobalViaContextDescriptor::BuildCallInterfaceDescriptorFunctionType(
149 Isolate* isolate, int paramater_count) { 149 Isolate* isolate, int paramater_count) {
150 Zone* zone = isolate->interface_descriptor_zone(); 150 Zone* zone = isolate->interface_descriptor_zone();
151 Type::FunctionType* function = 151 Type::FunctionType* function =
152 Type::FunctionType::New(AnyTagged(zone), Type::Undefined(), 1, zone); 152 Type::FunctionType::New(AnyTagged(zone), Type::Undefined(), 1, zone);
153 function->InitParameter(0, UntaggedSigned32(zone)); 153 function->InitParameter(0, UntaggedIntegral32(zone));
154 return function; 154 return function;
155 } 155 }
156 156
157 157
158 void LoadGlobalViaContextDescriptor::InitializePlatformSpecific( 158 void LoadGlobalViaContextDescriptor::InitializePlatformSpecific(
159 CallInterfaceDescriptorData* data) { 159 CallInterfaceDescriptorData* data) {
160 Register registers[] = {SlotRegister()}; 160 Register registers[] = {SlotRegister()};
161 data->InitializePlatformSpecific(arraysize(registers), registers); 161 data->InitializePlatformSpecific(arraysize(registers), registers);
162 } 162 }
163 163
164 164
165 Type::FunctionType* 165 Type::FunctionType*
166 StoreGlobalViaContextDescriptor::BuildCallInterfaceDescriptorFunctionType( 166 StoreGlobalViaContextDescriptor::BuildCallInterfaceDescriptorFunctionType(
167 Isolate* isolate, int paramater_count) { 167 Isolate* isolate, int paramater_count) {
168 Zone* zone = isolate->interface_descriptor_zone(); 168 Zone* zone = isolate->interface_descriptor_zone();
169 Type::FunctionType* function = 169 Type::FunctionType* function =
170 Type::FunctionType::New(AnyTagged(zone), Type::Undefined(), 2, zone); 170 Type::FunctionType::New(AnyTagged(zone), Type::Undefined(), 2, zone);
171 function->InitParameter(0, UntaggedSigned32(zone)); 171 function->InitParameter(0, UntaggedIntegral32(zone));
172 function->InitParameter(1, AnyTagged(zone)); 172 function->InitParameter(1, AnyTagged(zone));
173 return function; 173 return function;
174 } 174 }
175 175
176 176
177 void StoreGlobalViaContextDescriptor::InitializePlatformSpecific( 177 void StoreGlobalViaContextDescriptor::InitializePlatformSpecific(
178 CallInterfaceDescriptorData* data) { 178 CallInterfaceDescriptorData* data) {
179 Register registers[] = {SlotRegister(), ValueRegister()}; 179 Register registers[] = {SlotRegister(), ValueRegister()};
180 data->InitializePlatformSpecific(arraysize(registers), registers); 180 data->InitializePlatformSpecific(arraysize(registers), registers);
181 } 181 }
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 415
416 416
417 Type::FunctionType* 417 Type::FunctionType*
418 CallTrampolineDescriptor::BuildCallInterfaceDescriptorFunctionType( 418 CallTrampolineDescriptor::BuildCallInterfaceDescriptorFunctionType(
419 Isolate* isolate, int paramater_count) { 419 Isolate* isolate, int paramater_count) {
420 Zone* zone = isolate->interface_descriptor_zone(); 420 Zone* zone = isolate->interface_descriptor_zone();
421 Type::FunctionType* function = 421 Type::FunctionType* function =
422 Type::FunctionType::New(AnyTagged(zone), Type::Undefined(), 2, zone); 422 Type::FunctionType::New(AnyTagged(zone), Type::Undefined(), 2, zone);
423 function->InitParameter(0, AnyTagged(zone)); // target 423 function->InitParameter(0, AnyTagged(zone)); // target
424 function->InitParameter( 424 function->InitParameter(
425 1, UntaggedSigned32(zone)); // actual number of arguments 425 1, UntaggedIntegral32(zone)); // actual number of arguments
426 return function; 426 return function;
427 } 427 }
428 428
429 429
430 Type::FunctionType* 430 Type::FunctionType*
431 CallFunctionWithFeedbackDescriptor::BuildCallInterfaceDescriptorFunctionType( 431 CallFunctionWithFeedbackDescriptor::BuildCallInterfaceDescriptorFunctionType(
432 Isolate* isolate, int paramater_count) { 432 Isolate* isolate, int paramater_count) {
433 Zone* zone = isolate->interface_descriptor_zone(); 433 Zone* zone = isolate->interface_descriptor_zone();
434 Type::FunctionType* function = 434 Type::FunctionType* function =
435 Type::FunctionType::New(AnyTagged(zone), Type::Undefined(), 2, zone); 435 Type::FunctionType::New(AnyTagged(zone), Type::Undefined(), 2, zone);
(...skipping 17 matching lines...) Expand all
453 453
454 454
455 Type::FunctionType* 455 Type::FunctionType*
456 ArrayConstructorDescriptor::BuildCallInterfaceDescriptorFunctionType( 456 ArrayConstructorDescriptor::BuildCallInterfaceDescriptorFunctionType(
457 Isolate* isolate, int paramater_count) { 457 Isolate* isolate, int paramater_count) {
458 Zone* zone = isolate->interface_descriptor_zone(); 458 Zone* zone = isolate->interface_descriptor_zone();
459 Type::FunctionType* function = 459 Type::FunctionType* function =
460 Type::FunctionType::New(AnyTagged(zone), Type::Undefined(), 3, zone); 460 Type::FunctionType::New(AnyTagged(zone), Type::Undefined(), 3, zone);
461 function->InitParameter(0, Type::Receiver()); // JSFunction 461 function->InitParameter(0, Type::Receiver()); // JSFunction
462 function->InitParameter(1, AnyTagged(zone)); 462 function->InitParameter(1, AnyTagged(zone));
463 function->InitParameter(2, UntaggedSigned32(zone)); 463 function->InitParameter(2, UntaggedIntegral32(zone));
464 return function; 464 return function;
465 } 465 }
466 466
467 467
468 Type::FunctionType* 468 Type::FunctionType*
469 InternalArrayConstructorDescriptor::BuildCallInterfaceDescriptorFunctionType( 469 InternalArrayConstructorDescriptor::BuildCallInterfaceDescriptorFunctionType(
470 Isolate* isolate, int paramater_count) { 470 Isolate* isolate, int paramater_count) {
471 Zone* zone = isolate->interface_descriptor_zone(); 471 Zone* zone = isolate->interface_descriptor_zone();
472 Type::FunctionType* function = 472 Type::FunctionType* function =
473 Type::FunctionType::New(AnyTagged(zone), Type::Undefined(), 2, zone); 473 Type::FunctionType::New(AnyTagged(zone), Type::Undefined(), 2, zone);
474 function->InitParameter(0, Type::Receiver()); // JSFunction 474 function->InitParameter(0, Type::Receiver()); // JSFunction
475 function->InitParameter(1, UntaggedSigned32(zone)); 475 function->InitParameter(1, UntaggedIntegral32(zone));
476 return function; 476 return function;
477 } 477 }
478 478
479 479
480 Type::FunctionType* 480 Type::FunctionType*
481 ArgumentAdaptorDescriptor::BuildCallInterfaceDescriptorFunctionType( 481 ArgumentAdaptorDescriptor::BuildCallInterfaceDescriptorFunctionType(
482 Isolate* isolate, int paramater_count) { 482 Isolate* isolate, int paramater_count) {
483 Zone* zone = isolate->interface_descriptor_zone(); 483 Zone* zone = isolate->interface_descriptor_zone();
484 Type::FunctionType* function = 484 Type::FunctionType* function =
485 Type::FunctionType::New(AnyTagged(zone), Type::Undefined(), 3, zone); 485 Type::FunctionType::New(AnyTagged(zone), Type::Undefined(), 3, zone);
486 function->InitParameter(0, Type::Receiver()); // JSFunction 486 function->InitParameter(0, Type::Receiver()); // JSFunction
487 function->InitParameter( 487 function->InitParameter(
488 1, UntaggedSigned32(zone)); // actual number of arguments 488 1, UntaggedIntegral32(zone)); // actual number of arguments
489 function->InitParameter( 489 function->InitParameter(
490 2, 490 2,
491 UntaggedSigned32(zone)); // expected number of arguments 491 UntaggedIntegral32(zone)); // expected number of arguments
492 return function; 492 return function;
493 } 493 }
494 494
495 495
496 Type::FunctionType* 496 Type::FunctionType*
497 ApiFunctionDescriptor::BuildCallInterfaceDescriptorFunctionType( 497 ApiFunctionDescriptor::BuildCallInterfaceDescriptorFunctionType(
498 Isolate* isolate, int paramater_count) { 498 Isolate* isolate, int paramater_count) {
499 Zone* zone = isolate->interface_descriptor_zone(); 499 Zone* zone = isolate->interface_descriptor_zone();
500 Type::FunctionType* function = 500 Type::FunctionType* function =
501 Type::FunctionType::New(AnyTagged(zone), Type::Undefined(), 5, zone); 501 Type::FunctionType::New(AnyTagged(zone), Type::Undefined(), 5, zone);
502 function->InitParameter(0, AnyTagged(zone)); // callee 502 function->InitParameter(0, AnyTagged(zone)); // callee
503 function->InitParameter(1, AnyTagged(zone)); // call_data 503 function->InitParameter(1, AnyTagged(zone)); // call_data
504 function->InitParameter(2, AnyTagged(zone)); // holder 504 function->InitParameter(2, AnyTagged(zone)); // holder
505 function->InitParameter(3, ExternalPointer(zone)); // api_function_address 505 function->InitParameter(3, ExternalPointer(zone)); // api_function_address
506 function->InitParameter( 506 function->InitParameter(
507 4, UntaggedSigned32(zone)); // actual number of arguments 507 4, UntaggedIntegral32(zone)); // actual number of arguments
508 return function; 508 return function;
509 } 509 }
510 510
511 511
512 Type::FunctionType* 512 Type::FunctionType*
513 ApiAccessorDescriptor::BuildCallInterfaceDescriptorFunctionType( 513 ApiAccessorDescriptor::BuildCallInterfaceDescriptorFunctionType(
514 Isolate* isolate, int paramater_count) { 514 Isolate* isolate, int paramater_count) {
515 Zone* zone = isolate->interface_descriptor_zone(); 515 Zone* zone = isolate->interface_descriptor_zone();
516 Type::FunctionType* function = 516 Type::FunctionType* function =
517 Type::FunctionType::New(AnyTagged(zone), Type::Undefined(), 4, zone); 517 Type::FunctionType::New(AnyTagged(zone), Type::Undefined(), 4, zone);
(...skipping 27 matching lines...) Expand all
545 Type::FunctionType::New(AnyTagged(zone), Type::Undefined(), 5, zone); 545 Type::FunctionType::New(AnyTagged(zone), Type::Undefined(), 5, zone);
546 function->InitParameter(0, Type::Receiver()); 546 function->InitParameter(0, Type::Receiver());
547 function->InitParameter(1, SmiType(zone)); 547 function->InitParameter(1, SmiType(zone));
548 function->InitParameter(2, AnyTagged(zone)); 548 function->InitParameter(2, AnyTagged(zone));
549 function->InitParameter(3, AnyTagged(zone)); 549 function->InitParameter(3, AnyTagged(zone));
550 function->InitParameter(4, AnyTagged(zone)); 550 function->InitParameter(4, AnyTagged(zone));
551 return function; 551 return function;
552 } 552 }
553 } // namespace internal 553 } // namespace internal
554 } // namespace v8 554 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/typer.cc ('k') | src/type-cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698