| 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 11482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11493 // If the receiver is not a JSObject and the function is not a | 11493 // If the receiver is not a JSObject and the function is not a |
| 11494 // builtin or strict-mode we have hit an optimization where a | 11494 // builtin or strict-mode we have hit an optimization where a |
| 11495 // value object is not converted into a wrapped JS objects. To | 11495 // value object is not converted into a wrapped JS objects. To |
| 11496 // hide this optimization from the debugger, we wrap the receiver | 11496 // hide this optimization from the debugger, we wrap the receiver |
| 11497 // by creating correct wrapper object based on the calling frame's | 11497 // by creating correct wrapper object based on the calling frame's |
| 11498 // native context. | 11498 // native context. |
| 11499 it.Advance(); | 11499 it.Advance(); |
| 11500 if (receiver->IsUndefined()) { | 11500 if (receiver->IsUndefined()) { |
| 11501 receiver = handle(function->global_proxy()); | 11501 receiver = handle(function->global_proxy()); |
| 11502 } else { | 11502 } else { |
| 11503 DCHECK(!receiver->IsNull()); | |
| 11504 Context* context = Context::cast(it.frame()->context()); | 11503 Context* context = Context::cast(it.frame()->context()); |
| 11505 Handle<Context> native_context(Context::cast(context->native_context())); | 11504 Handle<Context> native_context(Context::cast(context->native_context())); |
| 11506 receiver = Object::ToObject( | 11505 if (!Object::ToObject(isolate, receiver, native_context) |
| 11507 isolate, receiver, native_context).ToHandleChecked(); | 11506 .ToHandle(&receiver)) { |
| 11507 // This only happens if the receiver is forcibly set in %_CallFunction. |
| 11508 return heap->undefined_value(); |
| 11509 } |
| 11508 } | 11510 } |
| 11509 } | 11511 } |
| 11510 details->set(kFrameDetailsReceiverIndex, *receiver); | 11512 details->set(kFrameDetailsReceiverIndex, *receiver); |
| 11511 | 11513 |
| 11512 DCHECK_EQ(details_size, details_index); | 11514 DCHECK_EQ(details_size, details_index); |
| 11513 return *isolate->factory()->NewJSArrayWithElements(details); | 11515 return *isolate->factory()->NewJSArrayWithElements(details); |
| 11514 } | 11516 } |
| 11515 | 11517 |
| 11516 | 11518 |
| 11517 static bool ParameterIsShadowedByContextLocal(Handle<ScopeInfo> info, | 11519 static bool ParameterIsShadowedByContextLocal(Handle<ScopeInfo> info, |
| (...skipping 4125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 15643 } | 15645 } |
| 15644 return NULL; | 15646 return NULL; |
| 15645 } | 15647 } |
| 15646 | 15648 |
| 15647 | 15649 |
| 15648 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { | 15650 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { |
| 15649 return &(kIntrinsicFunctions[static_cast<int>(id)]); | 15651 return &(kIntrinsicFunctions[static_cast<int>(id)]); |
| 15650 } | 15652 } |
| 15651 | 15653 |
| 15652 } } // namespace v8::internal | 15654 } } // namespace v8::internal |
| OLD | NEW |