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

Side by Side Diff: src/objects.cc

Issue 18843002: Add Type::cast (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | src/types.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 15847 matching lines...) Expand 10 before | Expand all | Expand 10 after
15858 15858
15859 MaybeObject* PropertyCell::SetValueInferType(Object* value, 15859 MaybeObject* PropertyCell::SetValueInferType(Object* value,
15860 WriteBarrierMode ignored) { 15860 WriteBarrierMode ignored) {
15861 set_value(value, ignored); 15861 set_value(value, ignored);
15862 if (!Type::Any()->Is(type())) { 15862 if (!Type::Any()->Is(type())) {
15863 IdempotentPointerToHandleCodeTrampoline trampoline(GetIsolate()); 15863 IdempotentPointerToHandleCodeTrampoline trampoline(GetIsolate());
15864 MaybeObject* maybe_type = trampoline.CallWithReturnValue( 15864 MaybeObject* maybe_type = trampoline.CallWithReturnValue(
15865 &PropertyCell::UpdateType, 15865 &PropertyCell::UpdateType,
15866 Handle<PropertyCell>(this), 15866 Handle<PropertyCell>(this),
15867 Handle<Object>(value, GetIsolate())); 15867 Handle<Object>(value, GetIsolate()));
15868 if (maybe_type->IsFailure()) return maybe_type; 15868 Type* new_type;
15869 Type* new_type = static_cast<Type*>(maybe_type); 15869 if (maybe_type->To(&new_type)) return maybe_type;
15870 set_type(new_type); 15870 set_type(new_type);
15871 } 15871 }
15872 return value; 15872 return value;
15873 } 15873 }
15874 15874
15875 15875
15876 void PropertyCell::AddDependentCompilationInfo(CompilationInfo* info) { 15876 void PropertyCell::AddDependentCompilationInfo(CompilationInfo* info) {
15877 Handle<DependentCode> dep(dependent_code()); 15877 Handle<DependentCode> dep(dependent_code());
15878 Handle<DependentCode> codes = 15878 Handle<DependentCode> codes =
15879 DependentCode::Insert(dep, DependentCode::kPropertyCellChangedGroup, 15879 DependentCode::Insert(dep, DependentCode::kPropertyCellChangedGroup,
15880 info->object_wrapper()); 15880 info->object_wrapper());
15881 if (*codes != dependent_code()) set_dependent_code(*codes); 15881 if (*codes != dependent_code()) set_dependent_code(*codes);
15882 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add( 15882 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add(
15883 Handle<HeapObject>(this), info->zone()); 15883 Handle<HeapObject>(this), info->zone());
15884 } 15884 }
15885 15885
15886 15886
15887 void PropertyCell::AddDependentCode(Handle<Code> code) { 15887 void PropertyCell::AddDependentCode(Handle<Code> code) {
15888 Handle<DependentCode> codes = DependentCode::Insert( 15888 Handle<DependentCode> codes = DependentCode::Insert(
15889 Handle<DependentCode>(dependent_code()), 15889 Handle<DependentCode>(dependent_code()),
15890 DependentCode::kPropertyCellChangedGroup, code); 15890 DependentCode::kPropertyCellChangedGroup, code);
15891 if (*codes != dependent_code()) set_dependent_code(*codes); 15891 if (*codes != dependent_code()) set_dependent_code(*codes);
15892 } 15892 }
15893 15893
15894 15894
15895 } } // namespace v8::internal 15895 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698