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

Unified Diff: src/serialize.cc

Issue 6713074: Require an isolate parameter for most external reference creation to (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Further cleanup Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/parser.cc ('k') | src/x64/assembler-x64.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/serialize.cc
diff --git a/src/serialize.cc b/src/serialize.cc
index acf13fb770e46ff613a9f5ee7592a08413c4e936..260abd894a6f07d44460f5a422c0ce4d0b850953 100644
--- a/src/serialize.cc
+++ b/src/serialize.cc
@@ -102,7 +102,10 @@ class ExternalReferenceTable {
void PopulateTable(Isolate* isolate);
// For a few types of references, we can get their address from their id.
- void AddFromId(TypeCode type, uint16_t id, const char* name);
+ void AddFromId(TypeCode type,
+ uint16_t id,
+ const char* name,
+ Isolate* isolate);
// For other types of references, the caller will figure out the address.
void Add(Address address, TypeCode type, uint16_t id, const char* name);
@@ -114,26 +117,28 @@ class ExternalReferenceTable {
void ExternalReferenceTable::AddFromId(TypeCode type,
uint16_t id,
- const char* name) {
+ const char* name,
+ Isolate* isolate) {
Address address;
switch (type) {
case C_BUILTIN: {
- ExternalReference ref(static_cast<Builtins::CFunctionId>(id));
+ ExternalReference ref(static_cast<Builtins::CFunctionId>(id), isolate);
address = ref.address();
break;
}
case BUILTIN: {
- ExternalReference ref(static_cast<Builtins::Name>(id));
+ ExternalReference ref(static_cast<Builtins::Name>(id), isolate);
address = ref.address();
break;
}
case RUNTIME_FUNCTION: {
- ExternalReference ref(static_cast<Runtime::FunctionId>(id));
+ ExternalReference ref(static_cast<Runtime::FunctionId>(id), isolate);
address = ref.address();
break;
}
case IC_UTILITY: {
- ExternalReference ref(IC_Utility(static_cast<IC::UtilityId>(id)));
+ ExternalReference ref(IC_Utility(static_cast<IC::UtilityId>(id)),
+ isolate);
address = ref.address();
break;
}
@@ -221,7 +226,10 @@ void ExternalReferenceTable::PopulateTable(Isolate* isolate) {
}; // end of ref_table[].
for (size_t i = 0; i < ARRAY_SIZE(ref_table); ++i) {
- AddFromId(ref_table[i].type, ref_table[i].id, ref_table[i].name);
+ AddFromId(ref_table[i].type,
+ ref_table[i].id,
+ ref_table[i].name,
+ isolate);
}
#ifdef ENABLE_DEBUGGER_SUPPORT
@@ -317,122 +325,124 @@ void ExternalReferenceTable::PopulateTable(Isolate* isolate) {
"StubCache::secondary_->value");
// Runtime entries
- Add(ExternalReference::perform_gc_function().address(),
+ Add(ExternalReference::perform_gc_function(isolate).address(),
RUNTIME_ENTRY,
1,
"Runtime::PerformGC");
- Add(ExternalReference::fill_heap_number_with_random_function().address(),
+ Add(ExternalReference::fill_heap_number_with_random_function(
+ isolate).address(),
RUNTIME_ENTRY,
2,
"V8::FillHeapNumberWithRandom");
- Add(ExternalReference::random_uint32_function().address(),
+ Add(ExternalReference::random_uint32_function(isolate).address(),
RUNTIME_ENTRY,
3,
"V8::Random");
- Add(ExternalReference::delete_handle_scope_extensions().address(),
+ Add(ExternalReference::delete_handle_scope_extensions(isolate).address(),
RUNTIME_ENTRY,
4,
"HandleScope::DeleteExtensions");
// Miscellaneous
- Add(ExternalReference::the_hole_value_location().address(),
+ Add(ExternalReference::the_hole_value_location(isolate).address(),
UNCLASSIFIED,
2,
"Factory::the_hole_value().location()");
- Add(ExternalReference::roots_address().address(),
+ Add(ExternalReference::roots_address(isolate).address(),
UNCLASSIFIED,
3,
"Heap::roots_address()");
- Add(ExternalReference::address_of_stack_limit().address(),
+ Add(ExternalReference::address_of_stack_limit(isolate).address(),
UNCLASSIFIED,
4,
"StackGuard::address_of_jslimit()");
- Add(ExternalReference::address_of_real_stack_limit().address(),
+ Add(ExternalReference::address_of_real_stack_limit(isolate).address(),
UNCLASSIFIED,
5,
"StackGuard::address_of_real_jslimit()");
#ifndef V8_INTERPRETED_REGEXP
- Add(ExternalReference::address_of_regexp_stack_limit().address(),
+ Add(ExternalReference::address_of_regexp_stack_limit(isolate).address(),
UNCLASSIFIED,
6,
"RegExpStack::limit_address()");
- Add(ExternalReference::address_of_regexp_stack_memory_address().address(),
+ Add(ExternalReference::address_of_regexp_stack_memory_address(
+ isolate).address(),
UNCLASSIFIED,
7,
"RegExpStack::memory_address()");
- Add(ExternalReference::address_of_regexp_stack_memory_size().address(),
+ Add(ExternalReference::address_of_regexp_stack_memory_size(isolate).address(),
UNCLASSIFIED,
8,
"RegExpStack::memory_size()");
- Add(ExternalReference::address_of_static_offsets_vector().address(),
+ Add(ExternalReference::address_of_static_offsets_vector(isolate).address(),
UNCLASSIFIED,
9,
"OffsetsVector::static_offsets_vector");
#endif // V8_INTERPRETED_REGEXP
- Add(ExternalReference::new_space_start().address(),
+ Add(ExternalReference::new_space_start(isolate).address(),
UNCLASSIFIED,
10,
"Heap::NewSpaceStart()");
- Add(ExternalReference::new_space_mask().address(),
+ Add(ExternalReference::new_space_mask(isolate).address(),
UNCLASSIFIED,
11,
"Heap::NewSpaceMask()");
- Add(ExternalReference::heap_always_allocate_scope_depth().address(),
+ Add(ExternalReference::heap_always_allocate_scope_depth(isolate).address(),
UNCLASSIFIED,
12,
"Heap::always_allocate_scope_depth()");
- Add(ExternalReference::new_space_allocation_limit_address().address(),
+ Add(ExternalReference::new_space_allocation_limit_address(isolate).address(),
UNCLASSIFIED,
13,
"Heap::NewSpaceAllocationLimitAddress()");
- Add(ExternalReference::new_space_allocation_top_address().address(),
+ Add(ExternalReference::new_space_allocation_top_address(isolate).address(),
UNCLASSIFIED,
14,
"Heap::NewSpaceAllocationTopAddress()");
#ifdef ENABLE_DEBUGGER_SUPPORT
- Add(ExternalReference::debug_break().address(),
+ Add(ExternalReference::debug_break(isolate).address(),
UNCLASSIFIED,
15,
"Debug::Break()");
- Add(ExternalReference::debug_step_in_fp_address().address(),
+ Add(ExternalReference::debug_step_in_fp_address(isolate).address(),
UNCLASSIFIED,
16,
"Debug::step_in_fp_addr()");
#endif
- Add(ExternalReference::double_fp_operation(Token::ADD).address(),
+ Add(ExternalReference::double_fp_operation(Token::ADD, isolate).address(),
UNCLASSIFIED,
17,
"add_two_doubles");
- Add(ExternalReference::double_fp_operation(Token::SUB).address(),
+ Add(ExternalReference::double_fp_operation(Token::SUB, isolate).address(),
UNCLASSIFIED,
18,
"sub_two_doubles");
- Add(ExternalReference::double_fp_operation(Token::MUL).address(),
+ Add(ExternalReference::double_fp_operation(Token::MUL, isolate).address(),
UNCLASSIFIED,
19,
"mul_two_doubles");
- Add(ExternalReference::double_fp_operation(Token::DIV).address(),
+ Add(ExternalReference::double_fp_operation(Token::DIV, isolate).address(),
UNCLASSIFIED,
20,
"div_two_doubles");
- Add(ExternalReference::double_fp_operation(Token::MOD).address(),
+ Add(ExternalReference::double_fp_operation(Token::MOD, isolate).address(),
UNCLASSIFIED,
21,
"mod_two_doubles");
- Add(ExternalReference::compare_doubles().address(),
+ Add(ExternalReference::compare_doubles(isolate).address(),
UNCLASSIFIED,
22,
"compare_doubles");
#ifndef V8_INTERPRETED_REGEXP
- Add(ExternalReference::re_case_insensitive_compare_uc16().address(),
+ Add(ExternalReference::re_case_insensitive_compare_uc16(isolate).address(),
UNCLASSIFIED,
23,
"NativeRegExpMacroAssembler::CaseInsensitiveCompareUC16()");
- Add(ExternalReference::re_check_stack_guard_state().address(),
+ Add(ExternalReference::re_check_stack_guard_state(isolate).address(),
UNCLASSIFIED,
24,
"RegExpMacroAssembler*::CheckStackGuardState()");
- Add(ExternalReference::re_grow_stack().address(),
+ Add(ExternalReference::re_grow_stack(isolate).address(),
UNCLASSIFIED,
25,
"NativeRegExpMacroAssembler::GrowStack()");
@@ -442,15 +452,15 @@ void ExternalReferenceTable::PopulateTable(Isolate* isolate) {
"NativeRegExpMacroAssembler::word_character_map");
#endif // V8_INTERPRETED_REGEXP
// Keyed lookup cache.
- Add(ExternalReference::keyed_lookup_cache_keys().address(),
+ Add(ExternalReference::keyed_lookup_cache_keys(isolate).address(),
UNCLASSIFIED,
27,
"KeyedLookupCache::keys()");
- Add(ExternalReference::keyed_lookup_cache_field_offsets().address(),
+ Add(ExternalReference::keyed_lookup_cache_field_offsets(isolate).address(),
UNCLASSIFIED,
28,
"KeyedLookupCache::field_offsets()");
- Add(ExternalReference::transcendental_cache_array_address().address(),
+ Add(ExternalReference::transcendental_cache_array_address(isolate).address(),
UNCLASSIFIED,
29,
"TranscendentalCache::caches()");
@@ -466,11 +476,11 @@ void ExternalReferenceTable::PopulateTable(Isolate* isolate) {
UNCLASSIFIED,
32,
"HandleScope::level");
- Add(ExternalReference::new_deoptimizer_function().address(),
+ Add(ExternalReference::new_deoptimizer_function(isolate).address(),
UNCLASSIFIED,
33,
"Deoptimizer::New()");
- Add(ExternalReference::compute_output_frames_function().address(),
+ Add(ExternalReference::compute_output_frames_function(isolate).address(),
UNCLASSIFIED,
34,
"Deoptimizer::ComputeOutputFrames()");
@@ -494,15 +504,15 @@ void ExternalReferenceTable::PopulateTable(Isolate* isolate) {
UNCLASSIFIED,
39,
"LDoubleConstant::negative_infinity");
- Add(ExternalReference::power_double_double_function().address(),
+ Add(ExternalReference::power_double_double_function(isolate).address(),
UNCLASSIFIED,
40,
"power_double_double_function");
- Add(ExternalReference::power_double_int_function().address(),
+ Add(ExternalReference::power_double_int_function(isolate).address(),
UNCLASSIFIED,
41,
"power_double_int_function");
- Add(ExternalReference::arguments_marker_location().address(),
+ Add(ExternalReference::arguments_marker_location(isolate).address(),
UNCLASSIFIED,
42,
"Factory::arguments_marker().location()");
« no previous file with comments | « src/parser.cc ('k') | src/x64/assembler-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698