From 55c077f96eef1d3edf65f4fadc64af894980fd38 Mon Sep 17 00:00:00 2001 From: "mstarzinger@chromium.org" Date: Tue, 6 May 2014 09:28:08 +0000 Subject: [PATCH] Remove broken %_Log functionality. R=yangguo@chromium.org BUG= Review URL: https://codereview.chromium.org/265283007 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@21160 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/arm/full-codegen-arm.cc | 22 ---------------- src/arm/macro-assembler-arm.cc | 13 +--------- src/arm/macro-assembler-arm.h | 4 --- src/arm64/full-codegen-arm64.cc | 22 ---------------- src/arm64/macro-assembler-arm64.cc | 9 +------ src/codegen.cc | 15 ----------- src/codegen.h | 2 -- src/flag-definitions.h | 1 - src/hydrogen.cc | 6 ----- src/ia32/full-codegen-ia32.cc | 21 --------------- src/ia32/macro-assembler-ia32.cc | 13 +--------- src/ia32/macro-assembler-ia32.h | 4 --- src/log-utils.cc | 1 - src/log-utils.h | 8 +++--- src/log.cc | 41 ------------------------------ src/log.h | 3 --- src/mips/full-codegen-mips.cc | 22 ---------------- src/mips/macro-assembler-mips.cc | 13 +--------- src/mips/macro-assembler-mips.h | 4 --- src/regexp.js | 3 --- src/runtime.cc | 13 ---------- src/runtime.h | 2 -- src/string.js | 4 --- src/x64/full-codegen-x64.cc | 21 --------------- src/x64/macro-assembler-x64.cc | 13 +--------- src/x64/macro-assembler-x64.h | 4 --- 26 files changed, 9 insertions(+), 275 deletions(-) diff --git a/src/arm/full-codegen-arm.cc b/src/arm/full-codegen-arm.cc index 08aee9c732..c22caa4a81 100644 --- a/src/arm/full-codegen-arm.cc +++ b/src/arm/full-codegen-arm.cc @@ -3329,28 +3329,6 @@ void FullCodeGenerator::EmitClassOf(CallRuntime* expr) { } -void FullCodeGenerator::EmitLog(CallRuntime* expr) { - // Conditionally generate a log call. - // Args: - // 0 (literal string): The type of logging (corresponds to the flags). - // This is used to determine whether or not to generate the log call. - // 1 (string): Format string. Access the string at argument index 2 - // with '%2s' (see Logger::LogRuntime for all the formats). - // 2 (array): Arguments to the format string. - ZoneList* args = expr->arguments(); - ASSERT_EQ(args->length(), 3); - if (CodeGenerator::ShouldGenerateLog(isolate(), args->at(0))) { - VisitForStackValue(args->at(1)); - VisitForStackValue(args->at(2)); - __ CallRuntime(Runtime::kHiddenLog, 2); - } - - // Finally, we're expected to leave a value on the top of the stack. - __ LoadRoot(r0, Heap::kUndefinedValueRootIndex); - context()->Plug(r0); -} - - void FullCodeGenerator::EmitSubString(CallRuntime* expr) { // Load the arguments on the stack and call the stub. SubStringStub stub(isolate()); diff --git a/src/arm/macro-assembler-arm.cc b/src/arm/macro-assembler-arm.cc index 5b5b7ea52c..4ffae76391 100644 --- a/src/arm/macro-assembler-arm.cc +++ b/src/arm/macro-assembler-arm.cc @@ -2447,14 +2447,6 @@ bool MacroAssembler::AllowThisStubCall(CodeStub* stub) { } -void MacroAssembler::IllegalOperation(int num_arguments) { - if (num_arguments > 0) { - add(sp, sp, Operand(num_arguments * kPointerSize)); - } - LoadRoot(r0, Heap::kUndefinedValueRootIndex); -} - - void MacroAssembler::IndexFromHash(Register hash, Register index) { // If the hash field contains an array index pick it out. The assert checks // that the constants for the maximum number of digits for an array index @@ -2650,10 +2642,7 @@ void MacroAssembler::CallRuntime(const Runtime::Function* f, // If the expected number of arguments of the runtime function is // constant, we check that the actual number of arguments match the // expectation. - if (f->nargs >= 0 && f->nargs != num_arguments) { - IllegalOperation(num_arguments); - return; - } + CHECK(f->nargs < 0 || f->nargs == num_arguments); // TODO(1236192): Most runtime routines don't need the number of // arguments passed in because it is constant. At some point we diff --git a/src/arm/macro-assembler-arm.h b/src/arm/macro-assembler-arm.h index f4a9293713..ba6f82571d 100644 --- a/src/arm/macro-assembler-arm.h +++ b/src/arm/macro-assembler-arm.h @@ -930,10 +930,6 @@ class MacroAssembler: public Assembler { } - // Generates code for reporting that an illegal operation has - // occurred. - void IllegalOperation(int num_arguments); - // Picks out an array index from the hash field. // Register use: // hash - holds the index's hash. Clobbered. diff --git a/src/arm64/full-codegen-arm64.cc b/src/arm64/full-codegen-arm64.cc index d3b1c707e3..0196e69e45 100644 --- a/src/arm64/full-codegen-arm64.cc +++ b/src/arm64/full-codegen-arm64.cc @@ -3065,28 +3065,6 @@ void FullCodeGenerator::EmitClassOf(CallRuntime* expr) { } -void FullCodeGenerator::EmitLog(CallRuntime* expr) { - // Conditionally generate a log call. - // Args: - // 0 (literal string): The type of logging (corresponds to the flags). - // This is used to determine whether or not to generate the log call. - // 1 (string): Format string. Access the string at argument index 2 - // with '%2s' (see Logger::LogRuntime for all the formats). - // 2 (array): Arguments to the format string. - ZoneList* args = expr->arguments(); - ASSERT_EQ(args->length(), 3); - if (CodeGenerator::ShouldGenerateLog(isolate(), args->at(0))) { - VisitForStackValue(args->at(1)); - VisitForStackValue(args->at(2)); - __ CallRuntime(Runtime::kHiddenLog, 2); - } - - // Finally, we're expected to leave a value on the top of the stack. - __ LoadRoot(x0, Heap::kUndefinedValueRootIndex); - context()->Plug(x0); -} - - void FullCodeGenerator::EmitSubString(CallRuntime* expr) { // Load the arguments on the stack and call the stub. SubStringStub stub(isolate()); diff --git a/src/arm64/macro-assembler-arm64.cc b/src/arm64/macro-assembler-arm64.cc index f85c28faff..00e6cd9502 100644 --- a/src/arm64/macro-assembler-arm64.cc +++ b/src/arm64/macro-assembler-arm64.cc @@ -1673,14 +1673,7 @@ void MacroAssembler::CallRuntime(const Runtime::Function* f, // Check that the number of arguments matches what the function expects. // If f->nargs is -1, the function can accept a variable number of arguments. - if (f->nargs >= 0 && f->nargs != num_arguments) { - // Illegal operation: drop the stack arguments and return undefined. - if (num_arguments > 0) { - Drop(num_arguments); - } - LoadRoot(x0, Heap::kUndefinedValueRootIndex); - return; - } + CHECK(f->nargs < 0 || f->nargs == num_arguments); // Place the necessary arguments. Mov(x0, num_arguments); diff --git a/src/codegen.cc b/src/codegen.cc index 40ce00a5e2..42e02a0aac 100644 --- a/src/codegen.cc +++ b/src/codegen.cc @@ -165,21 +165,6 @@ void CodeGenerator::PrintCode(Handle code, CompilationInfo* info) { } -bool CodeGenerator::ShouldGenerateLog(Isolate* isolate, Expression* type) { - ASSERT(type != NULL); - if (!isolate->logger()->is_logging() && - !isolate->cpu_profiler()->is_profiling()) { - return false; - } - Handle name = Handle::cast(type->AsLiteral()->value()); - if (FLAG_log_regexp) { - if (name->IsOneByteEqualTo(STATIC_ASCII_VECTOR("regexp"))) - return true; - } - return false; -} - - bool CodeGenerator::RecordPositions(MacroAssembler* masm, int pos, bool right_here) { diff --git a/src/codegen.h b/src/codegen.h index 1e87a1b9e7..9b58930156 100644 --- a/src/codegen.h +++ b/src/codegen.h @@ -79,8 +79,6 @@ class CodeGenerator { // Print the code after compiling it. static void PrintCode(Handle code, CompilationInfo* info); - static bool ShouldGenerateLog(Isolate* isolate, Expression* type); - static bool RecordPositions(MacroAssembler* masm, int pos, bool right_here = false); diff --git a/src/flag-definitions.h b/src/flag-definitions.h index 32bd20e131..217b2b359b 100644 --- a/src/flag-definitions.h +++ b/src/flag-definitions.h @@ -776,7 +776,6 @@ DEFINE_bool(trace_regexp_assembler, false, DEFINE_bool(log, false, "Minimal logging (no API, code, GC, suspect, or handles samples).") DEFINE_bool(log_all, false, "Log all events to the log file.") -DEFINE_bool(log_runtime, false, "Activate runtime system %Log call.") DEFINE_bool(log_api, false, "Log API events to the log file.") DEFINE_bool(log_code, false, "Log code events to the log file without profiling.") diff --git a/src/hydrogen.cc b/src/hydrogen.cc index 787428d7a3..532600d7e9 100644 --- a/src/hydrogen.cc +++ b/src/hydrogen.cc @@ -10796,12 +10796,6 @@ void HOptimizedGraphBuilder::GenerateObjectEquals(CallRuntime* call) { } -void HOptimizedGraphBuilder::GenerateLog(CallRuntime* call) { - // %_Log is ignored in optimized code. - return ast_context()->ReturnValue(graph()->GetConstantUndefined()); -} - - // Fast support for StringAdd. void HOptimizedGraphBuilder::GenerateStringAdd(CallRuntime* call) { ASSERT_EQ(2, call->arguments()->length()); diff --git a/src/ia32/full-codegen-ia32.cc b/src/ia32/full-codegen-ia32.cc index 5696764be3..63c3ee6014 100644 --- a/src/ia32/full-codegen-ia32.cc +++ b/src/ia32/full-codegen-ia32.cc @@ -3279,27 +3279,6 @@ void FullCodeGenerator::EmitClassOf(CallRuntime* expr) { } -void FullCodeGenerator::EmitLog(CallRuntime* expr) { - // Conditionally generate a log call. - // Args: - // 0 (literal string): The type of logging (corresponds to the flags). - // This is used to determine whether or not to generate the log call. - // 1 (string): Format string. Access the string at argument index 2 - // with '%2s' (see Logger::LogRuntime for all the formats). - // 2 (array): Arguments to the format string. - ZoneList* args = expr->arguments(); - ASSERT_EQ(args->length(), 3); - if (CodeGenerator::ShouldGenerateLog(isolate(), args->at(0))) { - VisitForStackValue(args->at(1)); - VisitForStackValue(args->at(2)); - __ CallRuntime(Runtime::kHiddenLog, 2); - } - // Finally, we're expected to leave a value on the top of the stack. - __ mov(eax, isolate()->factory()->undefined_value()); - context()->Plug(eax); -} - - void FullCodeGenerator::EmitSubString(CallRuntime* expr) { // Load the arguments on the stack and call the stub. SubStringStub stub(isolate()); diff --git a/src/ia32/macro-assembler-ia32.cc b/src/ia32/macro-assembler-ia32.cc index bee6268ada..f27927de96 100644 --- a/src/ia32/macro-assembler-ia32.cc +++ b/src/ia32/macro-assembler-ia32.cc @@ -2179,14 +2179,6 @@ bool MacroAssembler::AllowThisStubCall(CodeStub* stub) { } -void MacroAssembler::IllegalOperation(int num_arguments) { - if (num_arguments > 0) { - add(esp, Immediate(num_arguments * kPointerSize)); - } - mov(eax, Immediate(isolate()->factory()->undefined_value())); -} - - void MacroAssembler::IndexFromHash(Register hash, Register index) { // The assert checks that the constants for the maximum number of digits // for an array index cached in the hash field and the number of bits @@ -2212,10 +2204,7 @@ void MacroAssembler::CallRuntime(const Runtime::Function* f, // If the expected number of arguments of the runtime function is // constant, we check that the actual number of arguments match the // expectation. - if (f->nargs >= 0 && f->nargs != num_arguments) { - IllegalOperation(num_arguments); - return; - } + CHECK(f->nargs < 0 || f->nargs == num_arguments); // TODO(1236192): Most runtime routines don't need the number of // arguments passed in because it is constant. At some point we diff --git a/src/ia32/macro-assembler-ia32.h b/src/ia32/macro-assembler-ia32.h index f13444ab0e..f8c2401323 100644 --- a/src/ia32/macro-assembler-ia32.h +++ b/src/ia32/macro-assembler-ia32.h @@ -702,10 +702,6 @@ class MacroAssembler: public Assembler { Label* miss, bool miss_on_bound_function = false); - // Generates code for reporting that an illegal operation has - // occurred. - void IllegalOperation(int num_arguments); - // Picks out an array index from the hash field. // Register use: // hash - holds the index's hash. Clobbered. diff --git a/src/log-utils.cc b/src/log-utils.cc index eb757c7b4d..687578847d 100644 --- a/src/log-utils.cc +++ b/src/log-utils.cc @@ -28,7 +28,6 @@ void Log::Initialize(const char* log_file_name) { // --log-all enables all the log flags. if (FLAG_log_all) { - FLAG_log_runtime = true; FLAG_log_api = true; FLAG_log_code = true; FLAG_log_gc = true; diff --git a/src/log-utils.h b/src/log-utils.h index 1458d3a5f5..deb3f7c483 100644 --- a/src/log-utils.h +++ b/src/log-utils.h @@ -22,10 +22,10 @@ class Log { void stop() { is_stopped_ = true; } static bool InitLogAtStart() { - return FLAG_log || FLAG_log_runtime || FLAG_log_api - || FLAG_log_code || FLAG_log_gc || FLAG_log_handles || FLAG_log_suspect - || FLAG_log_regexp || FLAG_ll_prof || FLAG_perf_basic_prof - || FLAG_perf_jit_prof || FLAG_log_internal_timer_events; + return FLAG_log || FLAG_log_api || FLAG_log_code || FLAG_log_gc + || FLAG_log_handles || FLAG_log_suspect || FLAG_log_regexp + || FLAG_ll_prof || FLAG_perf_basic_prof || FLAG_perf_jit_prof + || FLAG_log_internal_timer_events; } // Frees all resources acquired in Initialize and Open... functions. diff --git a/src/log.cc b/src/log.cc index ecacad1fdb..88dae56b7b 100644 --- a/src/log.cc +++ b/src/log.cc @@ -1178,47 +1178,6 @@ void Logger::RegExpCompileEvent(Handle regexp, bool in_cache) { } -void Logger::LogRuntime(Vector format, - Handle args) { - if (!log_->IsEnabled() || !FLAG_log_runtime) return; - Log::MessageBuilder msg(log_); - for (int i = 0; i < format.length(); i++) { - char c = format[i]; - if (c == '%' && i <= format.length() - 2) { - i++; - ASSERT('0' <= format[i] && format[i] <= '9'); - // No exception expected when getting an element from an array literal. - Handle obj = Object::GetElement( - isolate_, args, format[i] - '0').ToHandleChecked(); - i++; - switch (format[i]) { - case 's': - msg.AppendDetailed(String::cast(*obj), false); - break; - case 'S': - msg.AppendDetailed(String::cast(*obj), true); - break; - case 'r': - Logger::LogRegExpSource(Handle::cast(obj)); - break; - case 'x': - msg.Append("0x%x", Smi::cast(*obj)->value()); - break; - case 'i': - msg.Append("%i", Smi::cast(*obj)->value()); - break; - default: - UNREACHABLE(); - } - } else { - msg.Append(c); - } - } - msg.Append('\n'); - msg.WriteToLogFile(); -} - - void Logger::ApiIndexedSecurityCheck(uint32_t index) { if (!log_->IsEnabled() || !FLAG_log_api) return; ApiEvent("api,check-security,%u\n", index); diff --git a/src/log.h b/src/log.h index f307d91891..b1a41e949f 100644 --- a/src/log.h +++ b/src/log.h @@ -326,9 +326,6 @@ class Logger { void RegExpCompileEvent(Handle regexp, bool in_cache); - // Log an event reported from generated code - void LogRuntime(Vector format, Handle args); - bool is_logging() { return is_logging_; } diff --git a/src/mips/full-codegen-mips.cc b/src/mips/full-codegen-mips.cc index 0f2f712b41..ff280ce76c 100644 --- a/src/mips/full-codegen-mips.cc +++ b/src/mips/full-codegen-mips.cc @@ -3348,28 +3348,6 @@ void FullCodeGenerator::EmitClassOf(CallRuntime* expr) { } -void FullCodeGenerator::EmitLog(CallRuntime* expr) { - // Conditionally generate a log call. - // Args: - // 0 (literal string): The type of logging (corresponds to the flags). - // This is used to determine whether or not to generate the log call. - // 1 (string): Format string. Access the string at argument index 2 - // with '%2s' (see Logger::LogRuntime for all the formats). - // 2 (array): Arguments to the format string. - ZoneList* args = expr->arguments(); - ASSERT_EQ(args->length(), 3); - if (CodeGenerator::ShouldGenerateLog(isolate(), args->at(0))) { - VisitForStackValue(args->at(1)); - VisitForStackValue(args->at(2)); - __ CallRuntime(Runtime::kHiddenLog, 2); - } - - // Finally, we're expected to leave a value on the top of the stack. - __ LoadRoot(v0, Heap::kUndefinedValueRootIndex); - context()->Plug(v0); -} - - void FullCodeGenerator::EmitSubString(CallRuntime* expr) { // Load the arguments on the stack and call the stub. SubStringStub stub(isolate()); diff --git a/src/mips/macro-assembler-mips.cc b/src/mips/macro-assembler-mips.cc index d63af7e867..2bf4d157c3 100644 --- a/src/mips/macro-assembler-mips.cc +++ b/src/mips/macro-assembler-mips.cc @@ -4015,14 +4015,6 @@ bool MacroAssembler::AllowThisStubCall(CodeStub* stub) { } -void MacroAssembler::IllegalOperation(int num_arguments) { - if (num_arguments > 0) { - addiu(sp, sp, num_arguments * kPointerSize); - } - LoadRoot(v0, Heap::kUndefinedValueRootIndex); -} - - void MacroAssembler::IndexFromHash(Register hash, Register index) { // If the hash field contains an array index pick it out. The assert checks @@ -4177,10 +4169,7 @@ void MacroAssembler::CallRuntime(const Runtime::Function* f, // If the expected number of arguments of the runtime function is // constant, we check that the actual number of arguments match the // expectation. - if (f->nargs >= 0 && f->nargs != num_arguments) { - IllegalOperation(num_arguments); - return; - } + CHECK(f->nargs < 0 || f->nargs == num_arguments); // TODO(1236192): Most runtime routines don't need the number of // arguments passed in because it is constant. At some point we diff --git a/src/mips/macro-assembler-mips.h b/src/mips/macro-assembler-mips.h index 5c20a1514b..acf62f25b5 100644 --- a/src/mips/macro-assembler-mips.h +++ b/src/mips/macro-assembler-mips.h @@ -1048,10 +1048,6 @@ class MacroAssembler: public Assembler { Handle success, SmiCheckType smi_check_type); - // Generates code for reporting that an illegal operation has - // occurred. - void IllegalOperation(int num_arguments); - // Load and check the instance type of an object for being a string. // Loads the type into the second argument register. diff --git a/src/regexp.js b/src/regexp.js index e9aefd1d8c..6a0e2b5d92 100644 --- a/src/regexp.js +++ b/src/regexp.js @@ -162,7 +162,6 @@ function RegExpExec(string) { i = 0; } - %_Log('regexp', 'regexp-exec,%0r,%1S,%2i', [this, string, lastIndex]); // matchIndices is either null or the lastMatchInfo array. var matchIndices = %_RegExpExec(this, string, i, lastMatchInfo); @@ -206,7 +205,6 @@ function RegExpTest(string) { this.lastIndex = 0; return false; } - %_Log('regexp', 'regexp-exec,%0r,%1S,%2i', [this, string, lastIndex]); // matchIndices is either null or the lastMatchInfo array. var matchIndices = %_RegExpExec(this, string, i, lastMatchInfo); if (IS_NULL(matchIndices)) { @@ -227,7 +225,6 @@ function RegExpTest(string) { %_StringCharCodeAt(regexp.source, 2) != 63) { // '?' regexp = TrimRegExp(regexp); } - %_Log('regexp', 'regexp-exec,%0r,%1S,%2i', [regexp, string, lastIndex]); // matchIndices is either null or the lastMatchInfo array. var matchIndices = %_RegExpExec(regexp, string, 0, lastMatchInfo); if (IS_NULL(matchIndices)) { diff --git a/src/runtime.cc b/src/runtime.cc index e5df51e2e1..b82d377f71 100644 --- a/src/runtime.cc +++ b/src/runtime.cc @@ -14799,19 +14799,6 @@ RUNTIME_FUNCTION(Runtime_ListNatives) { #endif -RUNTIME_FUNCTION(RuntimeHidden_Log) { - HandleScope handle_scope(isolate); - ASSERT(args.length() == 2); - CONVERT_ARG_HANDLE_CHECKED(String, format, 0); - CONVERT_ARG_HANDLE_CHECKED(JSArray, elms, 1); - - SmartArrayPointer format_chars = format->ToCString(); - isolate->logger()->LogRuntime( - Vector(format_chars.get(), format->length()), elms); - return isolate->heap()->undefined_value(); -} - - RUNTIME_FUNCTION(Runtime_IS_VAR) { UNREACHABLE(); // implemented as macro in the parser return NULL; diff --git a/src/runtime.h b/src/runtime.h index acbe20153d..38d2126f0e 100644 --- a/src/runtime.h +++ b/src/runtime.h @@ -544,7 +544,6 @@ namespace internal { F(SubString, 3, 1) \ F(StringCompare, 2, 1) \ F(StringCharCodeAt, 2, 1) \ - F(Log, 3, 1) \ F(GetFromCache, 2, 1) \ \ /* Compilation */ \ @@ -657,7 +656,6 @@ namespace internal { F(DebugBreakInOptimizedCode, 0, 1) \ F(ClassOf, 1, 1) \ F(StringCharCodeAt, 2, 1) \ - F(Log, 3, 1) \ F(StringAdd, 2, 1) \ F(SubString, 3, 1) \ F(StringCompare, 2, 1) \ diff --git a/src/string.js b/src/string.js index a94e87d4f4..9c90427835 100644 --- a/src/string.js +++ b/src/string.js @@ -150,7 +150,6 @@ function StringMatch(regexp) { var lastIndex = regexp.lastIndex; TO_INTEGER_FOR_SIDE_EFFECT(lastIndex); if (!regexp.global) return RegExpExecNoTests(regexp, subject, 0); - %_Log('regexp', 'regexp-match,%0S,%1r', [subject, regexp]); // lastMatchInfo is defined in regexp.js. var result = %StringMatch(subject, regexp, lastMatchInfo); if (result !== null) lastMatchInfoOverride = null; @@ -221,7 +220,6 @@ function StringReplace(search, replace) { // value is discarded. var lastIndex = search.lastIndex; TO_INTEGER_FOR_SIDE_EFFECT(lastIndex); - %_Log('regexp', 'regexp-replace,%0r,%1S', [search, subject]); if (!IS_SPEC_FUNCTION(replace)) { replace = TO_STRING_INLINE(replace); @@ -623,8 +621,6 @@ function StringSplit(separator, limit) { var ArrayPushBuiltin = $Array.prototype.push; function StringSplitOnRegExp(subject, separator, limit, length) { - %_Log('regexp', 'regexp-split,%0S,%1r', [subject, separator]); - if (length === 0) { if (DoRegExpExec(separator, subject, 0, 0) != null) { return []; diff --git a/src/x64/full-codegen-x64.cc b/src/x64/full-codegen-x64.cc index 1e3b87e67e..475080553a 100644 --- a/src/x64/full-codegen-x64.cc +++ b/src/x64/full-codegen-x64.cc @@ -3268,27 +3268,6 @@ void FullCodeGenerator::EmitClassOf(CallRuntime* expr) { } -void FullCodeGenerator::EmitLog(CallRuntime* expr) { - // Conditionally generate a log call. - // Args: - // 0 (literal string): The type of logging (corresponds to the flags). - // This is used to determine whether or not to generate the log call. - // 1 (string): Format string. Access the string at argument index 2 - // with '%2s' (see Logger::LogRuntime for all the formats). - // 2 (array): Arguments to the format string. - ZoneList* args = expr->arguments(); - ASSERT_EQ(args->length(), 3); - if (CodeGenerator::ShouldGenerateLog(isolate(), args->at(0))) { - VisitForStackValue(args->at(1)); - VisitForStackValue(args->at(2)); - __ CallRuntime(Runtime::kHiddenLog, 2); - } - // Finally, we're expected to leave a value on the top of the stack. - __ LoadRoot(rax, Heap::kUndefinedValueRootIndex); - context()->Plug(rax); -} - - void FullCodeGenerator::EmitSubString(CallRuntime* expr) { // Load the arguments on the stack and call the stub. SubStringStub stub(isolate()); diff --git a/src/x64/macro-assembler-x64.cc b/src/x64/macro-assembler-x64.cc index 2eb74e55f0..17db9bf1a5 100644 --- a/src/x64/macro-assembler-x64.cc +++ b/src/x64/macro-assembler-x64.cc @@ -542,14 +542,6 @@ bool MacroAssembler::AllowThisStubCall(CodeStub* stub) { } -void MacroAssembler::IllegalOperation(int num_arguments) { - if (num_arguments > 0) { - addp(rsp, Immediate(num_arguments * kPointerSize)); - } - LoadRoot(rax, Heap::kUndefinedValueRootIndex); -} - - void MacroAssembler::IndexFromHash(Register hash, Register index) { // The assert checks that the constants for the maximum number of digits // for an array index cached in the hash field and the number of bits @@ -575,10 +567,7 @@ void MacroAssembler::CallRuntime(const Runtime::Function* f, // If the expected number of arguments of the runtime function is // constant, we check that the actual number of arguments match the // expectation. - if (f->nargs >= 0 && f->nargs != num_arguments) { - IllegalOperation(num_arguments); - return; - } + CHECK(f->nargs < 0 || f->nargs == num_arguments); // TODO(1236192): Most runtime routines don't need the number of // arguments passed in because it is constant. At some point we diff --git a/src/x64/macro-assembler-x64.h b/src/x64/macro-assembler-x64.h index ee143f9fe4..d9893d6210 100644 --- a/src/x64/macro-assembler-x64.h +++ b/src/x64/macro-assembler-x64.h @@ -1205,10 +1205,6 @@ class MacroAssembler: public Assembler { Label* miss, bool miss_on_bound_function = false); - // Generates code for reporting that an illegal operation has - // occurred. - void IllegalOperation(int num_arguments); - // Picks out an array index from the hash field. // Register use: // hash - holds the index's hash. Clobbered.