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

Side by Side Diff: vm/code_generator.cc

Issue 10375059: Use a reserved stack local variable to store the Code object so that it can be looked up easily whe… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 7 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/code_generator.h" 5 #include "vm/code_generator.h"
6 6
7 #include "vm/code_patcher.h" 7 #include "vm/code_patcher.h"
8 #include "vm/compiler.h" 8 #include "vm/compiler.h"
9 #include "vm/dart_api_impl.h" 9 #include "vm/dart_api_impl.h"
10 #include "vm/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 1424 matching lines...) Expand 10 before | Expand all | Expand 10 after
1435 deopt_node_id, 1435 deopt_node_id,
1436 function.ToFullyQualifiedCString(), 1436 function.ToFullyQualifiedCString(),
1437 continue_at_pc); 1437 continue_at_pc);
1438 const Class& cls = Class::Handle(function.owner()); 1438 const Class& cls = Class::Handle(function.owner());
1439 const Script& script = Script::Handle(cls.script()); 1439 const Script& script = Script::Handle(cls.script());
1440 intptr_t line, column; 1440 intptr_t line, column;
1441 script.GetTokenLocation(deopt_token_index, &line, &column); 1441 script.GetTokenLocation(deopt_token_index, &line, &column);
1442 OS::Print(" Line: %d Column: %d ", line, column); 1442 OS::Print(" Line: %d Column: %d ", line, column);
1443 OS::Print(">> %s\n", String::Handle(script.GetLine(line)).ToCString()); 1443 OS::Print(">> %s\n", String::Handle(script.GetLine(line)).ToCString());
1444 } 1444 }
1445 // Patch the return PC and saved PC marker in frame to point to the
1446 // unoptimized version.
1445 caller_frame->set_pc(continue_at_pc); 1447 caller_frame->set_pc(continue_at_pc);
1448 caller_frame->SetEntrypointMarker(
1449 unoptimized_code.EntryPoint() +
1450 AssemblerMacros::kOffsetOfSavedPCfromEntrypoint);
1451
1446 // Clear invocation counter so that the function gets optimized after 1452 // Clear invocation counter so that the function gets optimized after
1447 // types/classes have been collected. 1453 // types/classes have been collected.
1448 function.set_usage_counter(0); 1454 function.set_usage_counter(0);
1449 function.set_deoptimization_counter(function.deoptimization_counter() + 1); 1455 function.set_deoptimization_counter(function.deoptimization_counter() + 1);
1450 1456
1451 // We have to skip the following otherwise the compiler will complain 1457 // We have to skip the following otherwise the compiler will complain
1452 // when it attempts to install unoptimized code into a function that 1458 // when it attempts to install unoptimized code into a function that
1453 // was already deoptimized. 1459 // was already deoptimized.
1454 if (function.HasOptimizedCode()) { 1460 if (function.HasOptimizedCode()) {
1455 // Get unoptimized code. Compilation restores (reenables) the entry of 1461 // Get unoptimized code. Compilation restores (reenables) the entry of
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
1547 } 1553 }
1548 } 1554 }
1549 } 1555 }
1550 // The cache is null terminated, therefore the loop above should never 1556 // The cache is null terminated, therefore the loop above should never
1551 // terminate by itself. 1557 // terminate by itself.
1552 UNREACHABLE(); 1558 UNREACHABLE();
1553 return Code::null(); 1559 return Code::null();
1554 } 1560 }
1555 1561
1556 } // namespace dart 1562 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698