| 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/globals.h" // Needed here to get TARGET_ARCH_IA32. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32. |
| 6 #if defined(TARGET_ARCH_IA32) | 6 #if defined(TARGET_ARCH_IA32) |
| 7 | 7 |
| 8 #include "vm/code_generator.h" | 8 #include "vm/code_generator.h" |
| 9 | 9 |
| 10 #include "lib/error.h" | 10 #include "lib/error.h" |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 0, | 210 0, |
| 211 -1); | 211 -1); |
| 212 __ jmp(&StubCode::FixCallersTargetLabel()); | 212 __ jmp(&StubCode::FixCallersTargetLabel()); |
| 213 } | 213 } |
| 214 | 214 |
| 215 | 215 |
| 216 void CodeGenerator::GenerateDeferredCode() { | 216 void CodeGenerator::GenerateDeferredCode() { |
| 217 } | 217 } |
| 218 | 218 |
| 219 | 219 |
| 220 // Pre entry code is called before the frame has been constructed: | |
| 221 // - check for stack overflow. | |
| 222 // - optionally count function invocations. | |
| 223 // - optionally trigger optimizing compiler if invocation threshold has been | |
| 224 // reached. | |
| 225 // Note that first 5 bytes may be patched with a jump. | |
| 226 // TODO(srdjan): Add check that no object is inlined in the first | |
| 227 // 5 bytes (length of a jump instruction). | |
| 228 void CodeGenerator::GeneratePreEntryCode() { | |
| 229 // TODO(srdjan): Still needed? | |
| 230 __ nop(5); | |
| 231 } | |
| 232 | |
| 233 | |
| 234 void CodeGenerator::FinalizePcDescriptors(const Code& code) { | 220 void CodeGenerator::FinalizePcDescriptors(const Code& code) { |
| 235 ASSERT(pc_descriptors_list_ != NULL); | 221 ASSERT(pc_descriptors_list_ != NULL); |
| 236 const PcDescriptors& descriptors = PcDescriptors::Handle( | 222 const PcDescriptors& descriptors = PcDescriptors::Handle( |
| 237 pc_descriptors_list_->FinalizePcDescriptors(code.EntryPoint())); | 223 pc_descriptors_list_->FinalizePcDescriptors(code.EntryPoint())); |
| 238 descriptors.Verify(parsed_function_.function().is_optimizable()); | 224 descriptors.Verify(parsed_function_.function().is_optimizable()); |
| 239 code.set_pc_descriptors(descriptors); | 225 code.set_pc_descriptors(descriptors); |
| 240 } | 226 } |
| 241 | 227 |
| 242 | 228 |
| 243 void CodeGenerator::FinalizeStackmaps(const Code& code) { | 229 void CodeGenerator::FinalizeStackmaps(const Code& code) { |
| (...skipping 2713 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2957 const Error& error = Error::Handle( | 2943 const Error& error = Error::Handle( |
| 2958 Parser::FormatError(script, token_index, "Error", format, args)); | 2944 Parser::FormatError(script, token_index, "Error", format, args)); |
| 2959 va_end(args); | 2945 va_end(args); |
| 2960 Isolate::Current()->long_jump_base()->Jump(1, error); | 2946 Isolate::Current()->long_jump_base()->Jump(1, error); |
| 2961 UNREACHABLE(); | 2947 UNREACHABLE(); |
| 2962 } | 2948 } |
| 2963 | 2949 |
| 2964 } // namespace dart | 2950 } // namespace dart |
| 2965 | 2951 |
| 2966 #endif // defined TARGET_ARCH_IA32 | 2952 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |