Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(209)

Side by Side Diff: runtime/vm/intermediate_language_ia32.cc

Issue 1162033005: Fix http://dartbug.com/23578: (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Update to ToT. Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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(int, optimization_counter_threshold); 26 DECLARE_FLAG(int, optimization_counter_threshold);
28 DECLARE_FLAG(bool, use_osr); 27 DECLARE_FLAG(bool, use_osr);
29 DECLARE_FLAG(bool, throw_on_javascript_int_overflow); 28 DECLARE_FLAG(bool, throw_on_javascript_int_overflow);
30 29
31 // Generic summary for call instructions that have all arguments pushed 30 // Generic summary for call instructions that have all arguments pushed
32 // on the stack and return the result in a fixed register EAX. 31 // on the stack and return the result in a fixed register EAX.
33 LocationSummary* Instruction::MakeCallSummary(Zone* zone) { 32 LocationSummary* Instruction::MakeCallSummary(Zone* zone) {
34 const intptr_t kNumInputs = 0; 33 const intptr_t kNumInputs = 0;
35 const intptr_t kNumTemps = 0; 34 const intptr_t kNumTemps = 0;
36 LocationSummary* result = new(zone) LocationSummary( 35 LocationSummary* result = new(zone) LocationSummary(
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 static void EmitAssertBoolean(Register reg, 241 static void EmitAssertBoolean(Register reg,
243 intptr_t token_pos, 242 intptr_t token_pos,
244 intptr_t deopt_id, 243 intptr_t deopt_id,
245 LocationSummary* locs, 244 LocationSummary* locs,
246 FlowGraphCompiler* compiler) { 245 FlowGraphCompiler* compiler) {
247 // Check that the type of the value is allowed in conditional context. 246 // Check that the type of the value is allowed in conditional context.
248 // Call the runtime if the object is not bool::true or bool::false. 247 // Call the runtime if the object is not bool::true or bool::false.
249 ASSERT(locs->always_calls()); 248 ASSERT(locs->always_calls());
250 Label done; 249 Label done;
251 250
252 if (Isolate::Current()->TypeChecksEnabled()) { 251 if (Isolate::Current()->flags().type_checks()) {
253 __ CompareObject(reg, Bool::True()); 252 __ CompareObject(reg, Bool::True());
254 __ j(EQUAL, &done, Assembler::kNearJump); 253 __ j(EQUAL, &done, Assembler::kNearJump);
255 __ CompareObject(reg, Bool::False()); 254 __ CompareObject(reg, Bool::False());
256 __ j(EQUAL, &done, Assembler::kNearJump); 255 __ j(EQUAL, &done, Assembler::kNearJump);
257 } else { 256 } else {
258 ASSERT(FLAG_enable_asserts); 257 ASSERT(Isolate::Current()->flags().asserts());
259 __ CompareObject(reg, Object::null_instance()); 258 __ CompareObject(reg, Object::null_instance());
260 __ j(NOT_EQUAL, &done, Assembler::kNearJump); 259 __ j(NOT_EQUAL, &done, Assembler::kNearJump);
261 } 260 }
262 261
263 __ pushl(reg); // Push the source object. 262 __ pushl(reg); // Push the source object.
264 compiler->GenerateRuntimeCall(token_pos, 263 compiler->GenerateRuntimeCall(token_pos,
265 deopt_id, 264 deopt_id,
266 kNonBoolTypeErrorRuntimeEntry, 265 kNonBoolTypeErrorRuntimeEntry,
267 1, 266 1,
268 locs); 267 locs);
(...skipping 6611 matching lines...) Expand 10 before | Expand all | Expand 10 after
6880 __ Drop(1); 6879 __ Drop(1);
6881 __ popl(result); 6880 __ popl(result);
6882 } 6881 }
6883 6882
6884 6883
6885 } // namespace dart 6884 } // namespace dart
6886 6885
6887 #undef __ 6886 #undef __
6888 6887
6889 #endif // defined TARGET_ARCH_IA32 6888 #endif // defined TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698