OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <stdlib.h> | 5 #include <stdlib.h> |
6 #include <limits> | 6 #include <limits> |
7 | 7 |
8 #include "src/v8.h" | 8 #include "src/v8.h" |
9 | 9 |
10 #include "src/accessors.h" | 10 #include "src/accessors.h" |
(...skipping 11191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11202 JavaScriptFrame* frame) { | 11202 JavaScriptFrame* frame) { |
11203 SaveContext* save = isolate->save_context(); | 11203 SaveContext* save = isolate->save_context(); |
11204 while (save != NULL && !save->IsBelowFrame(frame)) { | 11204 while (save != NULL && !save->IsBelowFrame(frame)) { |
11205 save = save->prev(); | 11205 save = save->prev(); |
11206 } | 11206 } |
11207 DCHECK(save != NULL); | 11207 DCHECK(save != NULL); |
11208 return save; | 11208 return save; |
11209 } | 11209 } |
11210 | 11210 |
11211 | 11211 |
11212 RUNTIME_FUNCTION(Runtime_IsOptimized) { | |
11213 SealHandleScope shs(isolate); | |
11214 DCHECK(args.length() == 0); | |
11215 JavaScriptFrameIterator it(isolate); | |
11216 JavaScriptFrame* frame = it.frame(); | |
11217 return isolate->heap()->ToBoolean(frame->is_optimized()); | |
11218 } | |
11219 | |
11220 | |
11221 // Advances the iterator to the frame that matches the index and returns the | 11212 // Advances the iterator to the frame that matches the index and returns the |
11222 // inlined frame index, or -1 if not found. Skips native JS functions. | 11213 // inlined frame index, or -1 if not found. Skips native JS functions. |
11223 static int FindIndexedNonNativeFrame(JavaScriptFrameIterator* it, int index) { | 11214 static int FindIndexedNonNativeFrame(JavaScriptFrameIterator* it, int index) { |
11224 int count = -1; | 11215 int count = -1; |
11225 for (; !it->done(); it->Advance()) { | 11216 for (; !it->done(); it->Advance()) { |
11226 List<FrameSummary> frames(FLAG_max_inlining_levels + 1); | 11217 List<FrameSummary> frames(FLAG_max_inlining_levels + 1); |
11227 it->frame()->Summarize(&frames); | 11218 it->frame()->Summarize(&frames); |
11228 for (int i = frames.length() - 1; i >= 0; i--) { | 11219 for (int i = frames.length() - 1; i >= 0; i--) { |
11229 // Omit functions from native scripts. | 11220 // Omit functions from native scripts. |
11230 if (frames[i].function()->IsFromNativeScript()) continue; | 11221 if (frames[i].function()->IsFromNativeScript()) continue; |
(...skipping 4399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
15630 } | 15621 } |
15631 return NULL; | 15622 return NULL; |
15632 } | 15623 } |
15633 | 15624 |
15634 | 15625 |
15635 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { | 15626 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { |
15636 return &(kIntrinsicFunctions[static_cast<int>(id)]); | 15627 return &(kIntrinsicFunctions[static_cast<int>(id)]); |
15637 } | 15628 } |
15638 | 15629 |
15639 } } // namespace v8::internal | 15630 } } // namespace v8::internal |
OLD | NEW |