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

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

Issue 10827288: - Support for patching of class methods and fields. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 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
OLDNEW
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/intermediate_language.h" 8 #include "vm/intermediate_language.h"
9 9
10 #include "lib/error.h" 10 #include "lib/error.h"
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 ObjectStore* object_store = Isolate::Current()->object_store(); 343 ObjectStore* object_store = Isolate::Current()->object_store();
344 Condition cond = TokenKindToSmiCondition(kind); 344 Condition cond = TokenKindToSmiCondition(kind);
345 Label done; 345 Label done;
346 for (intptr_t i = 0; i < ic_data.NumberOfChecks(); i++) { 346 for (intptr_t i = 0; i < ic_data.NumberOfChecks(); i++) {
347 // Assert that the Smi is at position 0, if at all. 347 // Assert that the Smi is at position 0, if at all.
348 ASSERT((ic_data.GetReceiverClassIdAt(i) != kSmiCid) || (i == 0)); 348 ASSERT((ic_data.GetReceiverClassIdAt(i) != kSmiCid) || (i == 0));
349 Label next_test; 349 Label next_test;
350 __ cmpl(temp, Immediate(ic_data.GetReceiverClassIdAt(i))); 350 __ cmpl(temp, Immediate(ic_data.GetReceiverClassIdAt(i)));
351 __ j(NOT_EQUAL, &next_test); 351 __ j(NOT_EQUAL, &next_test);
352 const Function& target = Function::ZoneHandle(ic_data.GetTargetAt(i)); 352 const Function& target = Function::ZoneHandle(ic_data.GetTargetAt(i));
353 if (target.owner() == object_store->object_class()) { 353 if (target.Owner() == object_store->object_class()) {
354 // Object.== is same as ===. 354 // Object.== is same as ===.
355 __ Drop(2); 355 __ Drop(2);
356 __ cmpl(left, right); 356 __ cmpl(left, right);
357 if (branch != NULL) { 357 if (branch != NULL) {
358 branch->EmitBranchOnCondition(compiler, cond); 358 branch->EmitBranchOnCondition(compiler, cond);
359 } else { 359 } else {
360 Register result = locs.out().reg(); 360 Register result = locs.out().reg();
361 Label load_true; 361 Label load_true;
362 __ j(cond, &load_true, Assembler::kNearJump); 362 __ j(cond, &load_true, Assembler::kNearJump);
363 __ LoadObject(result, compiler->bool_false()); 363 __ LoadObject(result, compiler->bool_false());
(...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after
1088 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); 1088 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall);
1089 locs->set_in(0, Location::RegisterLocation(EAX)); 1089 locs->set_in(0, Location::RegisterLocation(EAX));
1090 locs->set_in(1, Location::RegisterLocation(ECX)); 1090 locs->set_in(1, Location::RegisterLocation(ECX));
1091 locs->set_out(Location::RegisterLocation(EAX)); 1091 locs->set_out(Location::RegisterLocation(EAX));
1092 return locs; 1092 return locs;
1093 } 1093 }
1094 1094
1095 1095
1096 void AllocateObjectWithBoundsCheckComp::EmitNativeCode( 1096 void AllocateObjectWithBoundsCheckComp::EmitNativeCode(
1097 FlowGraphCompiler* compiler) { 1097 FlowGraphCompiler* compiler) {
1098 const Class& cls = Class::ZoneHandle(constructor().owner()); 1098 const Class& cls = Class::ZoneHandle(constructor().Owner());
1099 Register type_arguments = locs()->in(0).reg(); 1099 Register type_arguments = locs()->in(0).reg();
1100 Register instantiator_type_arguments = locs()->in(1).reg(); 1100 Register instantiator_type_arguments = locs()->in(1).reg();
1101 Register result = locs()->out().reg(); 1101 Register result = locs()->out().reg();
1102 1102
1103 // Push the result place holder initialized to NULL. 1103 // Push the result place holder initialized to NULL.
1104 __ PushObject(Object::ZoneHandle()); 1104 __ PushObject(Object::ZoneHandle());
1105 __ PushObject(cls); 1105 __ PushObject(cls);
1106 __ pushl(type_arguments); 1106 __ pushl(type_arguments);
1107 __ pushl(instantiator_type_arguments); 1107 __ pushl(instantiator_type_arguments);
1108 compiler->GenerateCallRuntime(deopt_id(), 1108 compiler->GenerateCallRuntime(deopt_id(),
(...skipping 1064 matching lines...) Expand 10 before | Expand all | Expand 10 after
2173 kNumArgsChecked); 2173 kNumArgsChecked);
2174 __ CompareObject(EAX, compiler->bool_true()); 2174 __ CompareObject(EAX, compiler->bool_true());
2175 EmitBranchOnCondition(compiler, branch_condition); 2175 EmitBranchOnCondition(compiler, branch_condition);
2176 } 2176 }
2177 2177
2178 } // namespace dart 2178 } // namespace dart
2179 2179
2180 #undef __ 2180 #undef __
2181 2181
2182 #endif // defined TARGET_ARCH_X64 2182 #endif // defined TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698