| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 // replacement for that frame. | 129 // replacement for that frame. |
| 130 if (FLAG_trace_osr) { | 130 if (FLAG_trace_osr) { |
| 131 PrintF("[patching stack checks in "); | 131 PrintF("[patching stack checks in "); |
| 132 function->PrintName(); | 132 function->PrintName(); |
| 133 PrintF(" for on-stack replacement]\n"); | 133 PrintF(" for on-stack replacement]\n"); |
| 134 } | 134 } |
| 135 | 135 |
| 136 // Get the stack check stub code object to match against. We aren't | 136 // Get the stack check stub code object to match against. We aren't |
| 137 // prepared to generate it, but we don't expect to have to. | 137 // prepared to generate it, but we don't expect to have to. |
| 138 StackCheckStub check_stub; | 138 StackCheckStub check_stub; |
| 139 Object* check_code; | 139 Code* stack_check_code = NULL; |
| 140 MaybeObject* maybe_check_code = check_stub.TryGetCode(); | 140 if (check_stub.FindCodeInCache(&stack_check_code)) { |
| 141 if (maybe_check_code->ToObject(&check_code)) { | |
| 142 Code* replacement_code = | 141 Code* replacement_code = |
| 143 isolate_->builtins()->builtin(Builtins::kOnStackReplacement); | 142 isolate_->builtins()->builtin(Builtins::kOnStackReplacement); |
| 144 Code* unoptimized_code = shared->code(); | 143 Code* unoptimized_code = shared->code(); |
| 145 Deoptimizer::PatchStackCheckCode(unoptimized_code, | 144 Deoptimizer::PatchStackCheckCode(unoptimized_code, |
| 146 Code::cast(check_code), | 145 stack_check_code, |
| 147 replacement_code); | 146 replacement_code); |
| 148 } | 147 } |
| 149 } | 148 } |
| 150 | 149 |
| 151 | 150 |
| 152 void RuntimeProfiler::ClearSampleBuffer() { | 151 void RuntimeProfiler::ClearSampleBuffer() { |
| 153 memset(sampler_window_, 0, sizeof(sampler_window_)); | 152 memset(sampler_window_, 0, sizeof(sampler_window_)); |
| 154 memset(sampler_window_weight_, 0, sizeof(sampler_window_weight_)); | 153 memset(sampler_window_weight_, 0, sizeof(sampler_window_weight_)); |
| 155 } | 154 } |
| 156 | 155 |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 | 355 |
| 357 bool RuntimeProfilerRateLimiter::SuspendIfNecessary() { | 356 bool RuntimeProfilerRateLimiter::SuspendIfNecessary() { |
| 358 if (!RuntimeProfiler::IsSomeIsolateInJS()) { | 357 if (!RuntimeProfiler::IsSomeIsolateInJS()) { |
| 359 return RuntimeProfiler::WaitForSomeIsolateToEnterJS(); | 358 return RuntimeProfiler::WaitForSomeIsolateToEnterJS(); |
| 360 } | 359 } |
| 361 return false; | 360 return false; |
| 362 } | 361 } |
| 363 | 362 |
| 364 | 363 |
| 365 } } // namespace v8::internal | 364 } } // namespace v8::internal |
| OLD | NEW |