| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/stub_code.h" | 5 #include "vm/stub_code.h" |
| 6 | 6 |
| 7 #include "platform/assert.h" | 7 #include "platform/assert.h" |
| 8 #include "platform/globals.h" | 8 #include "platform/globals.h" |
| 9 #include "vm/assembler.h" | 9 #include "vm/assembler.h" |
| 10 #include "vm/disassembler.h" | 10 #include "vm/disassembler.h" |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 OS::Print("Code for allocation stub '%s': {\n", name); | 126 OS::Print("Code for allocation stub '%s': {\n", name); |
| 127 DisassembleToStdout formatter; | 127 DisassembleToStdout formatter; |
| 128 stub.Disassemble(&formatter); | 128 stub.Disassemble(&formatter); |
| 129 OS::Print("}\n"); | 129 OS::Print("}\n"); |
| 130 } | 130 } |
| 131 } | 131 } |
| 132 return stub.raw(); | 132 return stub.raw(); |
| 133 } | 133 } |
| 134 | 134 |
| 135 | 135 |
| 136 uword StubCode::UnoptimizedStaticCallEntryPoint(intptr_t num_args_tested) { |
| 137 switch (num_args_tested) { |
| 138 case 0: |
| 139 return ZeroArgsUnoptimizedStaticCallEntryPoint(); |
| 140 case 1: |
| 141 return OneArgUnoptimizedStaticCallEntryPoint(); |
| 142 case 2: |
| 143 return TwoArgsUnoptimizedStaticCallEntryPoint(); |
| 144 default: |
| 145 UNIMPLEMENTED(); |
| 146 return 0; |
| 147 } |
| 148 } |
| 149 |
| 150 |
| 136 RawCode* StubCode::Generate(const char* name, | 151 RawCode* StubCode::Generate(const char* name, |
| 137 void (*GenerateStub)(Assembler* assembler)) { | 152 void (*GenerateStub)(Assembler* assembler)) { |
| 138 Assembler assembler; | 153 Assembler assembler; |
| 139 GenerateStub(&assembler); | 154 GenerateStub(&assembler); |
| 140 const Code& code = Code::Handle(Code::FinalizeCode(name, &assembler)); | 155 const Code& code = Code::Handle(Code::FinalizeCode(name, &assembler)); |
| 141 if (FLAG_disassemble_stubs) { | 156 if (FLAG_disassemble_stubs) { |
| 142 OS::Print("Code for stub '%s': {\n", name); | 157 OS::Print("Code for stub '%s': {\n", name); |
| 143 DisassembleToStdout formatter; | 158 DisassembleToStdout formatter; |
| 144 code.Disassemble(&formatter); | 159 code.Disassemble(&formatter); |
| 145 OS::Print("}\n"); | 160 OS::Print("}\n"); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 163 Isolate* isolate = Isolate::Current(); | 178 Isolate* isolate = Isolate::Current(); |
| 164 if ((isolate != NULL) && (isolate->stub_code() != NULL)) { | 179 if ((isolate != NULL) && (isolate->stub_code() != NULL)) { |
| 165 STUB_CODE_LIST(STUB_CODE_TESTER); | 180 STUB_CODE_LIST(STUB_CODE_TESTER); |
| 166 } | 181 } |
| 167 #undef VM_STUB_CODE_TESTER | 182 #undef VM_STUB_CODE_TESTER |
| 168 #undef STUB_CODE_TESTER | 183 #undef STUB_CODE_TESTER |
| 169 return NULL; | 184 return NULL; |
| 170 } | 185 } |
| 171 | 186 |
| 172 } // namespace dart | 187 } // namespace dart |
| OLD | NEW |