2016-03-17 13:14:11 +00:00
|
|
|
// Copyright 2016 the V8 project authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
|
|
|
#include "src/external-reference-table.h"
|
|
|
|
|
|
|
|
#include "src/accessors.h"
|
|
|
|
#include "src/assembler.h"
|
|
|
|
#include "src/counters.h"
|
|
|
|
#include "src/deoptimizer.h"
|
|
|
|
#include "src/ic/stub-cache.h"
|
|
|
|
|
|
|
|
namespace v8 {
|
|
|
|
namespace internal {
|
|
|
|
|
|
|
|
ExternalReferenceTable* ExternalReferenceTable::instance(Isolate* isolate) {
|
|
|
|
ExternalReferenceTable* external_reference_table =
|
|
|
|
isolate->external_reference_table();
|
|
|
|
if (external_reference_table == NULL) {
|
|
|
|
external_reference_table = new ExternalReferenceTable(isolate);
|
|
|
|
isolate->set_external_reference_table(external_reference_table);
|
|
|
|
}
|
|
|
|
return external_reference_table;
|
|
|
|
}
|
|
|
|
|
|
|
|
ExternalReferenceTable::ExternalReferenceTable(Isolate* isolate) {
|
|
|
|
// Miscellaneous
|
|
|
|
Add(ExternalReference::roots_array_start(isolate).address(),
|
|
|
|
"Heap::roots_array_start()");
|
|
|
|
Add(ExternalReference::address_of_stack_limit(isolate).address(),
|
|
|
|
"StackGuard::address_of_jslimit()");
|
|
|
|
Add(ExternalReference::address_of_real_stack_limit(isolate).address(),
|
|
|
|
"StackGuard::address_of_real_jslimit()");
|
|
|
|
Add(ExternalReference::new_space_allocation_limit_address(isolate).address(),
|
|
|
|
"Heap::NewSpaceAllocationLimitAddress()");
|
|
|
|
Add(ExternalReference::new_space_allocation_top_address(isolate).address(),
|
|
|
|
"Heap::NewSpaceAllocationTopAddress()");
|
|
|
|
Add(ExternalReference::mod_two_doubles_operation(isolate).address(),
|
|
|
|
"mod_two_doubles");
|
|
|
|
// Keyed lookup cache.
|
|
|
|
Add(ExternalReference::keyed_lookup_cache_keys(isolate).address(),
|
|
|
|
"KeyedLookupCache::keys()");
|
|
|
|
Add(ExternalReference::keyed_lookup_cache_field_offsets(isolate).address(),
|
|
|
|
"KeyedLookupCache::field_offsets()");
|
|
|
|
Add(ExternalReference::handle_scope_next_address(isolate).address(),
|
|
|
|
"HandleScope::next");
|
|
|
|
Add(ExternalReference::handle_scope_limit_address(isolate).address(),
|
|
|
|
"HandleScope::limit");
|
|
|
|
Add(ExternalReference::handle_scope_level_address(isolate).address(),
|
|
|
|
"HandleScope::level");
|
|
|
|
Add(ExternalReference::new_deoptimizer_function(isolate).address(),
|
|
|
|
"Deoptimizer::New()");
|
|
|
|
Add(ExternalReference::compute_output_frames_function(isolate).address(),
|
|
|
|
"Deoptimizer::ComputeOutputFrames()");
|
|
|
|
Add(ExternalReference::address_of_min_int().address(),
|
|
|
|
"LDoubleConstant::min_int");
|
|
|
|
Add(ExternalReference::address_of_one_half().address(),
|
|
|
|
"LDoubleConstant::one_half");
|
|
|
|
Add(ExternalReference::isolate_address(isolate).address(), "isolate");
|
|
|
|
Add(ExternalReference::interpreter_dispatch_table_address(isolate).address(),
|
|
|
|
"Interpreter::dispatch_table_address");
|
2016-04-11 11:57:31 +00:00
|
|
|
Add(ExternalReference::interpreter_dispatch_counters(isolate).address(),
|
|
|
|
"Interpreter::interpreter_dispatch_counters");
|
2016-03-17 13:14:11 +00:00
|
|
|
Add(ExternalReference::address_of_negative_infinity().address(),
|
|
|
|
"LDoubleConstant::negative_infinity");
|
|
|
|
Add(ExternalReference::power_double_double_function(isolate).address(),
|
|
|
|
"power_double_double_function");
|
[builtins] Unify most of the remaining Math builtins.
Import fdlibm versions of acos, acosh, asin and asinh, which are more
precise and produce the same result across platforms (we were using
libm versions for asin and acos so far, where both speed and precision
depended on the operating system so far). Introduce appropriate TurboFan
operators for these functions and use them both for inlining and for the
generic builtin.
Also migrate the Math.imul and Math.fround builtins to TurboFan builtins
to ensure that their behavior is always exactly the same as the inlined
TurboFan version (i.e. C++ truncation semantics for double to float
don't necessarily meet the JavaScript semantics).
For completeness, also migrate Math.sign, which can even get some nice
love in TurboFan.
Drive-by-fix: Some alpha-sorting on the Math related functions, and
cleanup the list of Math intrinsics that we have to export via the
native context currently.
BUG=v8:3266,v8:3496,v8:3509,v8:3952,v8:5169,v8:5170,v8:5171,v8:5172
TBR=rossberg@chromium.org
R=franzih@chromium.org
Review-Url: https://codereview.chromium.org/2116753002
Cr-Commit-Position: refs/heads/master@{#37476}
2016-07-01 11:11:33 +00:00
|
|
|
Add(ExternalReference::ieee754_acos_function(isolate).address(),
|
|
|
|
"base::ieee754::acos");
|
|
|
|
Add(ExternalReference::ieee754_acosh_function(isolate).address(),
|
|
|
|
"base::ieee754::acosh");
|
|
|
|
Add(ExternalReference::ieee754_asin_function(isolate).address(),
|
|
|
|
"base::ieee754::asin");
|
|
|
|
Add(ExternalReference::ieee754_asinh_function(isolate).address(),
|
|
|
|
"base::ieee754::asinh");
|
2016-06-13 07:06:49 +00:00
|
|
|
Add(ExternalReference::ieee754_atan_function(isolate).address(),
|
|
|
|
"base::ieee754::atan");
|
2016-06-17 09:13:22 +00:00
|
|
|
Add(ExternalReference::ieee754_atanh_function(isolate).address(),
|
|
|
|
"base::ieee754::atanh");
|
[builtins] Unify most of the remaining Math builtins.
Import fdlibm versions of acos, acosh, asin and asinh, which are more
precise and produce the same result across platforms (we were using
libm versions for asin and acos so far, where both speed and precision
depended on the operating system so far). Introduce appropriate TurboFan
operators for these functions and use them both for inlining and for the
generic builtin.
Also migrate the Math.imul and Math.fround builtins to TurboFan builtins
to ensure that their behavior is always exactly the same as the inlined
TurboFan version (i.e. C++ truncation semantics for double to float
don't necessarily meet the JavaScript semantics).
For completeness, also migrate Math.sign, which can even get some nice
love in TurboFan.
Drive-by-fix: Some alpha-sorting on the Math related functions, and
cleanup the list of Math intrinsics that we have to export via the
native context currently.
BUG=v8:3266,v8:3496,v8:3509,v8:3952,v8:5169,v8:5170,v8:5171,v8:5172
TBR=rossberg@chromium.org
R=franzih@chromium.org
Review-Url: https://codereview.chromium.org/2116753002
Cr-Commit-Position: refs/heads/master@{#37476}
2016-07-01 11:11:33 +00:00
|
|
|
Add(ExternalReference::ieee754_atan2_function(isolate).address(),
|
|
|
|
"base::ieee754::atan2");
|
2016-06-20 05:51:37 +00:00
|
|
|
Add(ExternalReference::ieee754_cbrt_function(isolate).address(),
|
|
|
|
"base::ieee754::cbrt");
|
2016-06-17 15:21:48 +00:00
|
|
|
Add(ExternalReference::ieee754_cos_function(isolate).address(),
|
|
|
|
"base::ieee754::cos");
|
2016-06-30 08:41:05 +00:00
|
|
|
Add(ExternalReference::ieee754_cosh_function(isolate).address(),
|
|
|
|
"base::ieee754::cosh");
|
2016-06-17 05:19:35 +00:00
|
|
|
Add(ExternalReference::ieee754_exp_function(isolate).address(),
|
|
|
|
"base::ieee754::exp");
|
2016-06-17 09:13:22 +00:00
|
|
|
Add(ExternalReference::ieee754_expm1_function(isolate).address(),
|
|
|
|
"base::ieee754::expm1");
|
2016-06-10 05:51:58 +00:00
|
|
|
Add(ExternalReference::ieee754_log_function(isolate).address(),
|
|
|
|
"base::ieee754::log");
|
2016-06-13 05:46:38 +00:00
|
|
|
Add(ExternalReference::ieee754_log1p_function(isolate).address(),
|
|
|
|
"base::ieee754::log1p");
|
2016-06-16 11:22:32 +00:00
|
|
|
Add(ExternalReference::ieee754_log10_function(isolate).address(),
|
|
|
|
"base::ieee754::log10");
|
2016-06-20 05:51:37 +00:00
|
|
|
Add(ExternalReference::ieee754_log2_function(isolate).address(),
|
|
|
|
"base::ieee754::log2");
|
2016-06-17 15:21:48 +00:00
|
|
|
Add(ExternalReference::ieee754_sin_function(isolate).address(),
|
|
|
|
"base::ieee754::sin");
|
2016-06-30 08:41:05 +00:00
|
|
|
Add(ExternalReference::ieee754_sinh_function(isolate).address(),
|
|
|
|
"base::ieee754::sinh");
|
2016-06-20 05:51:37 +00:00
|
|
|
Add(ExternalReference::ieee754_tan_function(isolate).address(),
|
|
|
|
"base::ieee754::tan");
|
2016-06-30 08:41:05 +00:00
|
|
|
Add(ExternalReference::ieee754_tanh_function(isolate).address(),
|
|
|
|
"base::ieee754::tanh");
|
2016-03-17 13:14:11 +00:00
|
|
|
Add(ExternalReference::store_buffer_top(isolate).address(),
|
|
|
|
"store_buffer_top");
|
|
|
|
Add(ExternalReference::address_of_the_hole_nan().address(), "the_hole_nan");
|
|
|
|
Add(ExternalReference::get_date_field_function(isolate).address(),
|
|
|
|
"JSDate::GetField");
|
|
|
|
Add(ExternalReference::date_cache_stamp(isolate).address(),
|
|
|
|
"date_cache_stamp");
|
|
|
|
Add(ExternalReference::address_of_pending_message_obj(isolate).address(),
|
|
|
|
"address_of_pending_message_obj");
|
|
|
|
Add(ExternalReference::get_make_code_young_function(isolate).address(),
|
|
|
|
"Code::MakeCodeYoung");
|
|
|
|
Add(ExternalReference::cpu_features().address(), "cpu_features");
|
|
|
|
Add(ExternalReference::old_space_allocation_top_address(isolate).address(),
|
|
|
|
"Heap::OldSpaceAllocationTopAddress");
|
|
|
|
Add(ExternalReference::old_space_allocation_limit_address(isolate).address(),
|
|
|
|
"Heap::OldSpaceAllocationLimitAddress");
|
|
|
|
Add(ExternalReference::allocation_sites_list_address(isolate).address(),
|
|
|
|
"Heap::allocation_sites_list_address()");
|
|
|
|
Add(ExternalReference::address_of_uint32_bias().address(), "uint32_bias");
|
|
|
|
Add(ExternalReference::get_mark_code_as_executed_function(isolate).address(),
|
|
|
|
"Code::MarkCodeAsExecuted");
|
|
|
|
Add(ExternalReference::is_profiling_address(isolate).address(),
|
2016-06-09 05:23:34 +00:00
|
|
|
"Isolate::is_profiling");
|
2016-03-17 13:14:11 +00:00
|
|
|
Add(ExternalReference::scheduled_exception_address(isolate).address(),
|
|
|
|
"Isolate::scheduled_exception");
|
|
|
|
Add(ExternalReference::invoke_function_callback(isolate).address(),
|
|
|
|
"InvokeFunctionCallback");
|
|
|
|
Add(ExternalReference::invoke_accessor_getter_callback(isolate).address(),
|
|
|
|
"InvokeAccessorGetterCallback");
|
|
|
|
Add(ExternalReference::wasm_f32_trunc(isolate).address(),
|
|
|
|
"wasm::f32_trunc_wrapper");
|
|
|
|
Add(ExternalReference::wasm_f32_floor(isolate).address(),
|
|
|
|
"wasm::f32_floor_wrapper");
|
|
|
|
Add(ExternalReference::wasm_f32_ceil(isolate).address(),
|
|
|
|
"wasm::f32_ceil_wrapper");
|
|
|
|
Add(ExternalReference::wasm_f32_nearest_int(isolate).address(),
|
|
|
|
"wasm::f32_nearest_int_wrapper");
|
|
|
|
Add(ExternalReference::wasm_f64_trunc(isolate).address(),
|
|
|
|
"wasm::f64_trunc_wrapper");
|
|
|
|
Add(ExternalReference::wasm_f64_floor(isolate).address(),
|
|
|
|
"wasm::f64_floor_wrapper");
|
|
|
|
Add(ExternalReference::wasm_f64_ceil(isolate).address(),
|
|
|
|
"wasm::f64_ceil_wrapper");
|
|
|
|
Add(ExternalReference::wasm_f64_nearest_int(isolate).address(),
|
|
|
|
"wasm::f64_nearest_int_wrapper");
|
|
|
|
Add(ExternalReference::wasm_int64_to_float32(isolate).address(),
|
|
|
|
"wasm::int64_to_float32_wrapper");
|
|
|
|
Add(ExternalReference::wasm_uint64_to_float32(isolate).address(),
|
|
|
|
"wasm::uint64_to_float32_wrapper");
|
|
|
|
Add(ExternalReference::wasm_int64_to_float64(isolate).address(),
|
|
|
|
"wasm::int64_to_float64_wrapper");
|
|
|
|
Add(ExternalReference::wasm_uint64_to_float64(isolate).address(),
|
|
|
|
"wasm::uint64_to_float64_wrapper");
|
|
|
|
Add(ExternalReference::wasm_float32_to_int64(isolate).address(),
|
|
|
|
"wasm::float32_to_int64_wrapper");
|
|
|
|
Add(ExternalReference::wasm_float32_to_uint64(isolate).address(),
|
|
|
|
"wasm::float32_to_uint64_wrapper");
|
|
|
|
Add(ExternalReference::wasm_float64_to_int64(isolate).address(),
|
|
|
|
"wasm::float64_to_int64_wrapper");
|
|
|
|
Add(ExternalReference::wasm_float64_to_uint64(isolate).address(),
|
|
|
|
"wasm::float64_to_uint64_wrapper");
|
|
|
|
Add(ExternalReference::wasm_int64_div(isolate).address(), "wasm::int64_div");
|
|
|
|
Add(ExternalReference::wasm_int64_mod(isolate).address(), "wasm::int64_mod");
|
|
|
|
Add(ExternalReference::wasm_uint64_div(isolate).address(),
|
|
|
|
"wasm::uint64_div");
|
|
|
|
Add(ExternalReference::wasm_uint64_mod(isolate).address(),
|
|
|
|
"wasm::uint64_mod");
|
2016-04-21 07:45:36 +00:00
|
|
|
Add(ExternalReference::wasm_word32_ctz(isolate).address(),
|
|
|
|
"wasm::word32_ctz");
|
|
|
|
Add(ExternalReference::wasm_word64_ctz(isolate).address(),
|
|
|
|
"wasm::word64_ctz");
|
|
|
|
Add(ExternalReference::wasm_word32_popcnt(isolate).address(),
|
|
|
|
"wasm::word32_popcnt");
|
|
|
|
Add(ExternalReference::wasm_word64_popcnt(isolate).address(),
|
|
|
|
"wasm::word64_popcnt");
|
2016-03-17 13:14:11 +00:00
|
|
|
Add(ExternalReference::f64_acos_wrapper_function(isolate).address(),
|
|
|
|
"f64_acos_wrapper");
|
|
|
|
Add(ExternalReference::f64_asin_wrapper_function(isolate).address(),
|
|
|
|
"f64_asin_wrapper");
|
|
|
|
Add(ExternalReference::f64_mod_wrapper_function(isolate).address(),
|
|
|
|
"f64_mod_wrapper");
|
|
|
|
Add(ExternalReference::log_enter_external_function(isolate).address(),
|
|
|
|
"Logger::EnterExternal");
|
|
|
|
Add(ExternalReference::log_leave_external_function(isolate).address(),
|
|
|
|
"Logger::LeaveExternal");
|
|
|
|
Add(ExternalReference::address_of_minus_one_half().address(),
|
|
|
|
"double_constants.minus_one_half");
|
|
|
|
Add(ExternalReference::stress_deopt_count(isolate).address(),
|
|
|
|
"Isolate::stress_deopt_count_address()");
|
|
|
|
Add(ExternalReference::virtual_handler_register(isolate).address(),
|
|
|
|
"Isolate::virtual_handler_register()");
|
|
|
|
Add(ExternalReference::virtual_slot_register(isolate).address(),
|
|
|
|
"Isolate::virtual_slot_register()");
|
|
|
|
Add(ExternalReference::runtime_function_table_address(isolate).address(),
|
|
|
|
"Runtime::runtime_function_table_address()");
|
2016-03-29 11:43:46 +00:00
|
|
|
Add(ExternalReference::is_tail_call_elimination_enabled_address(isolate)
|
|
|
|
.address(),
|
|
|
|
"Isolate::is_tail_call_elimination_enabled_address()");
|
2016-03-17 13:14:11 +00:00
|
|
|
|
|
|
|
// Debug addresses
|
|
|
|
Add(ExternalReference::debug_after_break_target_address(isolate).address(),
|
|
|
|
"Debug::after_break_target_address()");
|
|
|
|
Add(ExternalReference::debug_is_active_address(isolate).address(),
|
|
|
|
"Debug::is_active_address()");
|
2016-06-14 11:07:40 +00:00
|
|
|
Add(ExternalReference::debug_last_step_action_address(isolate).address(),
|
2016-03-17 13:14:11 +00:00
|
|
|
"Debug::step_in_enabled_address()");
|
2016-06-03 15:30:42 +00:00
|
|
|
Add(ExternalReference::debug_suspended_generator_address(isolate).address(),
|
|
|
|
"Debug::step_suspended_generator_address()");
|
2016-03-17 13:14:11 +00:00
|
|
|
|
|
|
|
#ifndef V8_INTERPRETED_REGEXP
|
|
|
|
Add(ExternalReference::re_case_insensitive_compare_uc16(isolate).address(),
|
|
|
|
"NativeRegExpMacroAssembler::CaseInsensitiveCompareUC16()");
|
|
|
|
Add(ExternalReference::re_check_stack_guard_state(isolate).address(),
|
|
|
|
"RegExpMacroAssembler*::CheckStackGuardState()");
|
|
|
|
Add(ExternalReference::re_grow_stack(isolate).address(),
|
|
|
|
"NativeRegExpMacroAssembler::GrowStack()");
|
|
|
|
Add(ExternalReference::re_word_character_map().address(),
|
|
|
|
"NativeRegExpMacroAssembler::word_character_map");
|
|
|
|
Add(ExternalReference::address_of_regexp_stack_limit(isolate).address(),
|
|
|
|
"RegExpStack::limit_address()");
|
|
|
|
Add(ExternalReference::address_of_regexp_stack_memory_address(isolate)
|
|
|
|
.address(),
|
|
|
|
"RegExpStack::memory_address()");
|
|
|
|
Add(ExternalReference::address_of_regexp_stack_memory_size(isolate).address(),
|
|
|
|
"RegExpStack::memory_size()");
|
|
|
|
Add(ExternalReference::address_of_static_offsets_vector(isolate).address(),
|
|
|
|
"OffsetsVector::static_offsets_vector");
|
|
|
|
#endif // V8_INTERPRETED_REGEXP
|
|
|
|
|
|
|
|
// The following populates all of the different type of external references
|
|
|
|
// into the ExternalReferenceTable.
|
|
|
|
//
|
|
|
|
// NOTE: This function was originally 100k of code. It has since been
|
|
|
|
// rewritten to be mostly table driven, as the callback macro style tends to
|
|
|
|
// very easily cause code bloat. Please be careful in the future when adding
|
|
|
|
// new references.
|
|
|
|
|
|
|
|
struct RefTableEntry {
|
|
|
|
uint16_t id;
|
|
|
|
const char* name;
|
|
|
|
};
|
|
|
|
|
|
|
|
static const RefTableEntry c_builtins[] = {
|
2016-06-30 06:55:22 +00:00
|
|
|
#define DEF_ENTRY_C(name, ignore) {Builtins::c_##name, "Builtins::" #name},
|
2016-03-17 13:14:11 +00:00
|
|
|
BUILTIN_LIST_C(DEF_ENTRY_C)
|
|
|
|
#undef DEF_ENTRY_C
|
|
|
|
};
|
|
|
|
|
|
|
|
for (unsigned i = 0; i < arraysize(c_builtins); ++i) {
|
|
|
|
ExternalReference ref(static_cast<Builtins::CFunctionId>(c_builtins[i].id),
|
|
|
|
isolate);
|
|
|
|
Add(ref.address(), c_builtins[i].name);
|
|
|
|
}
|
|
|
|
|
|
|
|
static const RefTableEntry builtins[] = {
|
2016-06-30 06:55:22 +00:00
|
|
|
#define DEF_ENTRY_C(name, ignore) {Builtins::k##name, "Builtins::" #name},
|
2016-06-09 16:46:12 +00:00
|
|
|
#define DEF_ENTRY_A(name, i1, i2) {Builtins::k##name, "Builtins::" #name},
|
2016-03-17 13:14:11 +00:00
|
|
|
BUILTIN_LIST_C(DEF_ENTRY_C) BUILTIN_LIST_A(DEF_ENTRY_A)
|
|
|
|
BUILTIN_LIST_DEBUG_A(DEF_ENTRY_A)
|
|
|
|
#undef DEF_ENTRY_C
|
|
|
|
#undef DEF_ENTRY_A
|
|
|
|
};
|
|
|
|
|
|
|
|
for (unsigned i = 0; i < arraysize(builtins); ++i) {
|
|
|
|
ExternalReference ref(static_cast<Builtins::Name>(builtins[i].id), isolate);
|
|
|
|
Add(ref.address(), builtins[i].name);
|
|
|
|
}
|
|
|
|
|
|
|
|
static const RefTableEntry runtime_functions[] = {
|
|
|
|
#define RUNTIME_ENTRY(name, i1, i2) {Runtime::k##name, "Runtime::" #name},
|
|
|
|
FOR_EACH_INTRINSIC(RUNTIME_ENTRY)
|
|
|
|
#undef RUNTIME_ENTRY
|
|
|
|
};
|
|
|
|
|
|
|
|
for (unsigned i = 0; i < arraysize(runtime_functions); ++i) {
|
|
|
|
ExternalReference ref(
|
|
|
|
static_cast<Runtime::FunctionId>(runtime_functions[i].id), isolate);
|
|
|
|
Add(ref.address(), runtime_functions[i].name);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Stat counters
|
|
|
|
struct StatsRefTableEntry {
|
|
|
|
StatsCounter* (Counters::*counter)();
|
|
|
|
const char* name;
|
|
|
|
};
|
|
|
|
|
|
|
|
static const StatsRefTableEntry stats_ref_table[] = {
|
|
|
|
#define COUNTER_ENTRY(name, caption) {&Counters::name, "Counters::" #name},
|
|
|
|
STATS_COUNTER_LIST_1(COUNTER_ENTRY) STATS_COUNTER_LIST_2(COUNTER_ENTRY)
|
|
|
|
#undef COUNTER_ENTRY
|
|
|
|
};
|
|
|
|
|
|
|
|
Counters* counters = isolate->counters();
|
|
|
|
for (unsigned i = 0; i < arraysize(stats_ref_table); ++i) {
|
|
|
|
// To make sure the indices are not dependent on whether counters are
|
|
|
|
// enabled, use a dummy address as filler.
|
|
|
|
Address address = NotAvailable();
|
|
|
|
StatsCounter* counter = (counters->*(stats_ref_table[i].counter))();
|
|
|
|
if (counter->Enabled()) {
|
|
|
|
address = reinterpret_cast<Address>(counter->GetInternalPointer());
|
|
|
|
}
|
|
|
|
Add(address, stats_ref_table[i].name);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Top addresses
|
|
|
|
static const char* address_names[] = {
|
|
|
|
#define BUILD_NAME_LITERAL(Name, name) "Isolate::" #name "_address",
|
|
|
|
FOR_EACH_ISOLATE_ADDRESS_NAME(BUILD_NAME_LITERAL) NULL
|
|
|
|
#undef BUILD_NAME_LITERAL
|
|
|
|
};
|
|
|
|
|
|
|
|
for (int i = 0; i < Isolate::kIsolateAddressCount; ++i) {
|
|
|
|
Add(isolate->get_address_from_id(static_cast<Isolate::AddressId>(i)),
|
|
|
|
address_names[i]);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Accessors
|
|
|
|
struct AccessorRefTable {
|
|
|
|
Address address;
|
|
|
|
const char* name;
|
|
|
|
};
|
|
|
|
|
2016-04-20 08:01:08 +00:00
|
|
|
static const AccessorRefTable getters[] = {
|
2016-03-17 13:14:11 +00:00
|
|
|
#define ACCESSOR_INFO_DECLARATION(name) \
|
|
|
|
{FUNCTION_ADDR(&Accessors::name##Getter), "Accessors::" #name "Getter"},
|
|
|
|
ACCESSOR_INFO_LIST(ACCESSOR_INFO_DECLARATION)
|
|
|
|
#undef ACCESSOR_INFO_DECLARATION
|
2016-04-20 08:01:08 +00:00
|
|
|
};
|
|
|
|
static const AccessorRefTable setters[] = {
|
2016-03-17 13:14:11 +00:00
|
|
|
#define ACCESSOR_SETTER_DECLARATION(name) \
|
|
|
|
{FUNCTION_ADDR(&Accessors::name), "Accessors::" #name},
|
2016-04-20 08:01:08 +00:00
|
|
|
ACCESSOR_SETTER_LIST(ACCESSOR_SETTER_DECLARATION)
|
2016-03-17 13:14:11 +00:00
|
|
|
#undef ACCESSOR_INFO_DECLARATION
|
|
|
|
};
|
|
|
|
|
2016-04-20 08:01:08 +00:00
|
|
|
for (unsigned i = 0; i < arraysize(getters); ++i) {
|
|
|
|
Add(getters[i].address, getters[i].name);
|
|
|
|
Add(AccessorInfo::redirect(isolate, getters[i].address, ACCESSOR_GETTER),
|
2016-04-20 09:53:31 +00:00
|
|
|
"");
|
2016-04-20 08:01:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
for (unsigned i = 0; i < arraysize(setters); ++i) {
|
|
|
|
Add(setters[i].address, setters[i].name);
|
2016-03-17 13:14:11 +00:00
|
|
|
}
|
|
|
|
|
2016-07-13 10:24:55 +00:00
|
|
|
StubCache* load_stub_cache = isolate->load_stub_cache();
|
2016-03-17 13:14:11 +00:00
|
|
|
|
|
|
|
// Stub cache tables
|
2016-07-13 10:24:55 +00:00
|
|
|
Add(load_stub_cache->key_reference(StubCache::kPrimary).address(),
|
|
|
|
"Load StubCache::primary_->key");
|
|
|
|
Add(load_stub_cache->value_reference(StubCache::kPrimary).address(),
|
|
|
|
"Load StubCache::primary_->value");
|
|
|
|
Add(load_stub_cache->map_reference(StubCache::kPrimary).address(),
|
|
|
|
"Load StubCache::primary_->map");
|
|
|
|
Add(load_stub_cache->key_reference(StubCache::kSecondary).address(),
|
|
|
|
"Load StubCache::secondary_->key");
|
|
|
|
Add(load_stub_cache->value_reference(StubCache::kSecondary).address(),
|
|
|
|
"Load StubCache::secondary_->value");
|
|
|
|
Add(load_stub_cache->map_reference(StubCache::kSecondary).address(),
|
|
|
|
"Load StubCache::secondary_->map");
|
|
|
|
|
|
|
|
StubCache* store_stub_cache = isolate->store_stub_cache();
|
|
|
|
|
|
|
|
// Stub cache tables
|
|
|
|
Add(store_stub_cache->key_reference(StubCache::kPrimary).address(),
|
|
|
|
"Store StubCache::primary_->key");
|
|
|
|
Add(store_stub_cache->value_reference(StubCache::kPrimary).address(),
|
|
|
|
"Store StubCache::primary_->value");
|
|
|
|
Add(store_stub_cache->map_reference(StubCache::kPrimary).address(),
|
|
|
|
"Store StubCache::primary_->map");
|
|
|
|
Add(store_stub_cache->key_reference(StubCache::kSecondary).address(),
|
|
|
|
"Store StubCache::secondary_->key");
|
|
|
|
Add(store_stub_cache->value_reference(StubCache::kSecondary).address(),
|
|
|
|
"Store StubCache::secondary_->value");
|
|
|
|
Add(store_stub_cache->map_reference(StubCache::kSecondary).address(),
|
|
|
|
"Store StubCache::secondary_->map");
|
2016-03-17 13:14:11 +00:00
|
|
|
|
|
|
|
// Runtime entries
|
|
|
|
Add(ExternalReference::delete_handle_scope_extensions(isolate).address(),
|
|
|
|
"HandleScope::DeleteExtensions");
|
|
|
|
Add(ExternalReference::incremental_marking_record_write_function(isolate)
|
|
|
|
.address(),
|
|
|
|
"IncrementalMarking::RecordWrite");
|
|
|
|
Add(ExternalReference::incremental_marking_record_write_code_entry_function(
|
|
|
|
isolate)
|
|
|
|
.address(),
|
|
|
|
"IncrementalMarking::RecordWriteOfCodeEntryFromCode");
|
|
|
|
Add(ExternalReference::store_buffer_overflow_function(isolate).address(),
|
|
|
|
"StoreBuffer::StoreBufferOverflow");
|
|
|
|
|
|
|
|
// Add a small set of deopt entry addresses to encoder without generating the
|
|
|
|
// deopt table code, which isn't possible at deserialization time.
|
|
|
|
HandleScope scope(isolate);
|
|
|
|
for (int entry = 0; entry < kDeoptTableSerializeEntryCount; ++entry) {
|
|
|
|
Address address = Deoptimizer::GetDeoptimizationEntry(
|
|
|
|
isolate, entry, Deoptimizer::LAZY,
|
|
|
|
Deoptimizer::CALCULATE_ENTRY_ADDRESS);
|
|
|
|
Add(address, "lazy_deopt");
|
|
|
|
}
|
2016-06-20 15:28:06 +00:00
|
|
|
|
|
|
|
// Add external references provided by the embedder (a null-terminated array).
|
|
|
|
intptr_t* api_external_references = isolate->api_external_references();
|
|
|
|
if (api_external_references != nullptr) {
|
|
|
|
while (*api_external_references != 0) {
|
|
|
|
Add(reinterpret_cast<Address>(*api_external_references), "<embedder>");
|
|
|
|
api_external_references++;
|
|
|
|
}
|
|
|
|
}
|
2016-03-17 13:14:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace internal
|
|
|
|
} // namespace v8
|