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

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

Issue 363093004: Use Object::null_object() instead of Object::ZoneHandle() when a null object (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/intermediate_language_arm.cc ('k') | runtime/vm/intermediate_language_ia32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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_ARM64. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64.
6 #if defined(TARGET_ARCH_ARM64) 6 #if defined(TARGET_ARCH_ARM64)
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"
(...skipping 740 matching lines...) Expand 10 before | Expand all | Expand 10 after
751 } 751 }
752 752
753 753
754 void NativeCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 754 void NativeCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
755 ASSERT(locs()->temp(0).reg() == R1); 755 ASSERT(locs()->temp(0).reg() == R1);
756 ASSERT(locs()->temp(1).reg() == R2); 756 ASSERT(locs()->temp(1).reg() == R2);
757 ASSERT(locs()->temp(2).reg() == R5); 757 ASSERT(locs()->temp(2).reg() == R5);
758 const Register result = locs()->out(0).reg(); 758 const Register result = locs()->out(0).reg();
759 759
760 // Push the result place holder initialized to NULL. 760 // Push the result place holder initialized to NULL.
761 __ PushObject(Object::ZoneHandle(), PP); 761 __ PushObject(Object::null_object(), PP);
762 // Pass a pointer to the first argument in R2. 762 // Pass a pointer to the first argument in R2.
763 if (!function().HasOptionalParameters()) { 763 if (!function().HasOptionalParameters()) {
764 __ AddImmediate(R2, FP, (kParamEndSlotFromFp + 764 __ AddImmediate(R2, FP, (kParamEndSlotFromFp +
765 function().NumParameters()) * kWordSize, PP); 765 function().NumParameters()) * kWordSize, PP);
766 } else { 766 } else {
767 __ AddImmediate(R2, FP, kFirstLocalSlotFromFp * kWordSize, PP); 767 __ AddImmediate(R2, FP, kFirstLocalSlotFromFp * kWordSize, PP);
768 } 768 }
769 // Compute the effective address. When running under the simulator, 769 // Compute the effective address. When running under the simulator,
770 // this is a redirection address that forces the simulator to call 770 // this is a redirection address that forces the simulator to call
771 // into the runtime system. 771 // into the runtime system.
(...skipping 1448 matching lines...) Expand 10 before | Expand all | Expand 10 after
2220 return locs; 2220 return locs;
2221 } 2221 }
2222 2222
2223 2223
2224 void InstantiateTypeInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 2224 void InstantiateTypeInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
2225 const Register instantiator_reg = locs()->in(0).reg(); 2225 const Register instantiator_reg = locs()->in(0).reg();
2226 const Register result_reg = locs()->out(0).reg(); 2226 const Register result_reg = locs()->out(0).reg();
2227 2227
2228 // 'instantiator_reg' is the instantiator TypeArguments object (or null). 2228 // 'instantiator_reg' is the instantiator TypeArguments object (or null).
2229 // A runtime call to instantiate the type is required. 2229 // A runtime call to instantiate the type is required.
2230 __ PushObject(Object::ZoneHandle(), PP); // Make room for the result. 2230 __ PushObject(Object::null_object(), PP); // Make room for the result.
2231 __ PushObject(type(), PP); 2231 __ PushObject(type(), PP);
2232 __ Push(instantiator_reg); // Push instantiator type arguments. 2232 __ Push(instantiator_reg); // Push instantiator type arguments.
2233 compiler->GenerateRuntimeCall(token_pos(), 2233 compiler->GenerateRuntimeCall(token_pos(),
2234 deopt_id(), 2234 deopt_id(),
2235 kInstantiateTypeRuntimeEntry, 2235 kInstantiateTypeRuntimeEntry,
2236 2, 2236 2,
2237 locs()); 2237 locs());
2238 __ Drop(2); // Drop instantiator and uninstantiated type. 2238 __ Drop(2); // Drop instantiator and uninstantiated type.
2239 __ Pop(result_reg); // Pop instantiated type. 2239 __ Pop(result_reg); // Pop instantiated type.
2240 ASSERT(instantiator_reg == result_reg); 2240 ASSERT(instantiator_reg == result_reg);
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
2288 __ CompareImmediate(R1, Smi::RawValue(StubCode::kNoInstantiator), PP); 2288 __ CompareImmediate(R1, Smi::RawValue(StubCode::kNoInstantiator), PP);
2289 __ b(&loop, NE); 2289 __ b(&loop, NE);
2290 __ b(&slow_case); 2290 __ b(&slow_case);
2291 __ Bind(&found); 2291 __ Bind(&found);
2292 __ LoadFromOffset(R0, R2, 1 * kWordSize, PP); // Cached instantiated args. 2292 __ LoadFromOffset(R0, R2, 1 * kWordSize, PP); // Cached instantiated args.
2293 __ b(&type_arguments_instantiated); 2293 __ b(&type_arguments_instantiated);
2294 2294
2295 __ Bind(&slow_case); 2295 __ Bind(&slow_case);
2296 // Instantiate non-null type arguments. 2296 // Instantiate non-null type arguments.
2297 // A runtime call to instantiate the type arguments is required. 2297 // A runtime call to instantiate the type arguments is required.
2298 __ PushObject(Object::ZoneHandle(), PP); // Make room for the result. 2298 __ PushObject(Object::null_object(), PP); // Make room for the result.
2299 __ PushObject(type_arguments(), PP); 2299 __ PushObject(type_arguments(), PP);
2300 __ Push(instantiator_reg); // Push instantiator type arguments. 2300 __ Push(instantiator_reg); // Push instantiator type arguments.
2301 compiler->GenerateRuntimeCall(token_pos(), 2301 compiler->GenerateRuntimeCall(token_pos(),
2302 deopt_id(), 2302 deopt_id(),
2303 kInstantiateTypeArgumentsRuntimeEntry, 2303 kInstantiateTypeArgumentsRuntimeEntry,
2304 2, 2304 2,
2305 locs()); 2305 locs());
2306 __ Drop(2); // Drop instantiator and uninstantiated type arguments. 2306 __ Drop(2); // Drop instantiator and uninstantiated type arguments.
2307 __ Pop(result_reg); // Pop instantiated type arguments. 2307 __ Pop(result_reg); // Pop instantiated type arguments.
2308 __ Bind(&type_arguments_instantiated); 2308 __ Bind(&type_arguments_instantiated);
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
2343 locs->set_in(0, Location::RegisterLocation(R0)); 2343 locs->set_in(0, Location::RegisterLocation(R0));
2344 locs->set_out(0, Location::RegisterLocation(R0)); 2344 locs->set_out(0, Location::RegisterLocation(R0));
2345 return locs; 2345 return locs;
2346 } 2346 }
2347 2347
2348 2348
2349 void CloneContextInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 2349 void CloneContextInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
2350 const Register context_value = locs()->in(0).reg(); 2350 const Register context_value = locs()->in(0).reg();
2351 const Register result = locs()->out(0).reg(); 2351 const Register result = locs()->out(0).reg();
2352 2352
2353 __ PushObject(Object::ZoneHandle(), PP); // Make room for the result. 2353 __ PushObject(Object::null_object(), PP); // Make room for the result.
2354 __ Push(context_value); 2354 __ Push(context_value);
2355 compiler->GenerateRuntimeCall(token_pos(), 2355 compiler->GenerateRuntimeCall(token_pos(),
2356 deopt_id(), 2356 deopt_id(),
2357 kCloneContextRuntimeEntry, 2357 kCloneContextRuntimeEntry,
2358 1, 2358 1,
2359 locs()); 2359 locs());
2360 __ Drop(1); // Remove argument. 2360 __ Drop(1); // Remove argument.
2361 __ Pop(result); // Get result (cloned context). 2361 __ Pop(result); // Get result (cloned context).
2362 } 2362 }
2363 2363
(...skipping 2986 matching lines...) Expand 10 before | Expand all | Expand 10 after
5350 compiler->GenerateCall(token_pos(), &label, stub_kind_, locs()); 5350 compiler->GenerateCall(token_pos(), &label, stub_kind_, locs());
5351 #if defined(DEBUG) 5351 #if defined(DEBUG)
5352 __ LoadImmediate(R4, kInvalidObjectPointer, kNoPP); 5352 __ LoadImmediate(R4, kInvalidObjectPointer, kNoPP);
5353 __ LoadImmediate(R5, kInvalidObjectPointer, kNoPP); 5353 __ LoadImmediate(R5, kInvalidObjectPointer, kNoPP);
5354 #endif 5354 #endif
5355 } 5355 }
5356 5356
5357 } // namespace dart 5357 } // namespace dart
5358 5358
5359 #endif // defined TARGET_ARCH_ARM64 5359 #endif // defined TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_arm.cc ('k') | runtime/vm/intermediate_language_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698