OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 trace_env.sample = sample; | 84 trace_env.sample = sample; |
85 } | 85 } |
86 | 86 |
87 | 87 |
88 void TraceExtension::DoTrace(Address fp) { | 88 void TraceExtension::DoTrace(Address fp) { |
89 RegisterState regs; | 89 RegisterState regs; |
90 regs.fp = fp; | 90 regs.fp = fp; |
91 // sp is only used to define stack high bound | 91 // sp is only used to define stack high bound |
92 regs.sp = | 92 regs.sp = |
93 reinterpret_cast<Address>(trace_env.sample) - 10240; | 93 reinterpret_cast<Address>(trace_env.sample) - 10240; |
94 trace_env.sample->Init(CcTest::i_isolate(), regs); | 94 trace_env.sample->Init(CcTest::i_isolate(), regs, |
| 95 TickSample::kSkipCEntryFrame); |
95 } | 96 } |
96 | 97 |
97 | 98 |
98 void TraceExtension::Trace(const v8::FunctionCallbackInfo<v8::Value>& args) { | 99 void TraceExtension::Trace(const v8::FunctionCallbackInfo<v8::Value>& args) { |
99 DoTrace(GetFP(args)); | 100 DoTrace(GetFP(args)); |
100 } | 101 } |
101 | 102 |
102 | 103 |
103 // Hide c_entry_fp to emulate situation when sampling is done while | 104 // Hide c_entry_fp to emulate situation when sampling is done while |
104 // pure JS code is being executed | 105 // pure JS code is being executed |
(...skipping 28 matching lines...) Expand all Loading... |
133 const v8::FunctionCallbackInfo<v8::Value>& args) { | 134 const v8::FunctionCallbackInfo<v8::Value>& args) { |
134 v8::HandleScope scope(args.GetIsolate()); | 135 v8::HandleScope scope(args.GetIsolate()); |
135 const Address js_entry_sp = GetJsEntrySp(); | 136 const Address js_entry_sp = GetJsEntrySp(); |
136 CHECK_NE(0, js_entry_sp); | 137 CHECK_NE(0, js_entry_sp); |
137 CompileRun("js_entry_sp();"); | 138 CompileRun("js_entry_sp();"); |
138 CHECK_EQ(js_entry_sp, GetJsEntrySp()); | 139 CHECK_EQ(js_entry_sp, GetJsEntrySp()); |
139 } | 140 } |
140 | 141 |
141 | 142 |
142 } } // namespace v8::internal | 143 } } // namespace v8::internal |
OLD | NEW |