Add external references macro list

The macro list avoids duplication in external-reference-table and will
allow us to statically determine the size of the table in a follow-up.

TBR=mlippautz@chromium.org

Bug: v8:6666
Change-Id: I06bb2e8c25970b3c1047dafd6c63d7ca291fe37e
Reviewed-on: https://chromium-review.googlesource.com/956187
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51850}
This commit is contained in:
jgruber 2018-03-09 16:59:20 +01:00 committed by Commit Bot
parent f008d17c8f
commit 3b99189b5d
18 changed files with 288 additions and 583 deletions

View File

@ -1951,7 +1951,7 @@ void MacroAssembler::AssertUndefinedOrAllocationSite(Register object,
void TurboAssembler::CheckFor32DRegs(Register scratch) {
mov(scratch, Operand(ExternalReference::cpu_features()));
mov(scratch, Operand(ExternalReference::cpu_features(isolate())));
ldr(scratch, MemOperand(scratch));
tst(scratch, Operand(1u << VFP32DREGS));
}

View File

@ -5,8 +5,8 @@
#include "src/external-reference-table.h"
#include "src/accessors.h"
#include "src/assembler.h"
#include "src/counters.h"
#include "src/external-reference.h"
#include "src/ic/stub-cache.h"
#if defined(DEBUG) && defined(V8_OS_LINUX) && !defined(V8_OS_ANDROID)
@ -63,294 +63,10 @@ void ExternalReferenceTable::Add(Address address, const char* name) {
}
void ExternalReferenceTable::AddReferences(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");
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::builtins_address(isolate).address(), "builtins");
Add(ExternalReference::handle_scope_implementer_address(isolate).address(),
"Isolate::handle_scope_implementer_address");
Add(ExternalReference::pending_microtask_count_address(isolate).address(),
"Isolate::pending_microtask_count_address()");
Add(ExternalReference::interpreter_dispatch_table_address(isolate).address(),
"Interpreter::dispatch_table_address");
Add(ExternalReference::bytecode_size_table_address(isolate).address(),
"Bytecodes::bytecode_size_table_address");
Add(ExternalReference::address_of_negative_infinity().address(),
"LDoubleConstant::negative_infinity");
Add(ExternalReference::power_double_double_function(isolate).address(),
"power_double_double_function");
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");
Add(ExternalReference::ieee754_atan_function(isolate).address(),
"base::ieee754::atan");
Add(ExternalReference::ieee754_atanh_function(isolate).address(),
"base::ieee754::atanh");
Add(ExternalReference::ieee754_atan2_function(isolate).address(),
"base::ieee754::atan2");
Add(ExternalReference::ieee754_cbrt_function(isolate).address(),
"base::ieee754::cbrt");
Add(ExternalReference::ieee754_cos_function(isolate).address(),
"base::ieee754::cos");
Add(ExternalReference::ieee754_cosh_function(isolate).address(),
"base::ieee754::cosh");
Add(ExternalReference::ieee754_exp_function(isolate).address(),
"base::ieee754::exp");
Add(ExternalReference::ieee754_expm1_function(isolate).address(),
"base::ieee754::expm1");
Add(ExternalReference::ieee754_log_function(isolate).address(),
"base::ieee754::log");
Add(ExternalReference::ieee754_log1p_function(isolate).address(),
"base::ieee754::log1p");
Add(ExternalReference::ieee754_log10_function(isolate).address(),
"base::ieee754::log10");
Add(ExternalReference::ieee754_log2_function(isolate).address(),
"base::ieee754::log2");
Add(ExternalReference::ieee754_sin_function(isolate).address(),
"base::ieee754::sin");
Add(ExternalReference::ieee754_sinh_function(isolate).address(),
"base::ieee754::sinh");
Add(ExternalReference::ieee754_tan_function(isolate).address(),
"base::ieee754::tan");
Add(ExternalReference::ieee754_tanh_function(isolate).address(),
"base::ieee754::tanh");
Add(ExternalReference::store_buffer_top(isolate).address(),
"store_buffer_top");
Add(ExternalReference::heap_is_marking_flag_address(isolate).address(),
"heap_is_marking_flag_address");
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::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::is_profiling_address(isolate).address(),
"Isolate::is_profiling");
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_float64_pow(isolate).address(),
"wasm::float64_pow");
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");
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");
// If the trap handler is not supported, the optimizer will remove these
// runtime functions. In this case, the arm simulator will break if we add
// them to the external reference table.
#ifdef V8_TARGET_ARCH_X64
Add(ExternalReference::wasm_set_thread_in_wasm_flag(isolate).address(),
"wasm::set_thread_in_wasm_flag");
Add(ExternalReference::wasm_clear_thread_in_wasm_flag(isolate).address(),
"wasm::clear_thread_in_wasm_flag");
#endif
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::wasm_call_trap_callback_for_testing(isolate).address(),
"wasm::call_trap_callback_for_testing");
Add(ExternalReference::libc_memchr_function(isolate).address(),
"libc_memchr");
Add(ExternalReference::libc_memcpy_function(isolate).address(),
"libc_memcpy");
Add(ExternalReference::libc_memmove_function(isolate).address(),
"libc_memmove");
Add(ExternalReference::libc_memset_function(isolate).address(),
"libc_memset");
Add(ExternalReference::printf_function(isolate).address(), "printf");
Add(ExternalReference::try_internalize_string_function(isolate).address(),
"try_internalize_string_function");
Add(ExternalReference::check_object_type(isolate).address(),
"check_object_type");
#ifdef V8_INTL_SUPPORT
Add(ExternalReference::intl_convert_one_byte_to_lower(isolate).address(),
"intl_convert_one_byte_to_lower");
Add(ExternalReference::intl_to_latin1_lower_table(isolate).address(),
"intl_to_latin1_lower_table");
#endif // V8_INTL_SUPPORT
Add(ExternalReference::search_string_raw<const uint8_t, const uint8_t>(
isolate)
.address(),
"search_string_raw<1-byte, 1-byte>");
Add(ExternalReference::search_string_raw<const uint8_t, const uc16>(isolate)
.address(),
"search_string_raw<1-byte, 2-byte>");
Add(ExternalReference::search_string_raw<const uc16, const uint8_t>(isolate)
.address(),
"search_string_raw<2-byte, 1-byte>");
Add(ExternalReference::search_string_raw<const uc16, const uc16>(isolate)
.address(),
"search_string_raw<1-byte, 2-byte>");
Add(ExternalReference::orderedhashmap_gethash_raw(isolate).address(),
"orderedhashmap_gethash_raw");
Add(ExternalReference::get_or_create_hash_raw(isolate).address(),
"get_or_create_hash_raw");
Add(ExternalReference::jsreceiver_create_identity_hash(isolate).address(),
"jsreceiver_create_identity_hash");
Add(ExternalReference::copy_fast_number_jsarray_elements_to_typed_array(
isolate)
.address(),
"copy_fast_number_jsarray_elements_to_typed_array");
Add(ExternalReference::copy_typed_array_elements_to_typed_array(isolate)
.address(),
"copy_typed_array_elements_to_typed_array");
Add(ExternalReference::copy_typed_array_elements_slice(isolate).address(),
"copy_typed_array_elements_slice");
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::force_slow_path(isolate).address(),
"Isolate::force_slow_path_address()");
Add(ExternalReference::runtime_function_table_address(isolate).address(),
"Runtime::runtime_function_table_address()");
Add(ExternalReference::address_of_float_abs_constant().address(),
"float_absolute_constant");
Add(ExternalReference::address_of_float_neg_constant().address(),
"float_negate_constant");
Add(ExternalReference::address_of_double_abs_constant().address(),
"double_absolute_constant");
Add(ExternalReference::address_of_double_neg_constant().address(),
"double_negate_constant");
Add(ExternalReference::promise_hook_or_debug_is_active_address(isolate)
.address(),
"Isolate::promise_hook_or_debug_is_active_address()");
// Debug addresses
Add(ExternalReference::debug_is_active_address(isolate).address(),
"Debug::is_active_address()");
Add(ExternalReference::debug_hook_on_function_call_address(isolate).address(),
"Debug::hook_on_function_call_address()");
Add(ExternalReference::debug_last_step_action_address(isolate).address(),
"Debug::step_in_enabled_address()");
Add(ExternalReference::debug_suspended_generator_address(isolate).address(),
"Debug::step_suspended_generator_address()");
Add(ExternalReference::debug_restart_fp_address(isolate).address(),
"Debug::restart_fp_address()");
#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
// 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::store_buffer_overflow_function(isolate).address(),
"StoreBuffer::StoreBufferOverflow");
Add(ExternalReference::invalidate_prototype_chains_function(isolate)
.address(),
"JSObject::InvalidatePrototypeChains()");
#define ADD_EXTERNAL_REFERENCE(name, desc) \
Add(ExternalReference::name(isolate).address(), desc);
EXTERNAL_REFERENCE_LIST(ADD_EXTERNAL_REFERENCE)
#undef ADD_EXTERNAL_REFERENCE
}
void ExternalReferenceTable::AddBuiltins(Isolate* isolate) {

View File

@ -198,6 +198,13 @@ ExternalReference ExternalReference::date_cache_stamp(Isolate* isolate) {
return ExternalReference(isolate->date_cache()->stamp_address());
}
// static
ExternalReference
ExternalReference::runtime_function_table_address_for_unittests(
Isolate* isolate) {
return runtime_function_table_address(isolate);
}
void ExternalReference::set_redirector(
Isolate* isolate, ExternalReferenceRedirector* redirector) {
// We can't stack them.
@ -492,47 +499,53 @@ ExternalReference ExternalReference::address_of_pending_message_obj(
return ExternalReference(isolate->pending_message_obj_address());
}
ExternalReference ExternalReference::address_of_min_int() {
ExternalReference ExternalReference::address_of_min_int(Isolate* isolate) {
return ExternalReference(reinterpret_cast<void*>(&double_constants.min_int));
}
ExternalReference ExternalReference::address_of_one_half() {
ExternalReference ExternalReference::address_of_one_half(Isolate* isolate) {
return ExternalReference(reinterpret_cast<void*>(&double_constants.one_half));
}
ExternalReference ExternalReference::address_of_minus_one_half() {
ExternalReference ExternalReference::address_of_minus_one_half(
Isolate* isolate) {
return ExternalReference(
reinterpret_cast<void*>(&double_constants.minus_one_half));
}
ExternalReference ExternalReference::address_of_negative_infinity() {
ExternalReference ExternalReference::address_of_negative_infinity(
Isolate* isolate) {
return ExternalReference(
reinterpret_cast<void*>(&double_constants.negative_infinity));
}
ExternalReference ExternalReference::address_of_the_hole_nan() {
ExternalReference ExternalReference::address_of_the_hole_nan(Isolate* isolate) {
return ExternalReference(
reinterpret_cast<void*>(&double_constants.the_hole_nan));
}
ExternalReference ExternalReference::address_of_uint32_bias() {
ExternalReference ExternalReference::address_of_uint32_bias(Isolate* isolate) {
return ExternalReference(
reinterpret_cast<void*>(&double_constants.uint32_bias));
}
ExternalReference ExternalReference::address_of_float_abs_constant() {
ExternalReference ExternalReference::address_of_float_abs_constant(
Isolate* isolate) {
return ExternalReference(reinterpret_cast<void*>(&float_absolute_constant));
}
ExternalReference ExternalReference::address_of_float_neg_constant() {
ExternalReference ExternalReference::address_of_float_neg_constant(
Isolate* isolate) {
return ExternalReference(reinterpret_cast<void*>(&float_negate_constant));
}
ExternalReference ExternalReference::address_of_double_abs_constant() {
ExternalReference ExternalReference::address_of_double_abs_constant(
Isolate* isolate) {
return ExternalReference(reinterpret_cast<void*>(&double_absolute_constant));
}
ExternalReference ExternalReference::address_of_double_neg_constant() {
ExternalReference ExternalReference::address_of_double_neg_constant(
Isolate* isolate) {
return ExternalReference(reinterpret_cast<void*>(&double_negate_constant));
}
@ -595,7 +608,7 @@ ExternalReference ExternalReference::re_case_insensitive_compare_uc16(
FUNCTION_ADDR(NativeRegExpMacroAssembler::CaseInsensitiveCompareUC16)));
}
ExternalReference ExternalReference::re_word_character_map() {
ExternalReference ExternalReference::re_word_character_map(Isolate* isolate) {
return ExternalReference(
NativeRegExpMacroAssembler::word_character_map_address());
}
@ -761,6 +774,26 @@ ExternalReference ExternalReference::search_string_raw(Isolate* isolate) {
return ExternalReference(Redirect(isolate, FUNCTION_ADDR(f)));
}
ExternalReference ExternalReference::search_string_raw_one_one(
Isolate* isolate) {
return search_string_raw<const uint8_t, const uint8_t>(isolate);
}
ExternalReference ExternalReference::search_string_raw_one_two(
Isolate* isolate) {
return search_string_raw<const uint8_t, const uc16>(isolate);
}
ExternalReference ExternalReference::search_string_raw_two_one(
Isolate* isolate) {
return search_string_raw<const uc16, const uint8_t>(isolate);
}
ExternalReference ExternalReference::search_string_raw_two_two(
Isolate* isolate) {
return search_string_raw<const uc16, const uc16>(isolate);
}
ExternalReference ExternalReference::orderedhashmap_gethash_raw(
Isolate* isolate) {
auto f = OrderedHashMap::GetHash;
@ -842,7 +875,7 @@ ExternalReference ExternalReference::ForDeoptEntry(Address entry) {
return ExternalReference(entry);
}
ExternalReference ExternalReference::cpu_features() {
ExternalReference ExternalReference::cpu_features(Isolate* isolate) {
DCHECK(CpuFeatures::initialized_);
return ExternalReference(&CpuFeatures::supported_);
}
@ -948,7 +981,8 @@ ExternalReference ExternalReference::debug_restart_fp_address(
return ExternalReference(isolate->debug()->restart_fp_address());
}
ExternalReference ExternalReference::fixed_typed_array_base_data_offset() {
ExternalReference ExternalReference::fixed_typed_array_base_data_offset(
Isolate* isolate) {
return ExternalReference(reinterpret_cast<void*>(
FixedTypedArrayBase::kDataOffset - kHeapObjectTag));
}

View File

@ -22,11 +22,180 @@ class StatsCounter;
//------------------------------------------------------------------------------
// External references
#define EXTERNAL_REFERENCE_LIST(V) \
V(address_of_double_abs_constant, "double_absolute_constant") \
V(address_of_double_neg_constant, "double_negate_constant") \
V(address_of_float_abs_constant, "float_absolute_constant") \
V(address_of_float_neg_constant, "float_negate_constant") \
V(address_of_min_int, "LDoubleConstant::min_int") \
V(address_of_minus_one_half, "double_constants.minus_one_half") \
V(address_of_negative_infinity, "LDoubleConstant::negative_infinity") \
V(address_of_one_half, "LDoubleConstant::one_half") \
V(address_of_pending_message_obj, "address_of_pending_message_obj") \
V(address_of_real_stack_limit, "StackGuard::address_of_real_jslimit()") \
V(address_of_stack_limit, "StackGuard::address_of_jslimit()") \
V(address_of_the_hole_nan, "the_hole_nan") \
V(address_of_uint32_bias, "uint32_bias") \
V(allocation_sites_list_address, "Heap::allocation_sites_list_address()") \
V(builtins_address, "builtins") \
V(bytecode_size_table_address, "Bytecodes::bytecode_size_table_address") \
V(check_object_type, "check_object_type") \
V(compute_output_frames_function, "Deoptimizer::ComputeOutputFrames()") \
V(copy_fast_number_jsarray_elements_to_typed_array, \
"copy_fast_number_jsarray_elements_to_typed_array") \
V(copy_typed_array_elements_slice, "copy_typed_array_elements_slice") \
V(copy_typed_array_elements_to_typed_array, \
"copy_typed_array_elements_to_typed_array") \
V(cpu_features, "cpu_features") \
V(date_cache_stamp, "date_cache_stamp") \
V(debug_hook_on_function_call_address, \
"Debug::hook_on_function_call_address()") \
V(debug_is_active_address, "Debug::is_active_address()") \
V(debug_last_step_action_address, "Debug::step_in_enabled_address()") \
V(debug_restart_fp_address, "Debug::restart_fp_address()") \
V(debug_suspended_generator_address, \
"Debug::step_suspended_generator_address()") \
V(delete_handle_scope_extensions, "HandleScope::DeleteExtensions") \
V(f64_acos_wrapper_function, "f64_acos_wrapper") \
V(f64_asin_wrapper_function, "f64_asin_wrapper") \
V(f64_mod_wrapper_function, "f64_mod_wrapper") \
V(fixed_typed_array_base_data_offset, "fixed_typed_array_base_data_offset") \
V(force_slow_path, "Isolate::force_slow_path_address()") \
V(get_date_field_function, "JSDate::GetField") \
V(get_or_create_hash_raw, "get_or_create_hash_raw") \
V(handle_scope_implementer_address, \
"Isolate::handle_scope_implementer_address") \
V(handle_scope_level_address, "HandleScope::level") \
V(handle_scope_limit_address, "HandleScope::limit") \
V(handle_scope_next_address, "HandleScope::next") \
V(heap_is_marking_flag_address, "heap_is_marking_flag_address") \
V(ieee754_acos_function, "base::ieee754::acos") \
V(ieee754_acosh_function, "base::ieee754::acosh") \
V(ieee754_asin_function, "base::ieee754::asin") \
V(ieee754_asinh_function, "base::ieee754::asinh") \
V(ieee754_atan2_function, "base::ieee754::atan2") \
V(ieee754_atan_function, "base::ieee754::atan") \
V(ieee754_atanh_function, "base::ieee754::atanh") \
V(ieee754_cbrt_function, "base::ieee754::cbrt") \
V(ieee754_cos_function, "base::ieee754::cos") \
V(ieee754_cosh_function, "base::ieee754::cosh") \
V(ieee754_exp_function, "base::ieee754::exp") \
V(ieee754_expm1_function, "base::ieee754::expm1") \
V(ieee754_log10_function, "base::ieee754::log10") \
V(ieee754_log1p_function, "base::ieee754::log1p") \
V(ieee754_log2_function, "base::ieee754::log2") \
V(ieee754_log_function, "base::ieee754::log") \
V(ieee754_sin_function, "base::ieee754::sin") \
V(ieee754_sinh_function, "base::ieee754::sinh") \
V(ieee754_tan_function, "base::ieee754::tan") \
V(ieee754_tanh_function, "base::ieee754::tanh") \
V(incremental_marking_record_write_function, \
"IncrementalMarking::RecordWrite") \
V(interpreter_dispatch_counters, "Interpreter::dispatch_counters") \
V(interpreter_dispatch_table_address, "Interpreter::dispatch_table_address") \
V(invalidate_prototype_chains_function, \
"JSObject::InvalidatePrototypeChains()") \
V(invoke_accessor_getter_callback, "InvokeAccessorGetterCallback") \
V(invoke_function_callback, "InvokeFunctionCallback") \
V(isolate_address, "isolate") \
V(is_profiling_address, "Isolate::is_profiling") \
V(jsreceiver_create_identity_hash, "jsreceiver_create_identity_hash") \
V(libc_memchr_function, "libc_memchr") \
V(libc_memcpy_function, "libc_memcpy") \
V(libc_memmove_function, "libc_memmove") \
V(libc_memset_function, "libc_memset") \
V(log_enter_external_function, "Logger::EnterExternal") \
V(log_leave_external_function, "Logger::LeaveExternal") \
V(mod_two_doubles_operation, "mod_two_doubles") \
V(new_deoptimizer_function, "Deoptimizer::New()") \
V(new_space_allocation_limit_address, \
"Heap::NewSpaceAllocationLimitAddress()") \
V(new_space_allocation_top_address, "Heap::NewSpaceAllocationTopAddress()") \
V(old_space_allocation_limit_address, \
"Heap::OldSpaceAllocationLimitAddress") \
V(old_space_allocation_top_address, "Heap::OldSpaceAllocationTopAddress") \
V(orderedhashmap_gethash_raw, "orderedhashmap_gethash_raw") \
V(pending_microtask_count_address, \
"Isolate::pending_microtask_count_address()") \
V(power_double_double_function, "power_double_double_function") \
V(printf_function, "printf") \
V(promise_hook_or_debug_is_active_address, \
"Isolate::promise_hook_or_debug_is_active_address()") \
V(roots_array_start, "Heap::roots_array_start()") \
V(runtime_function_table_address, \
"Runtime::runtime_function_table_address()") \
V(scheduled_exception_address, "Isolate::scheduled_exception") \
V(search_string_raw_one_one, "search_string_raw_one_one") \
V(search_string_raw_one_two, "search_string_raw_one_two") \
V(search_string_raw_two_one, "search_string_raw_two_one") \
V(search_string_raw_two_two, "search_string_raw_two_two") \
V(store_buffer_overflow_function, "StoreBuffer::StoreBufferOverflow") \
V(store_buffer_top, "store_buffer_top") \
V(stress_deopt_count, "Isolate::stress_deopt_count_address()") \
V(try_internalize_string_function, "try_internalize_string_function") \
V(wasm_call_trap_callback_for_testing, \
"wasm::call_trap_callback_for_testing") \
V(wasm_clear_thread_in_wasm_flag, "wasm::clear_thread_in_wasm_flag") \
V(wasm_f32_ceil, "wasm::f32_ceil_wrapper") \
V(wasm_f32_floor, "wasm::f32_floor_wrapper") \
V(wasm_f32_nearest_int, "wasm::f32_nearest_int_wrapper") \
V(wasm_f32_trunc, "wasm::f32_trunc_wrapper") \
V(wasm_f64_ceil, "wasm::f64_ceil_wrapper") \
V(wasm_f64_floor, "wasm::f64_floor_wrapper") \
V(wasm_f64_nearest_int, "wasm::f64_nearest_int_wrapper") \
V(wasm_f64_trunc, "wasm::f64_trunc_wrapper") \
V(wasm_float32_to_int64, "wasm::float32_to_int64_wrapper") \
V(wasm_float32_to_uint64, "wasm::float32_to_uint64_wrapper") \
V(wasm_float64_pow, "wasm::float64_pow") \
V(wasm_float64_to_int64, "wasm::float64_to_int64_wrapper") \
V(wasm_float64_to_uint64, "wasm::float64_to_uint64_wrapper") \
V(wasm_int64_div, "wasm::int64_div") \
V(wasm_int64_mod, "wasm::int64_mod") \
V(wasm_int64_to_float32, "wasm::int64_to_float32_wrapper") \
V(wasm_int64_to_float64, "wasm::int64_to_float64_wrapper") \
V(wasm_set_thread_in_wasm_flag, "wasm::set_thread_in_wasm_flag") \
V(wasm_uint64_div, "wasm::uint64_div") \
V(wasm_uint64_mod, "wasm::uint64_mod") \
V(wasm_uint64_to_float32, "wasm::uint64_to_float32_wrapper") \
V(wasm_uint64_to_float64, "wasm::uint64_to_float64_wrapper") \
V(wasm_word32_ctz, "wasm::word32_ctz") \
V(wasm_word32_popcnt, "wasm::word32_popcnt") \
V(wasm_word32_rol, "wasm::word32_rol") \
V(wasm_word32_ror, "wasm::word32_ror") \
V(wasm_word64_ctz, "wasm::word64_ctz") \
V(wasm_word64_popcnt, "wasm::word64_popcnt") \
EXTERNAL_REFERENCE_LIST_NON_INTERPRETED_REGEXP(V) \
EXTERNAL_REFERENCE_LIST_INTL(V)
#ifndef V8_INTERPRETED_REGEXP
#define EXTERNAL_REFERENCE_LIST_NON_INTERPRETED_REGEXP(V) \
V(address_of_regexp_stack_limit, "RegExpStack::limit_address()") \
V(address_of_regexp_stack_memory_address, "RegExpStack::memory_address()") \
V(address_of_regexp_stack_memory_size, "RegExpStack::memory_size()") \
V(address_of_static_offsets_vector, "OffsetsVector::static_offsets_vector") \
V(re_case_insensitive_compare_uc16, \
"NativeRegExpMacroAssembler::CaseInsensitiveCompareUC16()") \
V(re_check_stack_guard_state, \
"RegExpMacroAssembler*::CheckStackGuardState()") \
V(re_grow_stack, "NativeRegExpMacroAssembler::GrowStack()") \
V(re_word_character_map, "NativeRegExpMacroAssembler::word_character_map")
#else
#define EXTERNAL_REFERENCE_LIST_NON_INTERPRETED_REGEXP(V)
#endif // V8_INTERPRETED_REGEXP
#ifdef V8_INTL_SUPPORT
#define EXTERNAL_REFERENCE_LIST_INTL(V) \
V(intl_convert_one_byte_to_lower, "intl_convert_one_byte_to_lower") \
V(intl_to_latin1_lower_table, "intl_to_latin1_lower_table")
#else
#define EXTERNAL_REFERENCE_LIST_INTL(V)
#endif // V8_INTL_SUPPORT
// An ExternalReference represents a C++ address used in the generated
// code. All references to C++ functions and variables must be encapsulated in
// an ExternalReference instance. This is done in order to track the origin of
// all external references in the code so that they can be bound to the correct
// addresses when deserializing a heap.
// code. All references to C++ functions and variables must be encapsulated
// in an ExternalReference instance. This is done in order to track the
// origin of all external references in the code so that they can be bound
// to the correct addresses when deserializing a heap.
class ExternalReference BASE_EMBEDDED {
public:
// Used in the simulator to support different native api calls.
@ -78,263 +247,36 @@ class ExternalReference BASE_EMBEDDED {
typedef void* ExternalReferenceRedirector(void* original, Type type);
ExternalReference() : address_(nullptr) {}
ExternalReference(Address address, Isolate* isolate);
ExternalReference(ApiFunction* ptr, Type type, Isolate* isolate);
ExternalReference(Runtime::FunctionId id, Isolate* isolate);
ExternalReference(const Runtime::Function* f, Isolate* isolate);
explicit ExternalReference(StatsCounter* counter);
ExternalReference(IsolateAddressId id, Isolate* isolate);
explicit ExternalReference(const SCTableReference& table_ref);
// Isolate as an external reference.
static ExternalReference isolate_address(Isolate* isolate);
// The builtins table as an external reference, used by lazy deserialization.
static ExternalReference builtins_address(Isolate* isolate);
static ExternalReference handle_scope_implementer_address(Isolate* isolate);
static ExternalReference pending_microtask_count_address(Isolate* isolate);
// One-of-a-kind references. These references are not part of a general
// pattern. This means that they have to be added to the
// ExternalReferenceTable in serialize.cc manually.
static ExternalReference interpreter_dispatch_table_address(Isolate* isolate);
static ExternalReference interpreter_dispatch_counters(Isolate* isolate);
static ExternalReference bytecode_size_table_address(Isolate* isolate);
static ExternalReference incremental_marking_record_write_function(
Isolate* isolate);
static ExternalReference store_buffer_overflow_function(Isolate* isolate);
static ExternalReference delete_handle_scope_extensions(Isolate* isolate);
static ExternalReference get_date_field_function(Isolate* isolate);
static ExternalReference date_cache_stamp(Isolate* isolate);
// Deoptimization support.
static ExternalReference new_deoptimizer_function(Isolate* isolate);
static ExternalReference compute_output_frames_function(Isolate* isolate);
static ExternalReference wasm_f32_trunc(Isolate* isolate);
static ExternalReference wasm_f32_floor(Isolate* isolate);
static ExternalReference wasm_f32_ceil(Isolate* isolate);
static ExternalReference wasm_f32_nearest_int(Isolate* isolate);
static ExternalReference wasm_f64_trunc(Isolate* isolate);
static ExternalReference wasm_f64_floor(Isolate* isolate);
static ExternalReference wasm_f64_ceil(Isolate* isolate);
static ExternalReference wasm_f64_nearest_int(Isolate* isolate);
static ExternalReference wasm_int64_to_float32(Isolate* isolate);
static ExternalReference wasm_uint64_to_float32(Isolate* isolate);
static ExternalReference wasm_int64_to_float64(Isolate* isolate);
static ExternalReference wasm_uint64_to_float64(Isolate* isolate);
static ExternalReference wasm_float32_to_int64(Isolate* isolate);
static ExternalReference wasm_float32_to_uint64(Isolate* isolate);
static ExternalReference wasm_float64_to_int64(Isolate* isolate);
static ExternalReference wasm_float64_to_uint64(Isolate* isolate);
static ExternalReference wasm_int64_div(Isolate* isolate);
static ExternalReference wasm_int64_mod(Isolate* isolate);
static ExternalReference wasm_uint64_div(Isolate* isolate);
static ExternalReference wasm_uint64_mod(Isolate* isolate);
static ExternalReference wasm_word32_ctz(Isolate* isolate);
static ExternalReference wasm_word64_ctz(Isolate* isolate);
static ExternalReference wasm_word32_popcnt(Isolate* isolate);
static ExternalReference wasm_word64_popcnt(Isolate* isolate);
static ExternalReference wasm_word32_rol(Isolate* isolate);
static ExternalReference wasm_word32_ror(Isolate* isolate);
static ExternalReference wasm_float64_pow(Isolate* isolate);
static ExternalReference wasm_set_thread_in_wasm_flag(Isolate* isolate);
static ExternalReference wasm_clear_thread_in_wasm_flag(Isolate* isolate);
static ExternalReference f64_acos_wrapper_function(Isolate* isolate);
static ExternalReference f64_asin_wrapper_function(Isolate* isolate);
static ExternalReference f64_mod_wrapper_function(Isolate* isolate);
// Trap callback function for cctest/wasm/wasm-run-utils.h
static ExternalReference wasm_call_trap_callback_for_testing(
Isolate* isolate);
// Log support.
static ExternalReference log_enter_external_function(Isolate* isolate);
static ExternalReference log_leave_external_function(Isolate* isolate);
// Static variable Heap::roots_array_start()
static ExternalReference roots_array_start(Isolate* isolate);
// Static variable Heap::allocation_sites_list_address()
static ExternalReference allocation_sites_list_address(Isolate* isolate);
// Static variable StackGuard::address_of_jslimit()
V8_EXPORT_PRIVATE static ExternalReference address_of_stack_limit(
Isolate* isolate);
// Static variable StackGuard::address_of_real_jslimit()
static ExternalReference address_of_real_stack_limit(Isolate* isolate);
// Static variable RegExpStack::limit_address()
static ExternalReference address_of_regexp_stack_limit(Isolate* isolate);
// Static variables for RegExp.
static ExternalReference address_of_static_offsets_vector(Isolate* isolate);
static ExternalReference address_of_regexp_stack_memory_address(
Isolate* isolate);
static ExternalReference address_of_regexp_stack_memory_size(
Isolate* isolate);
// Write barrier.
static ExternalReference store_buffer_top(Isolate* isolate);
static ExternalReference heap_is_marking_flag_address(Isolate* isolate);
// Used for fast allocation in generated code.
static ExternalReference new_space_allocation_top_address(Isolate* isolate);
static ExternalReference new_space_allocation_limit_address(Isolate* isolate);
static ExternalReference old_space_allocation_top_address(Isolate* isolate);
static ExternalReference old_space_allocation_limit_address(Isolate* isolate);
static ExternalReference mod_two_doubles_operation(Isolate* isolate);
static ExternalReference power_double_double_function(Isolate* isolate);
static ExternalReference handle_scope_next_address(Isolate* isolate);
static ExternalReference handle_scope_limit_address(Isolate* isolate);
static ExternalReference handle_scope_level_address(Isolate* isolate);
static ExternalReference scheduled_exception_address(Isolate* isolate);
static ExternalReference address_of_pending_message_obj(Isolate* isolate);
// Static variables containing common double constants.
static ExternalReference address_of_min_int();
static ExternalReference address_of_one_half();
static ExternalReference address_of_minus_one_half();
static ExternalReference address_of_negative_infinity();
static ExternalReference address_of_the_hole_nan();
static ExternalReference address_of_uint32_bias();
// Static variables containing simd constants.
static ExternalReference address_of_float_abs_constant();
static ExternalReference address_of_float_neg_constant();
static ExternalReference address_of_double_abs_constant();
static ExternalReference address_of_double_neg_constant();
// IEEE 754 functions.
static ExternalReference ieee754_acos_function(Isolate* isolate);
static ExternalReference ieee754_acosh_function(Isolate* isolate);
static ExternalReference ieee754_asin_function(Isolate* isolate);
static ExternalReference ieee754_asinh_function(Isolate* isolate);
static ExternalReference ieee754_atan_function(Isolate* isolate);
static ExternalReference ieee754_atanh_function(Isolate* isolate);
static ExternalReference ieee754_atan2_function(Isolate* isolate);
static ExternalReference ieee754_cbrt_function(Isolate* isolate);
static ExternalReference ieee754_cos_function(Isolate* isolate);
static ExternalReference ieee754_cosh_function(Isolate* isolate);
static ExternalReference ieee754_exp_function(Isolate* isolate);
static ExternalReference ieee754_expm1_function(Isolate* isolate);
static ExternalReference ieee754_log_function(Isolate* isolate);
static ExternalReference ieee754_log1p_function(Isolate* isolate);
static ExternalReference ieee754_log10_function(Isolate* isolate);
static ExternalReference ieee754_log2_function(Isolate* isolate);
static ExternalReference ieee754_sin_function(Isolate* isolate);
static ExternalReference ieee754_sinh_function(Isolate* isolate);
static ExternalReference ieee754_tan_function(Isolate* isolate);
static ExternalReference ieee754_tanh_function(Isolate* isolate);
static ExternalReference libc_memchr_function(Isolate* isolate);
static ExternalReference libc_memcpy_function(Isolate* isolate);
static ExternalReference libc_memmove_function(Isolate* isolate);
static ExternalReference libc_memset_function(Isolate* isolate);
static ExternalReference printf_function(Isolate* isolate);
static ExternalReference try_internalize_string_function(Isolate* isolate);
static ExternalReference check_object_type(Isolate* isolate);
#ifdef V8_INTL_SUPPORT
static ExternalReference intl_convert_one_byte_to_lower(Isolate* isolate);
static ExternalReference intl_to_latin1_lower_table(Isolate* isolate);
#endif // V8_INTL_SUPPORT
explicit ExternalReference(StatsCounter* counter);
ExternalReference(Address address, Isolate* isolate);
ExternalReference(ApiFunction* ptr, Type type, Isolate* isolate);
ExternalReference(const Runtime::Function* f, Isolate* isolate);
ExternalReference(IsolateAddressId id, Isolate* isolate);
ExternalReference(Runtime::FunctionId id, Isolate* isolate);
template <typename SubjectChar, typename PatternChar>
static ExternalReference search_string_raw(Isolate* isolate);
static ExternalReference orderedhashmap_gethash_raw(Isolate* isolate);
static ExternalReference get_or_create_hash_raw(Isolate* isolate);
static ExternalReference jsreceiver_create_identity_hash(Isolate* isolate);
static ExternalReference copy_fast_number_jsarray_elements_to_typed_array(
Isolate* isolate);
static ExternalReference copy_typed_array_elements_to_typed_array(
Isolate* isolate);
static ExternalReference copy_typed_array_elements_slice(Isolate* isolate);
static ExternalReference page_flags(Page* page);
static ExternalReference ForDeoptEntry(Address entry);
static ExternalReference cpu_features();
#define DECL_EXTERNAL_REFERENCE(name, desc) \
static ExternalReference name(Isolate* isolate);
EXTERNAL_REFERENCE_LIST(DECL_EXTERNAL_REFERENCE)
#undef DECL_EXTERNAL_REFERENCE
static ExternalReference debug_is_active_address(Isolate* isolate);
static ExternalReference debug_hook_on_function_call_address(
Isolate* isolate);
static ExternalReference is_profiling_address(Isolate* isolate);
static ExternalReference invoke_function_callback(Isolate* isolate);
static ExternalReference invoke_accessor_getter_callback(Isolate* isolate);
static ExternalReference promise_hook_or_debug_is_active_address(
Isolate* isolate);
V8_EXPORT_PRIVATE static ExternalReference runtime_function_table_address(
Isolate* isolate);
static ExternalReference invalidate_prototype_chains_function(
Isolate* isolate);
V8_EXPORT_PRIVATE V8_NOINLINE static ExternalReference
runtime_function_table_address_for_unittests(Isolate* isolate);
Address address() const { return reinterpret_cast<Address>(address_); }
// Used to read out the last step action of the debugger.
static ExternalReference debug_last_step_action_address(Isolate* isolate);
// Used to check for suspended generator, used for stepping across await call.
static ExternalReference debug_suspended_generator_address(Isolate* isolate);
// Used to store the frame pointer to drop to when restarting a frame.
static ExternalReference debug_restart_fp_address(Isolate* isolate);
#ifndef V8_INTERPRETED_REGEXP
// C functions called from RegExp generated code.
// Function NativeRegExpMacroAssembler::CaseInsensitiveCompareUC16()
static ExternalReference re_case_insensitive_compare_uc16(Isolate* isolate);
// Function RegExpMacroAssembler*::CheckStackGuardState()
static ExternalReference re_check_stack_guard_state(Isolate* isolate);
// Function NativeRegExpMacroAssembler::GrowStack()
static ExternalReference re_grow_stack(Isolate* isolate);
// byte NativeRegExpMacroAssembler::word_character_bitmap
static ExternalReference re_word_character_map();
#endif
// This lets you register a function that rewrites all external references.
// Used by the ARM simulator to catch calls to external references.
static void set_redirector(Isolate* isolate,
ExternalReferenceRedirector* redirector);
static ExternalReference stress_deopt_count(Isolate* isolate);
static ExternalReference force_slow_path(Isolate* isolate);
static ExternalReference fixed_typed_array_base_data_offset();
private:
explicit ExternalReference(void* address) : address_(address) {}

View File

@ -3198,7 +3198,8 @@ AllocationResult Heap::AllocateFixedTypedArray(int length,
FixedTypedArrayBase* elements = FixedTypedArrayBase::cast(object);
elements->set_base_pointer(elements, SKIP_WRITE_BARRIER);
elements->set_external_pointer(
ExternalReference::fixed_typed_array_base_data_offset().address(),
ExternalReference::fixed_typed_array_base_data_offset(isolate())
.address(),
SKIP_WRITE_BARRIER);
elements->set_length(length);
if (initialize) memset(elements->DataPtr(), 0, elements->DataSize());

View File

@ -195,7 +195,8 @@ void MacroAssembler::DoubleToI(Register result_reg, XMMRegister input_reg,
void TurboAssembler::LoadUint32(XMMRegister dst, Operand src) {
Label done;
cmp(src, Immediate(0));
ExternalReference uint32_bias = ExternalReference::address_of_uint32_bias();
ExternalReference uint32_bias =
ExternalReference::address_of_uint32_bias(isolate());
Cvtsi2sd(dst, src);
j(not_sign, &done, Label::kNear);
addsd(dst, Operand::StaticVariable(uint32_bias));

View File

@ -374,7 +374,8 @@ void FixedTypedArray<Traits>::FixedTypedArrayVerify() {
Traits::kInstanceType);
if (base_pointer() == this) {
CHECK(external_pointer() ==
ExternalReference::fixed_typed_array_base_data_offset().address());
ExternalReference::fixed_typed_array_base_data_offset(GetIsolate())
.address());
} else {
CHECK_NULL(base_pointer());
}

View File

@ -575,7 +575,7 @@ bool RegExpMacroAssemblerARM::CheckSpecialCharacterClass(uc16 type,
__ cmp(current_character(), Operand('z'));
BranchOrBacktrack(hi, on_no_match);
}
ExternalReference map = ExternalReference::re_word_character_map();
ExternalReference map = ExternalReference::re_word_character_map(isolate());
__ mov(r0, Operand(map));
__ ldrb(r0, MemOperand(r0, current_character()));
__ cmp(r0, Operand::Zero());
@ -589,7 +589,7 @@ bool RegExpMacroAssemblerARM::CheckSpecialCharacterClass(uc16 type,
__ cmp(current_character(), Operand('z'));
__ b(hi, &done);
}
ExternalReference map = ExternalReference::re_word_character_map();
ExternalReference map = ExternalReference::re_word_character_map(isolate());
__ mov(r0, Operand(map));
__ ldrb(r0, MemOperand(r0, current_character()));
__ cmp(r0, Operand::Zero());

View File

@ -650,7 +650,7 @@ bool RegExpMacroAssemblerARM64::CheckSpecialCharacterClass(uc16 type,
// Table is 256 entries, so all Latin1 characters can be tested.
CompareAndBranchOrBacktrack(current_character(), 'z', hi, on_no_match);
}
ExternalReference map = ExternalReference::re_word_character_map();
ExternalReference map = ExternalReference::re_word_character_map(isolate());
__ Mov(x10, map);
__ Ldrb(w10, MemOperand(x10, current_character(), UXTW));
CompareAndBranchOrBacktrack(w10, 0, eq, on_no_match);
@ -663,7 +663,7 @@ bool RegExpMacroAssemblerARM64::CheckSpecialCharacterClass(uc16 type,
__ Cmp(current_character(), 'z');
__ B(hi, &done);
}
ExternalReference map = ExternalReference::re_word_character_map();
ExternalReference map = ExternalReference::re_word_character_map(isolate());
__ Mov(x10, map);
__ Ldrb(w10, MemOperand(x10, current_character(), UXTW));
CompareAndBranchOrBacktrack(w10, 0, ne, on_no_match);

View File

@ -582,7 +582,8 @@ bool RegExpMacroAssemblerIA32::CheckSpecialCharacterClass(uc16 type,
BranchOrBacktrack(above, on_no_match);
}
DCHECK_EQ(0, word_character_map[0]); // Character '\0' is not a word char.
ExternalReference word_map = ExternalReference::re_word_character_map();
ExternalReference word_map =
ExternalReference::re_word_character_map(isolate());
__ test_b(current_character(),
Operand::StaticArray(current_character(), times_1, word_map));
BranchOrBacktrack(zero, on_no_match);
@ -596,7 +597,8 @@ bool RegExpMacroAssemblerIA32::CheckSpecialCharacterClass(uc16 type,
__ j(above, &done);
}
DCHECK_EQ(0, word_character_map[0]); // Character '\0' is not a word char.
ExternalReference word_map = ExternalReference::re_word_character_map();
ExternalReference word_map =
ExternalReference::re_word_character_map(isolate());
__ test_b(current_character(),
Operand::StaticArray(current_character(), times_1, word_map));
BranchOrBacktrack(not_zero, on_no_match);

View File

@ -569,7 +569,7 @@ bool RegExpMacroAssemblerMIPS::CheckSpecialCharacterClass(uc16 type,
// Table is 256 entries, so all Latin1 characters can be tested.
BranchOrBacktrack(on_no_match, hi, current_character(), Operand('z'));
}
ExternalReference map = ExternalReference::re_word_character_map();
ExternalReference map = ExternalReference::re_word_character_map(isolate());
__ li(a0, Operand(map));
__ Addu(a0, a0, current_character());
__ lbu(a0, MemOperand(a0, 0));
@ -582,7 +582,7 @@ bool RegExpMacroAssemblerMIPS::CheckSpecialCharacterClass(uc16 type,
// Table is 256 entries, so all Latin1 characters can be tested.
__ Branch(&done, hi, current_character(), Operand('z'));
}
ExternalReference map = ExternalReference::re_word_character_map();
ExternalReference map = ExternalReference::re_word_character_map(isolate());
__ li(a0, Operand(map));
__ Addu(a0, a0, current_character());
__ lbu(a0, MemOperand(a0, 0));

View File

@ -600,7 +600,7 @@ bool RegExpMacroAssemblerMIPS::CheckSpecialCharacterClass(uc16 type,
// Table is 256 entries, so all Latin1 characters can be tested.
BranchOrBacktrack(on_no_match, hi, current_character(), Operand('z'));
}
ExternalReference map = ExternalReference::re_word_character_map();
ExternalReference map = ExternalReference::re_word_character_map(isolate());
__ li(a0, Operand(map));
__ Daddu(a0, a0, current_character());
__ Lbu(a0, MemOperand(a0, 0));
@ -613,7 +613,7 @@ bool RegExpMacroAssemblerMIPS::CheckSpecialCharacterClass(uc16 type,
// Table is 256 entries, so all Latin1 characters can be tested.
__ Branch(&done, hi, current_character(), Operand('z'));
}
ExternalReference map = ExternalReference::re_word_character_map();
ExternalReference map = ExternalReference::re_word_character_map(isolate());
__ li(a0, Operand(map));
__ Daddu(a0, a0, current_character());
__ Lbu(a0, MemOperand(a0, 0));

View File

@ -591,7 +591,8 @@ bool RegExpMacroAssemblerPPC::CheckSpecialCharacterClass(uc16 type,
__ cmpi(current_character(), Operand('z'));
BranchOrBacktrack(gt, on_no_match);
}
ExternalReference map = ExternalReference::re_word_character_map();
ExternalReference map =
ExternalReference::re_word_character_map(isolate());
__ mov(r3, Operand(map));
__ lbzx(r3, MemOperand(r3, current_character()));
__ cmpli(r3, Operand::Zero());
@ -605,7 +606,8 @@ bool RegExpMacroAssemblerPPC::CheckSpecialCharacterClass(uc16 type,
__ cmpli(current_character(), Operand('z'));
__ bgt(&done);
}
ExternalReference map = ExternalReference::re_word_character_map();
ExternalReference map =
ExternalReference::re_word_character_map(isolate());
__ mov(r3, Operand(map));
__ lbzx(r3, MemOperand(r3, current_character()));
__ cmpli(r3, Operand::Zero());

View File

@ -562,7 +562,8 @@ bool RegExpMacroAssemblerS390::CheckSpecialCharacterClass(uc16 type,
__ CmpP(current_character(), Operand('z'));
BranchOrBacktrack(gt, on_no_match);
}
ExternalReference map = ExternalReference::re_word_character_map();
ExternalReference map =
ExternalReference::re_word_character_map(isolate());
__ mov(r2, Operand(map));
__ LoadlB(r2, MemOperand(r2, current_character()));
__ CmpLogicalP(r2, Operand::Zero());
@ -576,7 +577,8 @@ bool RegExpMacroAssemblerS390::CheckSpecialCharacterClass(uc16 type,
__ CmpLogicalP(current_character(), Operand('z'));
__ bgt(&done);
}
ExternalReference map = ExternalReference::re_word_character_map();
ExternalReference map =
ExternalReference::re_word_character_map(isolate());
__ mov(r2, Operand(map));
__ LoadlB(r2, MemOperand(r2, current_character()));
__ CmpLogicalP(r2, Operand::Zero());

View File

@ -623,7 +623,7 @@ bool RegExpMacroAssemblerX64::CheckSpecialCharacterClass(uc16 type,
__ cmpl(current_character(), Immediate('z'));
BranchOrBacktrack(above, on_no_match);
}
__ Move(rbx, ExternalReference::re_word_character_map());
__ Move(rbx, ExternalReference::re_word_character_map(isolate()));
DCHECK_EQ(0, word_character_map[0]); // Character '\0' is not a word char.
__ testb(Operand(rbx, current_character(), times_1, 0),
current_character());
@ -637,7 +637,7 @@ bool RegExpMacroAssemblerX64::CheckSpecialCharacterClass(uc16 type,
__ cmpl(current_character(), Immediate('z'));
__ j(above, &done);
}
__ Move(rbx, ExternalReference::re_word_character_map());
__ Move(rbx, ExternalReference::re_word_character_map(isolate()));
DCHECK_EQ(0, word_character_map[0]); // Character '\0' is not a word char.
__ testb(Operand(rbx, current_character(), times_1, 0),
current_character());

View File

@ -1178,23 +1178,23 @@ void TurboAssembler::Move(XMMRegister dst, uint64_t src) {
// ----------------------------------------------------------------------------
void MacroAssembler::Absps(XMMRegister dst) {
Andps(dst,
ExternalOperand(ExternalReference::address_of_float_abs_constant()));
Andps(dst, ExternalOperand(
ExternalReference::address_of_float_abs_constant(isolate())));
}
void MacroAssembler::Negps(XMMRegister dst) {
Xorps(dst,
ExternalOperand(ExternalReference::address_of_float_neg_constant()));
Xorps(dst, ExternalOperand(
ExternalReference::address_of_float_neg_constant(isolate())));
}
void MacroAssembler::Abspd(XMMRegister dst) {
Andps(dst,
ExternalOperand(ExternalReference::address_of_double_abs_constant()));
Andps(dst, ExternalOperand(
ExternalReference::address_of_double_abs_constant(isolate())));
}
void MacroAssembler::Negpd(XMMRegister dst) {
Xorps(dst,
ExternalOperand(ExternalReference::address_of_double_neg_constant()));
Xorps(dst, ExternalOperand(
ExternalReference::address_of_double_neg_constant(isolate())));
}
void MacroAssembler::Cmp(Register dst, Handle<Object> source) {

View File

@ -339,15 +339,17 @@ TEST(JSGraph_GetCachedNodes_number) {
TEST(JSGraph_GetCachedNodes_external) {
JSConstantCacheTester T;
Isolate* isolate = T.main_isolate();
ExternalReference constants[] = {ExternalReference::address_of_min_int(),
ExternalReference::address_of_min_int(),
ExternalReference::address_of_min_int(),
ExternalReference::address_of_one_half(),
ExternalReference::address_of_one_half(),
ExternalReference::address_of_min_int(),
ExternalReference::address_of_the_hole_nan(),
ExternalReference::address_of_one_half()};
ExternalReference constants[] = {
ExternalReference::address_of_min_int(isolate),
ExternalReference::address_of_min_int(isolate),
ExternalReference::address_of_min_int(isolate),
ExternalReference::address_of_one_half(isolate),
ExternalReference::address_of_one_half(isolate),
ExternalReference::address_of_min_int(isolate),
ExternalReference::address_of_the_hole_nan(isolate),
ExternalReference::address_of_one_half(isolate)};
for (size_t i = 0; i < arraysize(constants); i++) {
size_t count_before = T.graph()->NodeCount();
@ -366,6 +368,7 @@ TEST(JSGraph_GetCachedNodes_external) {
TEST(JSGraph_GetCachedNodes_together) {
JSConstantCacheTester T;
Isolate* isolate = T.main_isolate();
Node* constants[] = {
T.TrueConstant(),
@ -385,7 +388,7 @@ TEST(JSGraph_GetCachedNodes_together) {
T.Float64Constant(V8_INFINITY),
T.Constant(0.99),
T.Constant(1.11),
T.ExternalConstant(ExternalReference::address_of_one_half())};
T.ExternalConstant(ExternalReference::address_of_one_half(isolate))};
NodeVector nodes(T.main_zone());
T.GetCachedNodes(&nodes);

View File

@ -512,7 +512,8 @@ TARGET_TEST_F(InterpreterAssemblerTest, CallRuntime) {
Node* context = m.IntPtrConstant(4);
Matcher<Node*> function_table = c::IsExternalConstant(
ExternalReference::runtime_function_table_address(isolate()));
ExternalReference::runtime_function_table_address_for_unittests(
isolate()));
Matcher<Node*> function = c::IsIntPtrAdd(
function_table,
c::IsChangeUint32ToWord(c::IsInt32Mul(