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

Side by Side Diff: src/code-stubs.cc

Issue 107933005: Templatise type representation (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years 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 | Annotate | Revision Log
« no previous file with comments | « src/ast.cc ('k') | src/code-stubs-hydrogen.cc » ('j') | src/ic.cc » ('J')
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 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 if (Contains(MONOMORPHIC_MAP)) printer.Add("MonomorphicMap"); 450 if (Contains(MONOMORPHIC_MAP)) printer.Add("MonomorphicMap");
451 if (Contains(GENERIC)) printer.Add("Generic"); 451 if (Contains(GENERIC)) printer.Add("Generic");
452 stream->Add(")"); 452 stream->Add(")");
453 } 453 }
454 454
455 455
456 Handle<Type> CompareNilICStub::GetType( 456 Handle<Type> CompareNilICStub::GetType(
457 Isolate* isolate, 457 Isolate* isolate,
458 Handle<Map> map) { 458 Handle<Map> map) {
459 if (state_.Contains(CompareNilICStub::GENERIC)) { 459 if (state_.Contains(CompareNilICStub::GENERIC)) {
460 return handle(Type::Any(), isolate); 460 return Type::Any(isolate);
461 } 461 }
462 462
463 Handle<Type> result(Type::None(), isolate); 463 Handle<Type> result = Type::None(isolate);
464 if (state_.Contains(CompareNilICStub::UNDEFINED)) { 464 if (state_.Contains(CompareNilICStub::UNDEFINED)) {
465 result = handle(Type::Union(result, handle(Type::Undefined(), isolate)), 465 result = Type::Union(result, Type::Undefined(isolate), isolate);
466 isolate);
467 } 466 }
468 if (state_.Contains(CompareNilICStub::NULL_TYPE)) { 467 if (state_.Contains(CompareNilICStub::NULL_TYPE)) {
469 result = handle(Type::Union(result, handle(Type::Null(), isolate)), 468 result = Type::Union(result, Type::Null(isolate), isolate);
470 isolate);
471 } 469 }
472 if (state_.Contains(CompareNilICStub::MONOMORPHIC_MAP)) { 470 if (state_.Contains(CompareNilICStub::MONOMORPHIC_MAP)) {
473 Type* type = map.is_null() ? Type::Detectable() : Type::Class(map); 471 Handle<Type> type = map.is_null()
474 result = handle(Type::Union(result, handle(type, isolate)), isolate); 472 ? Type::Detectable(isolate) : Type::Class(map, isolate);
473 result = Type::Union(result, type, isolate);
475 } 474 }
476 475
477 return result; 476 return result;
478 } 477 }
479 478
480 479
481 Handle<Type> CompareNilICStub::GetInputType( 480 Handle<Type> CompareNilICStub::GetInputType(
482 Isolate* isolate, 481 Isolate* isolate,
483 Handle<Map> map) { 482 Handle<Map> map) {
484 Handle<Type> output_type = GetType(isolate, map); 483 Handle<Type> output_type = GetType(isolate, map);
485 Handle<Type> nil_type = handle(nil_value_ == kNullValue 484 Handle<Type> nil_type = nil_value_ == kNullValue
486 ? Type::Null() : Type::Undefined(), isolate); 485 ? Type::Null(isolate) : Type::Undefined(isolate);
487 return handle(Type::Union(output_type, nil_type), isolate); 486 return Type::Union(output_type, nil_type, isolate);
488 } 487 }
489 488
490 489
491 void InstanceofStub::PrintName(StringStream* stream) { 490 void InstanceofStub::PrintName(StringStream* stream) {
492 const char* args = ""; 491 const char* args = "";
493 if (HasArgsInRegisters()) { 492 if (HasArgsInRegisters()) {
494 args = "_REGS"; 493 args = "_REGS";
495 } 494 }
496 495
497 const char* inline_check = ""; 496 const char* inline_check = "";
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
762 InstallDescriptor(isolate, &stub3); 761 InstallDescriptor(isolate, &stub3);
763 } 762 }
764 763
765 InternalArrayConstructorStub::InternalArrayConstructorStub( 764 InternalArrayConstructorStub::InternalArrayConstructorStub(
766 Isolate* isolate) { 765 Isolate* isolate) {
767 InternalArrayConstructorStubBase::GenerateStubsAheadOfTime(isolate); 766 InternalArrayConstructorStubBase::GenerateStubsAheadOfTime(isolate);
768 } 767 }
769 768
770 769
771 } } // namespace v8::internal 770 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ast.cc ('k') | src/code-stubs-hydrogen.cc » ('j') | src/ic.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698