| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
| 9 | 9 |
| 10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
| 11 #include "vm/flow_graph.h" | 11 #include "vm/flow_graph.h" |
| 12 #include "vm/flow_graph_compiler.h" | 12 #include "vm/flow_graph_compiler.h" |
| 13 #include "vm/flow_graph_range_analysis.h" | 13 #include "vm/flow_graph_range_analysis.h" |
| 14 #include "vm/locations.h" | 14 #include "vm/locations.h" |
| 15 #include "vm/object_store.h" | 15 #include "vm/object_store.h" |
| 16 #include "vm/parser.h" | 16 #include "vm/parser.h" |
| 17 #include "vm/stack_frame.h" | 17 #include "vm/stack_frame.h" |
| 18 #include "vm/stub_code.h" | 18 #include "vm/stub_code.h" |
| 19 #include "vm/symbols.h" | 19 #include "vm/symbols.h" |
| 20 | 20 |
| 21 #define __ compiler->assembler()-> | 21 #define __ compiler->assembler()-> |
| 22 | 22 |
| 23 namespace dart { | 23 namespace dart { |
| 24 | 24 |
| 25 DECLARE_FLAG(bool, emit_edge_counters); | 25 DECLARE_FLAG(bool, emit_edge_counters); |
| 26 DECLARE_FLAG(bool, enable_asserts); | |
| 27 DECLARE_FLAG(bool, enable_type_checks); | |
| 28 DECLARE_FLAG(int, optimization_counter_threshold); | 26 DECLARE_FLAG(int, optimization_counter_threshold); |
| 29 DECLARE_FLAG(bool, propagate_ic_data); | 27 DECLARE_FLAG(bool, propagate_ic_data); |
| 30 DECLARE_FLAG(bool, use_osr); | 28 DECLARE_FLAG(bool, use_osr); |
| 31 DECLARE_FLAG(bool, throw_on_javascript_int_overflow); | 29 DECLARE_FLAG(bool, throw_on_javascript_int_overflow); |
| 32 | 30 |
| 33 // Generic summary for call instructions that have all arguments pushed | 31 // Generic summary for call instructions that have all arguments pushed |
| 34 // on the stack and return the result in a fixed register EAX. | 32 // on the stack and return the result in a fixed register EAX. |
| 35 LocationSummary* Instruction::MakeCallSummary(Isolate* isolate) { | 33 LocationSummary* Instruction::MakeCallSummary(Isolate* isolate) { |
| 36 const intptr_t kNumInputs = 0; | 34 const intptr_t kNumInputs = 0; |
| 37 const intptr_t kNumTemps= 0; | 35 const intptr_t kNumTemps= 0; |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 | 241 |
| 244 static void EmitAssertBoolean(Register reg, | 242 static void EmitAssertBoolean(Register reg, |
| 245 intptr_t token_pos, | 243 intptr_t token_pos, |
| 246 intptr_t deopt_id, | 244 intptr_t deopt_id, |
| 247 LocationSummary* locs, | 245 LocationSummary* locs, |
| 248 FlowGraphCompiler* compiler) { | 246 FlowGraphCompiler* compiler) { |
| 249 // Check that the type of the value is allowed in conditional context. | 247 // Check that the type of the value is allowed in conditional context. |
| 250 // Call the runtime if the object is not bool::true or bool::false. | 248 // Call the runtime if the object is not bool::true or bool::false. |
| 251 ASSERT(locs->always_calls()); | 249 ASSERT(locs->always_calls()); |
| 252 Label done; | 250 Label done; |
| 253 | 251 __ CompareObject(reg, Bool::True()); |
| 254 if (FLAG_enable_type_checks) { | 252 __ j(EQUAL, &done, Assembler::kNearJump); |
| 255 __ CompareObject(reg, Bool::True()); | 253 __ CompareObject(reg, Bool::False()); |
| 256 __ j(EQUAL, &done, Assembler::kNearJump); | 254 __ j(EQUAL, &done, Assembler::kNearJump); |
| 257 __ CompareObject(reg, Bool::False()); | |
| 258 __ j(EQUAL, &done, Assembler::kNearJump); | |
| 259 } else { | |
| 260 ASSERT(FLAG_enable_asserts); | |
| 261 __ CompareObject(reg, Object::null_instance()); | |
| 262 __ j(NOT_EQUAL, &done, Assembler::kNearJump); | |
| 263 } | |
| 264 | 255 |
| 265 __ pushl(reg); // Push the source object. | 256 __ pushl(reg); // Push the source object. |
| 266 compiler->GenerateRuntimeCall(token_pos, | 257 compiler->GenerateRuntimeCall(token_pos, |
| 267 deopt_id, | 258 deopt_id, |
| 268 kNonBoolTypeErrorRuntimeEntry, | 259 kNonBoolTypeErrorRuntimeEntry, |
| 269 1, | 260 1, |
| 270 locs); | 261 locs); |
| 271 // We should never return here. | 262 // We should never return here. |
| 272 __ int3(); | 263 __ int3(); |
| 273 __ Bind(&done); | 264 __ Bind(&done); |
| (...skipping 6547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6821 #if defined(DEBUG) | 6812 #if defined(DEBUG) |
| 6822 __ movl(EDX, Immediate(kInvalidObjectPointer)); | 6813 __ movl(EDX, Immediate(kInvalidObjectPointer)); |
| 6823 #endif | 6814 #endif |
| 6824 } | 6815 } |
| 6825 | 6816 |
| 6826 } // namespace dart | 6817 } // namespace dart |
| 6827 | 6818 |
| 6828 #undef __ | 6819 #undef __ |
| 6829 | 6820 |
| 6830 #endif // defined TARGET_ARCH_IA32 | 6821 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |