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

Side by Side Diff: src/objects-inl.h

Issue 208263002: Remove Failure::OutOfMemory propagation and V8::IgnoreOutOfMemoryException. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 9 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 | « src/objects.cc ('k') | src/runtime.cc » ('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 // 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 631 matching lines...) Expand 10 before | Expand all | Expand 10 after
642 return HAS_FAILURE_TAG(this); 642 return HAS_FAILURE_TAG(this);
643 } 643 }
644 644
645 645
646 bool MaybeObject::IsRetryAfterGC() { 646 bool MaybeObject::IsRetryAfterGC() {
647 return HAS_FAILURE_TAG(this) 647 return HAS_FAILURE_TAG(this)
648 && Failure::cast(this)->type() == Failure::RETRY_AFTER_GC; 648 && Failure::cast(this)->type() == Failure::RETRY_AFTER_GC;
649 } 649 }
650 650
651 651
652 bool MaybeObject::IsOutOfMemory() {
653 return HAS_FAILURE_TAG(this)
654 && Failure::cast(this)->IsOutOfMemoryException();
655 }
656
657
658 bool MaybeObject::IsException() { 652 bool MaybeObject::IsException() {
659 return this == Failure::Exception(); 653 return this == Failure::Exception();
660 } 654 }
661 655
662 656
663 bool MaybeObject::IsTheHole() { 657 bool MaybeObject::IsTheHole() {
664 return !IsFailure() && ToObjectUnchecked()->IsTheHole(); 658 return !IsFailure() && ToObjectUnchecked()->IsTheHole();
665 } 659 }
666 660
667 661
(...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after
1238 Failure::Type Failure::type() const { 1232 Failure::Type Failure::type() const {
1239 return static_cast<Type>(value() & kFailureTypeTagMask); 1233 return static_cast<Type>(value() & kFailureTypeTagMask);
1240 } 1234 }
1241 1235
1242 1236
1243 bool Failure::IsInternalError() const { 1237 bool Failure::IsInternalError() const {
1244 return type() == INTERNAL_ERROR; 1238 return type() == INTERNAL_ERROR;
1245 } 1239 }
1246 1240
1247 1241
1248 bool Failure::IsOutOfMemoryException() const {
1249 return type() == OUT_OF_MEMORY_EXCEPTION;
1250 }
1251
1252
1253 AllocationSpace Failure::allocation_space() const { 1242 AllocationSpace Failure::allocation_space() const {
1254 ASSERT_EQ(RETRY_AFTER_GC, type()); 1243 ASSERT_EQ(RETRY_AFTER_GC, type());
1255 return static_cast<AllocationSpace>((value() >> kFailureTypeTagSize) 1244 return static_cast<AllocationSpace>((value() >> kFailureTypeTagSize)
1256 & kSpaceTagMask); 1245 & kSpaceTagMask);
1257 } 1246 }
1258 1247
1259 1248
1260 Failure* Failure::InternalError() { 1249 Failure* Failure::InternalError() {
1261 return Construct(INTERNAL_ERROR); 1250 return Construct(INTERNAL_ERROR);
1262 } 1251 }
1263 1252
1264 1253
1265 Failure* Failure::Exception() { 1254 Failure* Failure::Exception() {
1266 return Construct(EXCEPTION); 1255 return Construct(EXCEPTION);
1267 } 1256 }
1268 1257
1269 1258
1270 Failure* Failure::OutOfMemoryException(intptr_t value) {
1271 return Construct(OUT_OF_MEMORY_EXCEPTION, value);
1272 }
1273
1274
1275 intptr_t Failure::value() const { 1259 intptr_t Failure::value() const {
1276 return static_cast<intptr_t>( 1260 return static_cast<intptr_t>(
1277 reinterpret_cast<uintptr_t>(this) >> kFailureTagSize); 1261 reinterpret_cast<uintptr_t>(this) >> kFailureTagSize);
1278 } 1262 }
1279 1263
1280 1264
1281 Failure* Failure::RetryAfterGC() { 1265 Failure* Failure::RetryAfterGC() {
1282 return RetryAfterGC(NEW_SPACE); 1266 return RetryAfterGC(NEW_SPACE);
1283 } 1267 }
1284 1268
(...skipping 5536 matching lines...) Expand 10 before | Expand all | Expand 10 after
6821 #undef READ_UINT32_FIELD 6805 #undef READ_UINT32_FIELD
6822 #undef WRITE_UINT32_FIELD 6806 #undef WRITE_UINT32_FIELD
6823 #undef READ_SHORT_FIELD 6807 #undef READ_SHORT_FIELD
6824 #undef WRITE_SHORT_FIELD 6808 #undef WRITE_SHORT_FIELD
6825 #undef READ_BYTE_FIELD 6809 #undef READ_BYTE_FIELD
6826 #undef WRITE_BYTE_FIELD 6810 #undef WRITE_BYTE_FIELD
6827 6811
6828 } } // namespace v8::internal 6812 } } // namespace v8::internal
6829 6813
6830 #endif // V8_OBJECTS_INL_H_ 6814 #endif // V8_OBJECTS_INL_H_
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698