summaryrefslogtreecommitdiff
path: root/chromium/v8/src/runtime/runtime-test.cc
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2018-05-03 13:42:47 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2018-05-15 10:27:51 +0000
commit8c5c43c7b138c9b4b0bf56d946e61d3bbc111bec (patch)
treed29d987c4d7b173cf853279b79a51598f104b403 /chromium/v8/src/runtime/runtime-test.cc
parent830c9e163d31a9180fadca926b3e1d7dfffb5021 (diff)
downloadqtwebengine-chromium-8c5c43c7b138c9b4b0bf56d946e61d3bbc111bec.tar.gz
BASELINE: Update Chromium to 66.0.3359.156
Change-Id: I0c9831ad39911a086b6377b16f995ad75a51e441 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
Diffstat (limited to 'chromium/v8/src/runtime/runtime-test.cc')
-rw-r--r--chromium/v8/src/runtime/runtime-test.cc178
1 files changed, 18 insertions, 160 deletions
diff --git a/chromium/v8/src/runtime/runtime-test.cc b/chromium/v8/src/runtime/runtime-test.cc
index 01e2b198a64..6b2f3467fc1 100644
--- a/chromium/v8/src/runtime/runtime-test.cc
+++ b/chromium/v8/src/runtime/runtime-test.cc
@@ -175,22 +175,6 @@ RUNTIME_FUNCTION(Runtime_IsConcurrentRecompilationSupported) {
isolate->concurrent_recompilation_enabled());
}
-RUNTIME_FUNCTION(Runtime_TypeProfile) {
- HandleScope scope(isolate);
- DCHECK_EQ(1, args.length());
-
- CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0);
- if (function->has_feedback_vector()) {
- FeedbackVector* vector = function->feedback_vector();
- if (vector->metadata()->HasTypeProfileSlot()) {
- FeedbackSlot slot = vector->GetTypeProfileSlot();
- CollectTypeProfileNexus nexus(vector, slot);
- return nexus.GetTypeProfile();
- }
- }
- return *isolate->factory()->NewJSObject(isolate->object_function());
-}
-
RUNTIME_FUNCTION(Runtime_OptimizeFunctionOnNextCall) {
HandleScope scope(isolate);
@@ -252,8 +236,7 @@ RUNTIME_FUNCTION(Runtime_OptimizeFunctionOnNextCall) {
: "non-concurrent");
}
- // TODO(mvstanton): pass pretenure flag to EnsureLiterals.
- JSFunction::EnsureLiterals(function);
+ JSFunction::EnsureFeedbackVector(function);
function->MarkForOptimization(concurrency_mode);
@@ -470,121 +453,6 @@ RUNTIME_FUNCTION(Runtime_ClearFunctionFeedback) {
return isolate->heap()->undefined_value();
}
-RUNTIME_FUNCTION(Runtime_CheckWasmWrapperElision) {
- // This only supports the case where the function being exported
- // calls an intermediate function, and the intermediate function
- // calls exactly one imported function
- HandleScope scope(isolate);
- CHECK_EQ(args.length(), 2);
- // It takes two parameters, the first one is the JSFunction,
- // The second one is the type
- CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0);
- // If type is 0, it means that it is supposed to be a direct call into a wasm
- // function.
- // If type is 1, it means that it is supposed to have wrappers.
- CONVERT_ARG_HANDLE_CHECKED(Smi, type, 1);
- Handle<Code> export_code = handle(function->code());
- CHECK(export_code->kind() == Code::JS_TO_WASM_FUNCTION);
- int const mask =
- RelocInfo::ModeMask(FLAG_wasm_jit_to_native ? RelocInfo::JS_TO_WASM_CALL
- : RelocInfo::CODE_TARGET);
- // check the type of the $export_fct
- wasm::WasmCode* export_fct = nullptr;
- Handle<Code> export_fct_handle;
- wasm::WasmCode* intermediate_fct = nullptr;
- Handle<Code> intermediate_fct_handle;
-
- int count = 0;
- for (RelocIterator it(*export_code, mask); !it.done(); it.next()) {
- RelocInfo* rinfo = it.rinfo();
- Address target_address = FLAG_wasm_jit_to_native
- ? rinfo->js_to_wasm_address()
- : rinfo->target_address();
- if (FLAG_wasm_jit_to_native) {
- wasm::WasmCode* target =
- isolate->wasm_engine()->code_manager()->LookupCode(target_address);
- if (target->kind() == wasm::WasmCode::kFunction) {
- ++count;
- export_fct = target;
- }
- } else {
- Code* target = Code::GetCodeFromTargetAddress(target_address);
- if (target->kind() == Code::WASM_FUNCTION) {
- ++count;
- export_fct_handle = handle(target);
- }
- }
- }
- CHECK_EQ(count, 1);
- // check the type of the intermediate_fct
- count = 0;
- if (FLAG_wasm_jit_to_native) {
- for (RelocIterator it(export_fct->instructions(), export_fct->reloc_info(),
- export_fct->constant_pool(),
- RelocInfo::ModeMask(RelocInfo::WASM_CALL));
- !it.done(); it.next()) {
- RelocInfo* rinfo = it.rinfo();
- Address target_address = rinfo->target_address();
- wasm::WasmCode* target =
- isolate->wasm_engine()->code_manager()->LookupCode(target_address);
- if (target->kind() == wasm::WasmCode::kFunction) {
- ++count;
- intermediate_fct = target;
- }
- }
- } else {
- count = 0;
- for (RelocIterator it(*export_fct_handle, mask); !it.done(); it.next()) {
- RelocInfo* rinfo = it.rinfo();
- Address target_address = rinfo->target_address();
- Code* target = Code::GetCodeFromTargetAddress(target_address);
- if (target->kind() == Code::WASM_FUNCTION) {
- ++count;
- intermediate_fct_handle = handle(target);
- }
- }
- }
- CHECK_EQ(count, 1);
- // Check the type of the imported exported function, it should be also a wasm
- // function in our case.
- CHECK(type->value() == 0 || type->value() == 1);
-
- count = 0;
- if (FLAG_wasm_jit_to_native) {
- wasm::WasmCode::Kind target_kind = type->value() == 0
- ? wasm::WasmCode::kWasmToWasmWrapper
- : wasm::WasmCode::kWasmToJsWrapper;
- for (RelocIterator it(intermediate_fct->instructions(),
- intermediate_fct->reloc_info(),
- intermediate_fct->constant_pool(),
- RelocInfo::ModeMask(RelocInfo::WASM_CALL));
- !it.done(); it.next()) {
- RelocInfo* rinfo = it.rinfo();
- Address target_address = rinfo->target_address();
- wasm::WasmCode* target =
- isolate->wasm_engine()->code_manager()->LookupCode(target_address);
- if (target->kind() == target_kind) {
- ++count;
- }
- }
- } else {
- Code::Kind target_kind = type->value() == 0 ? Code::WASM_TO_WASM_FUNCTION
- : Code::WASM_TO_JS_FUNCTION;
- count = 0;
- for (RelocIterator it(*intermediate_fct_handle, mask); !it.done();
- it.next()) {
- RelocInfo* rinfo = it.rinfo();
- Address target_address = rinfo->target_address();
- Code* target = Code::GetCodeFromTargetAddress(target_address);
- if (target->kind() == target_kind) {
- ++count;
- }
- }
- }
- CHECK_LE(count, 1);
- return isolate->heap()->ToBoolean(count == 1);
-}
-
RUNTIME_FUNCTION(Runtime_SetWasmCompileControls) {
HandleScope scope(isolate);
v8::Isolate* v8_isolate = reinterpret_cast<v8::Isolate*>(isolate);
@@ -757,6 +625,18 @@ RUNTIME_FUNCTION(Runtime_SetFlags) {
return isolate->heap()->undefined_value();
}
+RUNTIME_FUNCTION(Runtime_SetForceSlowPath) {
+ SealHandleScope shs(isolate);
+ DCHECK_EQ(1, args.length());
+ CONVERT_ARG_CHECKED(Object, arg, 0);
+ if (arg->IsTrue(isolate)) {
+ isolate->set_force_slow_path(true);
+ } else {
+ DCHECK(arg->IsFalse(isolate));
+ isolate->set_force_slow_path(false);
+ }
+ return isolate->heap()->undefined_value();
+}
RUNTIME_FUNCTION(Runtime_Abort) {
SealHandleScope shs(isolate);
@@ -774,6 +654,10 @@ RUNTIME_FUNCTION(Runtime_AbortJS) {
HandleScope scope(isolate);
DCHECK_EQ(1, args.length());
CONVERT_ARG_HANDLE_CHECKED(String, message, 0);
+ if (FLAG_disable_abortjs) {
+ base::OS::PrintError("[disabled] abort: %s\n", message->ToCString().get());
+ return nullptr;
+ }
base::OS::PrintError("abort: %s\n", message->ToCString().get());
isolate->PrintStack(stderr);
base::OS::Abort();
@@ -845,31 +729,6 @@ RUNTIME_FUNCTION(Runtime_TraceExit) {
return obj; // return TOS
}
-RUNTIME_FUNCTION(Runtime_GetExceptionDetails) {
- HandleScope shs(isolate);
- DCHECK_EQ(1, args.length());
- CONVERT_ARG_HANDLE_CHECKED(JSObject, exception_obj, 0);
-
- Factory* factory = isolate->factory();
- Handle<JSMessageObject> message_obj =
- isolate->CreateMessage(exception_obj, nullptr);
-
- Handle<JSObject> message = factory->NewJSObject(isolate->object_function());
-
- Handle<String> key;
- Handle<Object> value;
-
- key = factory->NewStringFromAsciiChecked("start_pos");
- value = handle(Smi::FromInt(message_obj->start_position()), isolate);
- JSObject::SetProperty(message, key, value, LanguageMode::kStrict).Assert();
-
- key = factory->NewStringFromAsciiChecked("end_pos");
- value = handle(Smi::FromInt(message_obj->end_position()), isolate);
- JSObject::SetProperty(message, key, value, LanguageMode::kStrict).Assert();
-
- return *message;
-}
-
RUNTIME_FUNCTION(Runtime_HaveSameMap) {
SealHandleScope shs(isolate);
DCHECK_EQ(2, args.length());
@@ -964,7 +823,6 @@ ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(DoubleElements)
ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(HoleyElements)
ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(DictionaryElements)
ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(SloppyArgumentsElements)
-ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(FixedTypedArrayElements)
// Properties test sitting with elements tests - not fooling anyone.
ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(FastProperties)
@@ -985,7 +843,7 @@ TYPED_ARRAYS(FIXED_TYPED_ARRAYS_CHECK_RUNTIME_FUNCTION)
RUNTIME_FUNCTION(Runtime_SpeciesProtector) {
SealHandleScope shs(isolate);
DCHECK_EQ(0, args.length());
- return isolate->heap()->ToBoolean(isolate->IsArraySpeciesLookupChainIntact());
+ return isolate->heap()->ToBoolean(isolate->IsSpeciesLookupChainIntact());
}
// Take a compiled wasm module, serialize it and copy the buffer into an array