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

Side by Side Diff: src/objects.cc

Issue 28783002: Handlify PropertyCell::SetValueInferType and friends. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 2 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
« src/objects.h ('K') | « src/objects.h ('k') | no next file » | 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 16298 matching lines...) Expand 10 before | Expand all | Expand 10 after
16309 16309
16310 if (old_type->Is(Type::None()) || old_type->Is(Type::Undefined())) { 16310 if (old_type->Is(Type::None()) || old_type->Is(Type::Undefined())) {
16311 return *new_type; 16311 return *new_type;
16312 } 16312 }
16313 16313
16314 return Type::Any(); 16314 return Type::Any();
16315 } 16315 }
16316 16316
16317 16317
16318 void PropertyCell::SetValueInferType(Handle<PropertyCell> cell, 16318 void PropertyCell::SetValueInferType(Handle<PropertyCell> cell,
16319 Handle<Object> value, 16319 Handle<Object> value) {
16320 WriteBarrierMode mode) { 16320 cell->set_value(*value);
16321 CALL_HEAP_FUNCTION_VOID(cell->GetIsolate(), 16321 if (!Type::Any()->Is(cell->type())) {
16322 cell->SetValueInferType(*value, mode)); 16322 Type* new_type = UpdateType(cell, value);
rossberg 2013/10/21 12:16:35 Nit: could inline this
Michael Starzinger 2013/10/21 12:49:44 Nope. This cannot be inlined, as "cell" is a handl
16323 cell->set_type(new_type);
16324 }
16323 } 16325 }
16324 16326
16325 16327
16326 MaybeObject* PropertyCell::SetValueInferType(Object* value,
16327 WriteBarrierMode ignored) {
16328 set_value(value, ignored);
16329 if (!Type::Any()->Is(type())) {
16330 IdempotentPointerToHandleCodeTrampoline trampoline(GetIsolate());
16331 MaybeObject* maybe_type = trampoline.CallWithReturnValue(
16332 &PropertyCell::UpdateType,
16333 Handle<PropertyCell>(this),
16334 Handle<Object>(value, GetIsolate()));
16335 Type* new_type = NULL;
16336 if (!maybe_type->To(&new_type)) return maybe_type;
16337 set_type(new_type);
16338 }
16339 return value;
16340 }
16341
16342
16343 void PropertyCell::AddDependentCompilationInfo(CompilationInfo* info) { 16328 void PropertyCell::AddDependentCompilationInfo(CompilationInfo* info) {
16344 Handle<DependentCode> dep(dependent_code()); 16329 Handle<DependentCode> dep(dependent_code());
16345 Handle<DependentCode> codes = 16330 Handle<DependentCode> codes =
16346 DependentCode::Insert(dep, DependentCode::kPropertyCellChangedGroup, 16331 DependentCode::Insert(dep, DependentCode::kPropertyCellChangedGroup,
16347 info->object_wrapper()); 16332 info->object_wrapper());
16348 if (*codes != dependent_code()) set_dependent_code(*codes); 16333 if (*codes != dependent_code()) set_dependent_code(*codes);
16349 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add( 16334 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add(
16350 Handle<HeapObject>(this), info->zone()); 16335 Handle<HeapObject>(this), info->zone());
16351 } 16336 }
16352 16337
(...skipping 11 matching lines...) Expand all
16364 #define ERROR_MESSAGES_TEXTS(C, T) T, 16349 #define ERROR_MESSAGES_TEXTS(C, T) T,
16365 static const char* error_messages_[] = { 16350 static const char* error_messages_[] = {
16366 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) 16351 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS)
16367 }; 16352 };
16368 #undef ERROR_MESSAGES_TEXTS 16353 #undef ERROR_MESSAGES_TEXTS
16369 return error_messages_[reason]; 16354 return error_messages_[reason];
16370 } 16355 }
16371 16356
16372 16357
16373 } } // namespace v8::internal 16358 } } // namespace v8::internal
OLDNEW
« src/objects.h ('K') | « src/objects.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698