libraries/v8/runtime.cc
// Create a plain JSObject which materializes the local scope for the specified
// frame.
Create a plain JSObject which materializes the local scope for the specified
frame.
Create a plain JSObject which materializes the local scope for the specified frame .
static Handle<JSObject> MaterializeStackLocalsWithFrameInspector(
    Isolate* isolate,
    Handle<JSObject> target,
    Handle<JSFunction> function,
    FrameInspector* frame_inspector) {
  Handle<SharedFunctionInfo> shared(function->shared());
  Handle<ScopeInfo> scope_info(shared->scope_info());
  for (int i = 0; i < scope_info->ParameterCount(); ++i) {
    Handle<Object> value(i < frame_inspector->GetParametersCount()
                             ? frame_inspector->GetParameter(i)
                             : isolate->heap()->undefined_value(),
                         isolate);
    ASSERT(!value->IsTheHole());
    RETURN_IF_EMPTY_HANDLE_VALUE(
        isolate,
        SetProperty(isolate,
                    target,
                    Handle<String>(scope_info->ParameterName(i)),
                    value,
                    NONE,
                    kNonStrictMode),
        Handle<JSObject>());
  }
  for (int i = 0; i < scope_info->StackLocalCount(); ++i) {
    Handle<Object> value(frame_inspector->GetExpression(i), isolate);
    if (value->IsTheHole()) continue;
    RETURN_IF_EMPTY_HANDLE_VALUE(
        isolate,
        SetProperty(isolate,
                    target,
                    Handle<String>(scope_info->StackLocalName(i)),
                    value,
                    NONE,
                    kNonStrictMode),
        Handle<JSObject>());
  }
  return target;
}
static Handle < JSObject > MaterializeStackLocalsWithFrameInspector ( Isolate * isolate , Handle < JSObject > target , Handle < JSFunction > function , FrameInspector * frame_inspector ) { Handle < SharedFunctionInfo > shared ( function -> shared ( ) ) ; Handle < ScopeInfo > scope_info ( shared -> scope_info ( ) ) ; for ( int i = 0 ; i < scope_info -> ParameterCount ( ) ; ++ i ) { Handle < Object > value ( i < frame_inspector -> GetParametersCount ( ) ? frame_inspector -> GetParameter ( i ) : isolate -> heap ( ) -> undefined_value ( ) , isolate ) ; ASSERT ( ! value -> IsTheHole ( ) ) ; RETURN_IF_EMPTY_HANDLE_VALUE ( isolate , SetProperty ( isolate , target , Handle < String > ( scope_info -> ParameterName ( i ) ) , value , NONE , kNonStrictMode ) , Handle < JSObject > ( ) ) ; } for ( int i = 0 ; i < scope_info -> StackLocalCount ( ) ; ++ i ) { Handle < Object > value ( frame_inspector -> GetExpression ( i ) , isolate ) ; if ( value -> IsTheHole ( ) ) continue ; RETURN_IF_EMPTY_HANDLE_VALUE ( isolate , SetProperty ( isolate , target , Handle < String > ( scope_info -> StackLocalName ( i ) ) , value , NONE , kNonStrictMode ) , Handle < JSObject > ( ) ) ; } return target ; }
Create a plain JSObject which materializes the local scope for the specified
frame.
Create a plain JSObject which materializes the local scope for the specified frame .
// First fill all parameters. // Second fill all stack locals.