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

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
« no previous file with comments | « vm/assembler_macros_x64.cc ('k') | vm/code_generator_ia32.h » ('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) 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/assembler_macros.h"
7 #include "vm/code_patcher.h" 8 #include "vm/code_patcher.h"
8 #include "vm/compiler.h" 9 #include "vm/compiler.h"
9 #include "vm/dart_api_impl.h" 10 #include "vm/dart_api_impl.h"
10 #include "vm/dart_entry.h" 11 #include "vm/dart_entry.h"
11 #include "vm/debugger.h" 12 #include "vm/debugger.h"
12 #include "vm/exceptions.h" 13 #include "vm/exceptions.h"
13 #include "vm/object_store.h" 14 #include "vm/object_store.h"
14 #include "vm/message.h" 15 #include "vm/message.h"
15 #include "vm/message_handler.h" 16 #include "vm/message_handler.h"
16 #include "vm/resolver.h" 17 #include "vm/resolver.h"
(...skipping 1418 matching lines...) Expand 10 before | Expand all | Expand 10 after
1435 deopt_node_id, 1436 deopt_node_id,
1436 function.ToFullyQualifiedCString(), 1437 function.ToFullyQualifiedCString(),
1437 continue_at_pc); 1438 continue_at_pc);
1438 const Class& cls = Class::Handle(function.owner()); 1439 const Class& cls = Class::Handle(function.owner());
1439 const Script& script = Script::Handle(cls.script()); 1440 const Script& script = Script::Handle(cls.script());
1440 intptr_t line, column; 1441 intptr_t line, column;
1441 script.GetTokenLocation(deopt_token_index, &line, &column); 1442 script.GetTokenLocation(deopt_token_index, &line, &column);
1442 OS::Print(" Line: %d Column: %d ", line, column); 1443 OS::Print(" Line: %d Column: %d ", line, column);
1443 OS::Print(">> %s\n", String::Handle(script.GetLine(line)).ToCString()); 1444 OS::Print(">> %s\n", String::Handle(script.GetLine(line)).ToCString());
1444 } 1445 }
1446 // Patch the return PC and saved PC marker in frame to point to the
1447 // unoptimized version.
1445 caller_frame->set_pc(continue_at_pc); 1448 caller_frame->set_pc(continue_at_pc);
1449 caller_frame->SetEntrypointMarker(
1450 unoptimized_code.EntryPoint() +
1451 AssemblerMacros::kOffsetOfSavedPCfromEntrypoint);
1452
1446 // Clear invocation counter so that the function gets optimized after 1453 // Clear invocation counter so that the function gets optimized after
1447 // types/classes have been collected. 1454 // types/classes have been collected.
1448 function.set_usage_counter(0); 1455 function.set_usage_counter(0);
1449 function.set_deoptimization_counter(function.deoptimization_counter() + 1); 1456 function.set_deoptimization_counter(function.deoptimization_counter() + 1);
1450 1457
1451 // We have to skip the following otherwise the compiler will complain 1458 // We have to skip the following otherwise the compiler will complain
1452 // when it attempts to install unoptimized code into a function that 1459 // when it attempts to install unoptimized code into a function that
1453 // was already deoptimized. 1460 // was already deoptimized.
1454 if (function.HasOptimizedCode()) { 1461 if (function.HasOptimizedCode()) {
1455 // Get unoptimized code. Compilation restores (reenables) the entry of 1462 // Get unoptimized code. Compilation restores (reenables) the entry of
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
1547 } 1554 }
1548 } 1555 }
1549 } 1556 }
1550 // The cache is null terminated, therefore the loop above should never 1557 // The cache is null terminated, therefore the loop above should never
1551 // terminate by itself. 1558 // terminate by itself.
1552 UNREACHABLE(); 1559 UNREACHABLE();
1553 return Code::null(); 1560 return Code::null();
1554 } 1561 }
1555 1562
1556 } // namespace dart 1563 } // namespace dart
OLDNEW
« no previous file with comments | « vm/assembler_macros_x64.cc ('k') | vm/code_generator_ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698