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

Side by Side Diff: src/objects.cc

Issue 102563004: Zonify types in compiler frontend (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased 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/objects.h ('k') | src/parser.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 16585 matching lines...) Expand 10 before | Expand all | Expand 10 after
16596 } 16596 }
16597 16597
16598 16598
16599 void JSTypedArray::Neuter() { 16599 void JSTypedArray::Neuter() {
16600 NeuterView(); 16600 NeuterView();
16601 set_length(Smi::FromInt(0)); 16601 set_length(Smi::FromInt(0));
16602 set_elements(GetHeap()->EmptyExternalArrayForMap(map())); 16602 set_elements(GetHeap()->EmptyExternalArrayForMap(map()));
16603 } 16603 }
16604 16604
16605 16605
16606 Type* PropertyCell::type() { 16606 HeapType* PropertyCell::type() {
16607 return static_cast<Type*>(type_raw()); 16607 return static_cast<HeapType*>(type_raw());
16608 } 16608 }
16609 16609
16610 16610
16611 void PropertyCell::set_type(Type* type, WriteBarrierMode ignored) { 16611 void PropertyCell::set_type(HeapType* type, WriteBarrierMode ignored) {
16612 ASSERT(IsPropertyCell()); 16612 ASSERT(IsPropertyCell());
16613 set_type_raw(type, ignored); 16613 set_type_raw(type, ignored);
16614 } 16614 }
16615 16615
16616 16616
16617 Handle<Type> PropertyCell::UpdatedType(Handle<PropertyCell> cell, 16617 Handle<HeapType> PropertyCell::UpdatedType(Handle<PropertyCell> cell,
16618 Handle<Object> value) { 16618 Handle<Object> value) {
16619 Isolate* isolate = cell->GetIsolate(); 16619 Isolate* isolate = cell->GetIsolate();
16620 Handle<Type> old_type(cell->type(), isolate); 16620 Handle<HeapType> old_type(cell->type(), isolate);
16621 // TODO(2803): Do not track ConsString as constant because they cannot be 16621 // TODO(2803): Do not track ConsString as constant because they cannot be
16622 // embedded into code. 16622 // embedded into code.
16623 Handle<Type> new_type = value->IsConsString() || value->IsTheHole() 16623 Handle<HeapType> new_type = value->IsConsString() || value->IsTheHole()
16624 ? Type::Any(isolate) : Type::Constant(value, isolate); 16624 ? HeapType::Any(isolate) : HeapType::Constant(value, isolate);
16625 16625
16626 if (new_type->Is(old_type)) { 16626 if (new_type->Is(old_type)) {
16627 return old_type; 16627 return old_type;
16628 } 16628 }
16629 16629
16630 cell->dependent_code()->DeoptimizeDependentCodeGroup( 16630 cell->dependent_code()->DeoptimizeDependentCodeGroup(
16631 isolate, DependentCode::kPropertyCellChangedGroup); 16631 isolate, DependentCode::kPropertyCellChangedGroup);
16632 16632
16633 if (old_type->Is(Type::None()) || old_type->Is(Type::Undefined())) { 16633 if (old_type->Is(HeapType::None()) || old_type->Is(HeapType::Undefined())) {
16634 return new_type; 16634 return new_type;
16635 } 16635 }
16636 16636
16637 return Type::Any(isolate); 16637 return HeapType::Any(isolate);
16638 } 16638 }
16639 16639
16640 16640
16641 void PropertyCell::SetValueInferType(Handle<PropertyCell> cell, 16641 void PropertyCell::SetValueInferType(Handle<PropertyCell> cell,
16642 Handle<Object> value) { 16642 Handle<Object> value) {
16643 cell->set_value(*value); 16643 cell->set_value(*value);
16644 if (!Type::Any()->Is(cell->type())) { 16644 if (!HeapType::Any()->Is(cell->type())) {
16645 Handle<Type> new_type = UpdatedType(cell, value); 16645 Handle<HeapType> new_type = UpdatedType(cell, value);
16646 cell->set_type(*new_type); 16646 cell->set_type(*new_type);
16647 } 16647 }
16648 } 16648 }
16649 16649
16650 16650
16651 void PropertyCell::AddDependentCompilationInfo(CompilationInfo* info) { 16651 void PropertyCell::AddDependentCompilationInfo(CompilationInfo* info) {
16652 Handle<DependentCode> dep(dependent_code()); 16652 Handle<DependentCode> dep(dependent_code());
16653 Handle<DependentCode> codes = 16653 Handle<DependentCode> codes =
16654 DependentCode::Insert(dep, DependentCode::kPropertyCellChangedGroup, 16654 DependentCode::Insert(dep, DependentCode::kPropertyCellChangedGroup,
16655 info->object_wrapper()); 16655 info->object_wrapper());
(...skipping 16 matching lines...) Expand all
16672 #define ERROR_MESSAGES_TEXTS(C, T) T, 16672 #define ERROR_MESSAGES_TEXTS(C, T) T,
16673 static const char* error_messages_[] = { 16673 static const char* error_messages_[] = {
16674 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) 16674 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS)
16675 }; 16675 };
16676 #undef ERROR_MESSAGES_TEXTS 16676 #undef ERROR_MESSAGES_TEXTS
16677 return error_messages_[reason]; 16677 return error_messages_[reason];
16678 } 16678 }
16679 16679
16680 16680
16681 } } // namespace v8::internal 16681 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects.h ('k') | src/parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698