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

Side by Side Diff: src/heap.cc

Issue 240883003: Introduce exception object and remove some uses of MaybeObject::IsFailure(). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 8 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/heap.h ('k') | src/ic.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 2543 matching lines...) Expand 10 before | Expand all | Expand 10 after
2554 ALLOCATE_VARSIZE_MAP(FIXED_ARRAY_TYPE, scope_info) 2554 ALLOCATE_VARSIZE_MAP(FIXED_ARRAY_TYPE, scope_info)
2555 ALLOCATE_MAP(HEAP_NUMBER_TYPE, HeapNumber::kSize, heap_number) 2555 ALLOCATE_MAP(HEAP_NUMBER_TYPE, HeapNumber::kSize, heap_number)
2556 ALLOCATE_MAP(SYMBOL_TYPE, Symbol::kSize, symbol) 2556 ALLOCATE_MAP(SYMBOL_TYPE, Symbol::kSize, symbol)
2557 ALLOCATE_MAP(FOREIGN_TYPE, Foreign::kSize, foreign) 2557 ALLOCATE_MAP(FOREIGN_TYPE, Foreign::kSize, foreign)
2558 2558
2559 ALLOCATE_MAP(ODDBALL_TYPE, Oddball::kSize, the_hole); 2559 ALLOCATE_MAP(ODDBALL_TYPE, Oddball::kSize, the_hole);
2560 ALLOCATE_MAP(ODDBALL_TYPE, Oddball::kSize, boolean); 2560 ALLOCATE_MAP(ODDBALL_TYPE, Oddball::kSize, boolean);
2561 ALLOCATE_MAP(ODDBALL_TYPE, Oddball::kSize, uninitialized); 2561 ALLOCATE_MAP(ODDBALL_TYPE, Oddball::kSize, uninitialized);
2562 ALLOCATE_MAP(ODDBALL_TYPE, Oddball::kSize, arguments_marker); 2562 ALLOCATE_MAP(ODDBALL_TYPE, Oddball::kSize, arguments_marker);
2563 ALLOCATE_MAP(ODDBALL_TYPE, Oddball::kSize, no_interceptor_result_sentinel); 2563 ALLOCATE_MAP(ODDBALL_TYPE, Oddball::kSize, no_interceptor_result_sentinel);
2564 ALLOCATE_MAP(ODDBALL_TYPE, Oddball::kSize, exception);
2564 ALLOCATE_MAP(ODDBALL_TYPE, Oddball::kSize, termination_exception); 2565 ALLOCATE_MAP(ODDBALL_TYPE, Oddball::kSize, termination_exception);
2565 2566
2566 for (unsigned i = 0; i < ARRAY_SIZE(string_type_table); i++) { 2567 for (unsigned i = 0; i < ARRAY_SIZE(string_type_table); i++) {
2567 const StringTypeTable& entry = string_type_table[i]; 2568 const StringTypeTable& entry = string_type_table[i];
2568 { MaybeObject* maybe_obj = AllocateMap(entry.type, entry.size); 2569 { MaybeObject* maybe_obj = AllocateMap(entry.type, entry.size);
2569 if (!maybe_obj->ToObject(&obj)) return false; 2570 if (!maybe_obj->ToObject(&obj)) return false;
2570 } 2571 }
2571 roots_[entry.index] = Map::cast(obj); 2572 roots_[entry.index] = Map::cast(obj);
2572 } 2573 }
2573 2574
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
2858 "no_interceptor_result_sentinel", 2859 "no_interceptor_result_sentinel",
2859 handle(Smi::FromInt(-2), isolate()), 2860 handle(Smi::FromInt(-2), isolate()),
2860 Oddball::kOther)); 2861 Oddball::kOther));
2861 2862
2862 set_termination_exception( 2863 set_termination_exception(
2863 *factory->NewOddball(factory->termination_exception_map(), 2864 *factory->NewOddball(factory->termination_exception_map(),
2864 "termination_exception", 2865 "termination_exception",
2865 handle(Smi::FromInt(-3), isolate()), 2866 handle(Smi::FromInt(-3), isolate()),
2866 Oddball::kOther)); 2867 Oddball::kOther));
2867 2868
2869 set_exception(
2870 *factory->NewOddball(factory->exception_map(),
2871 "exception",
2872 handle(Smi::FromInt(-5), isolate()),
2873 Oddball::kException));
2874
2868 for (unsigned i = 0; i < ARRAY_SIZE(constant_string_table); i++) { 2875 for (unsigned i = 0; i < ARRAY_SIZE(constant_string_table); i++) {
2869 Handle<String> str = 2876 Handle<String> str =
2870 factory->InternalizeUtf8String(constant_string_table[i].contents); 2877 factory->InternalizeUtf8String(constant_string_table[i].contents);
2871 roots_[constant_string_table[i].index] = *str; 2878 roots_[constant_string_table[i].index] = *str;
2872 } 2879 }
2873 2880
2874 Object* obj; 2881 Object* obj;
2875 2882
2876 // Allocate the hidden string which is used to identify the hidden properties 2883 // Allocate the hidden string which is used to identify the hidden properties
2877 // in JSObjects. The hash code has a special value so that it will not match 2884 // in JSObjects. The hash code has a special value so that it will not match
(...skipping 3836 matching lines...) Expand 10 before | Expand all | Expand 10 after
6714 static_cast<int>(object_sizes_last_time_[index])); 6721 static_cast<int>(object_sizes_last_time_[index]));
6715 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) 6722 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT)
6716 #undef ADJUST_LAST_TIME_OBJECT_COUNT 6723 #undef ADJUST_LAST_TIME_OBJECT_COUNT
6717 6724
6718 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); 6725 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_));
6719 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); 6726 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_));
6720 ClearObjectStats(); 6727 ClearObjectStats();
6721 } 6728 }
6722 6729
6723 } } // namespace v8::internal 6730 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap.h ('k') | src/ic.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698