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 "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/api.h" | 7 #include "src/api.h" |
8 #include "src/arguments.h" | 8 #include "src/arguments.h" |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 1342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1353 int expressions_count = frame->ComputeExpressionsCount(); | 1353 int expressions_count = frame->ComputeExpressionsCount(); |
1354 DCHECK(expressions_count - 2 - call_function_arg_count >= 0); | 1354 DCHECK(expressions_count - 2 - call_function_arg_count >= 0); |
1355 Object* fun = frame->GetExpression( | 1355 Object* fun = frame->GetExpression( |
1356 expressions_count - 2 - call_function_arg_count); | 1356 expressions_count - 2 - call_function_arg_count); |
1357 | 1357 |
1358 // Flood the actual target of call/apply. | 1358 // Flood the actual target of call/apply. |
1359 if (fun->IsJSFunction()) { | 1359 if (fun->IsJSFunction()) { |
1360 Isolate* isolate = JSFunction::cast(fun)->GetIsolate(); | 1360 Isolate* isolate = JSFunction::cast(fun)->GetIsolate(); |
1361 Code* apply = isolate->builtins()->builtin(Builtins::kFunctionApply); | 1361 Code* apply = isolate->builtins()->builtin(Builtins::kFunctionApply); |
1362 Code* call = isolate->builtins()->builtin(Builtins::kFunctionCall); | 1362 Code* call = isolate->builtins()->builtin(Builtins::kFunctionCall); |
| 1363 // Find target function on the expression stack for expression like |
| 1364 // Function.call.call...apply(...) |
| 1365 int i = 1; |
1363 while (fun->IsJSFunction()) { | 1366 while (fun->IsJSFunction()) { |
1364 Code* code = JSFunction::cast(fun)->shared()->code(); | 1367 Code* code = JSFunction::cast(fun)->shared()->code(); |
1365 if (code != apply && code != call) break; | 1368 if (code != apply && code != call) break; |
1366 fun = frame->GetExpression( | 1369 DCHECK(expressions_count - i - call_function_arg_count >= 0); |
1367 expressions_count - 1 - call_function_arg_count); | 1370 fun = frame->GetExpression(expressions_count - i - |
| 1371 call_function_arg_count); |
| 1372 i -= 1; |
1368 } | 1373 } |
1369 } | 1374 } |
1370 | 1375 |
1371 if (fun->IsJSFunction()) { | 1376 if (fun->IsJSFunction()) { |
1372 Handle<JSFunction> js_function(JSFunction::cast(fun)); | 1377 Handle<JSFunction> js_function(JSFunction::cast(fun)); |
1373 FloodWithOneShotGeneric(js_function); | 1378 FloodWithOneShotGeneric(js_function); |
1374 } | 1379 } |
1375 } | 1380 } |
1376 | 1381 |
1377 // Fill the current function with one-shot break points even for step in on | 1382 // Fill the current function with one-shot break points even for step in on |
(...skipping 1986 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3364 } | 3369 } |
3365 | 3370 |
3366 | 3371 |
3367 void LockingCommandMessageQueue::Clear() { | 3372 void LockingCommandMessageQueue::Clear() { |
3368 base::LockGuard<base::Mutex> lock_guard(&mutex_); | 3373 base::LockGuard<base::Mutex> lock_guard(&mutex_); |
3369 queue_.Clear(); | 3374 queue_.Clear(); |
3370 } | 3375 } |
3371 | 3376 |
3372 } // namespace internal | 3377 } // namespace internal |
3373 } // namespace v8 | 3378 } // namespace v8 |
OLD | NEW |