| Index: runtime/vm/flow_graph_compiler_x64.cc
|
| ===================================================================
|
| --- runtime/vm/flow_graph_compiler_x64.cc (revision 8214)
|
| +++ runtime/vm/flow_graph_compiler_x64.cc (working copy)
|
| @@ -11,12 +11,9 @@
|
| #include "vm/ast_printer.h"
|
| #include "vm/code_descriptors.h"
|
| #include "vm/code_generator.h"
|
| -#include "vm/debugger.h"
|
| #include "vm/disassembler.h"
|
| #include "vm/il_printer.h"
|
| -#include "vm/intrinsifier.h"
|
| #include "vm/locations.h"
|
| -#include "vm/longjump.h"
|
| #include "vm/object_store.h"
|
| #include "vm/parser.h"
|
| #include "vm/stub_code.h"
|
| @@ -26,10 +23,7 @@
|
| DEFINE_FLAG(bool, print_scopes, false, "Print scopes of local variables.");
|
| DEFINE_FLAG(bool, trace_functions, false, "Trace entry of each function.");
|
| DECLARE_FLAG(bool, enable_type_checks);
|
| -DECLARE_FLAG(bool, intrinsify);
|
| -DECLARE_FLAG(int, optimization_counter_threshold);
|
| DECLARE_FLAG(bool, print_ast);
|
| -DECLARE_FLAG(bool, report_usage_count);
|
| DECLARE_FLAG(bool, code_comments);
|
|
|
|
|
| @@ -63,20 +57,6 @@
|
| block_order,
|
| is_optimizing) {}
|
|
|
| -
|
| -void FlowGraphCompiler::Bailout(const char* reason) {
|
| - const char* kFormat = "FlowGraphCompiler Bailout: %s %s.";
|
| - const char* function_name = parsed_function().function().ToCString();
|
| - intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1;
|
| - char* chars = reinterpret_cast<char*>(
|
| - Isolate::Current()->current_zone()->Allocate(len));
|
| - OS::SNPrint(chars, len, kFormat, function_name, reason);
|
| - const Error& error = Error::Handle(
|
| - LanguageError::New(String::Handle(String::New(chars))));
|
| - Isolate::Current()->long_jump_base()->Jump(1, error);
|
| -}
|
| -
|
| -
|
| #define __ assembler()->
|
|
|
|
|
| @@ -560,56 +540,28 @@
|
| }
|
|
|
|
|
| -void FlowGraphCompiler::EmitInstanceCall(intptr_t cid,
|
| - intptr_t token_index,
|
| - intptr_t try_index,
|
| - const String& function_name,
|
| - intptr_t argument_count,
|
| - const Array& argument_names,
|
| - intptr_t checked_argument_count) {
|
| - ICData& ic_data =
|
| - ICData::ZoneHandle(ICData::New(parsed_function().function(),
|
| - function_name,
|
| - cid,
|
| - checked_argument_count));
|
| - const Array& arguments_descriptor =
|
| - CodeGenerator::ArgumentsDescriptor(argument_count, argument_names);
|
| +intptr_t FlowGraphCompiler::EmitInstanceCall(ExternalLabel* target_label,
|
| + const ICData& ic_data,
|
| + const Array& arguments_descriptor,
|
| + intptr_t argument_count) {
|
| __ LoadObject(RBX, ic_data);
|
| __ LoadObject(R10, arguments_descriptor);
|
|
|
| - uword label_address = 0;
|
| - switch (checked_argument_count) {
|
| - case 1:
|
| - label_address = StubCode::OneArgCheckInlineCacheEntryPoint();
|
| - break;
|
| - case 2:
|
| - label_address = StubCode::TwoArgsCheckInlineCacheEntryPoint();
|
| - break;
|
| - default:
|
| - UNIMPLEMENTED();
|
| - }
|
| - ExternalLabel target_label("InlineCache", label_address);
|
| - __ call(&target_label);
|
| - AddCurrentDescriptor(PcDescriptors::kIcCall, cid, token_index, try_index);
|
| + __ call(target_label);
|
| + const intptr_t descr_offset = assembler()->CodeSize();
|
| __ Drop(argument_count);
|
| + return descr_offset;
|
| }
|
|
|
| -
|
| -void FlowGraphCompiler::EmitStaticCall(intptr_t token_index,
|
| - intptr_t try_index,
|
| - const Function& function,
|
| - intptr_t argument_count,
|
| - const Array& argument_names) {
|
| - const Array& arguments_descriptor =
|
| - CodeGenerator::ArgumentsDescriptor(argument_count, argument_names);
|
| +intptr_t FlowGraphCompiler::EmitStaticCall(const Function& function,
|
| + const Array& arguments_descriptor,
|
| + intptr_t argument_count) {
|
| __ LoadObject(RBX, function);
|
| __ LoadObject(R10, arguments_descriptor);
|
| -
|
| - GenerateCall(token_index,
|
| - try_index,
|
| - &StubCode::CallStaticFunctionLabel(),
|
| - PcDescriptors::kFuncCall);
|
| + __ call(&StubCode::CallStaticFunctionLabel());
|
| + const intptr_t descr_offset = assembler()->CodeSize();
|
| __ Drop(argument_count);
|
| + return descr_offset;
|
| }
|
|
|
|
|
| @@ -945,14 +897,6 @@
|
| }
|
|
|
|
|
| -bool FlowGraphCompiler::CanOptimize() {
|
| - return
|
| - !FLAG_report_usage_count &&
|
| - (FLAG_optimization_counter_threshold >= 0) &&
|
| - !Isolate::Current()->debugger()->IsActive();
|
| -}
|
| -
|
| -
|
| void FlowGraphCompiler::IntrinsifyGetter() {
|
| // TOS: return address.
|
| // +1 : receiver.
|
| @@ -991,31 +935,6 @@
|
| }
|
|
|
|
|
| -// Returns 'true' if code generation for this function is complete, i.e.,
|
| -// no fall-through to regular code is needed.
|
| -bool FlowGraphCompiler::TryIntrinsify() {
|
| - if (!CanOptimize()) return false;
|
| - // Intrinsification skips arguments checks, therefore disable if in checked
|
| - // mode.
|
| - if (FLAG_intrinsify && !FLAG_trace_functions && !FLAG_enable_type_checks) {
|
| - if ((parsed_function().function().kind() == RawFunction::kImplicitGetter)) {
|
| - IntrinsifyGetter();
|
| - return true;
|
| - }
|
| - if ((parsed_function().function().kind() == RawFunction::kImplicitSetter)) {
|
| - IntrinsifySetter();
|
| - return true;
|
| - }
|
| - }
|
| - // Even if an intrinsified version of the function was successfully
|
| - // generated, it may fall through to the non-intrinsified method body.
|
| - if (!FLAG_trace_functions) {
|
| - return Intrinsifier::Intrinsify(parsed_function().function(), assembler());
|
| - }
|
| - return false;
|
| -}
|
| -
|
| -
|
| void FlowGraphCompiler::CompileGraph() {
|
| InitCompiler();
|
| if (TryIntrinsify()) {
|
| @@ -1130,10 +1049,6 @@
|
| }
|
|
|
|
|
| -void FlowGraphCompiler::FinalizeComments(const Code& code) {
|
| - code.set_comments(assembler()->GetCodeComments());
|
| -}
|
| -
|
| #undef __
|
|
|
| } // namespace dart
|
|
|