| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 11209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11220 FrameInspector* frame_inspector) { | 11220 FrameInspector* frame_inspector) { |
| 11221 Handle<SharedFunctionInfo> shared(function->shared()); | 11221 Handle<SharedFunctionInfo> shared(function->shared()); |
| 11222 Handle<ScopeInfo> scope_info(shared->scope_info()); | 11222 Handle<ScopeInfo> scope_info(shared->scope_info()); |
| 11223 | 11223 |
| 11224 // First fill all parameters. | 11224 // First fill all parameters. |
| 11225 for (int i = 0; i < scope_info->ParameterCount(); ++i) { | 11225 for (int i = 0; i < scope_info->ParameterCount(); ++i) { |
| 11226 Handle<Object> value(i < frame_inspector->GetParametersCount() | 11226 Handle<Object> value(i < frame_inspector->GetParametersCount() |
| 11227 ? frame_inspector->GetParameter(i) | 11227 ? frame_inspector->GetParameter(i) |
| 11228 : isolate->heap()->undefined_value(), | 11228 : isolate->heap()->undefined_value(), |
| 11229 isolate); | 11229 isolate); |
| 11230 if (value->IsTheHole()) continue; |
| 11230 | 11231 |
| 11231 RETURN_IF_EMPTY_HANDLE_VALUE( | 11232 RETURN_IF_EMPTY_HANDLE_VALUE( |
| 11232 isolate, | 11233 isolate, |
| 11233 SetProperty(isolate, | 11234 SetProperty(isolate, |
| 11234 target, | 11235 target, |
| 11235 Handle<String>(scope_info->ParameterName(i)), | 11236 Handle<String>(scope_info->ParameterName(i)), |
| 11236 value, | 11237 value, |
| 11237 NONE, | 11238 NONE, |
| 11238 kNonStrictMode), | 11239 kNonStrictMode), |
| 11239 Handle<JSObject>()); | 11240 Handle<JSObject>()); |
| 11240 } | 11241 } |
| 11241 | 11242 |
| 11242 // Second fill all stack locals. | 11243 // Second fill all stack locals. |
| 11243 for (int i = 0; i < scope_info->StackLocalCount(); ++i) { | 11244 for (int i = 0; i < scope_info->StackLocalCount(); ++i) { |
| 11245 Handle<Object> value(frame_inspector->GetExpression(i), isolate); |
| 11246 if (value->IsTheHole()) continue; |
| 11247 |
| 11244 RETURN_IF_EMPTY_HANDLE_VALUE( | 11248 RETURN_IF_EMPTY_HANDLE_VALUE( |
| 11245 isolate, | 11249 isolate, |
| 11246 SetProperty(isolate, | 11250 SetProperty(isolate, |
| 11247 target, | 11251 target, |
| 11248 Handle<String>(scope_info->StackLocalName(i)), | 11252 Handle<String>(scope_info->StackLocalName(i)), |
| 11249 Handle<Object>(frame_inspector->GetExpression(i), isolate), | 11253 value, |
| 11250 NONE, | 11254 NONE, |
| 11251 kNonStrictMode), | 11255 kNonStrictMode), |
| 11252 Handle<JSObject>()); | 11256 Handle<JSObject>()); |
| 11253 } | 11257 } |
| 11254 | 11258 |
| 11255 return target; | 11259 return target; |
| 11256 } | 11260 } |
| 11257 | 11261 |
| 11258 | 11262 |
| 11259 static void UpdateStackLocalsFromMaterializedObject(Isolate* isolate, | 11263 static void UpdateStackLocalsFromMaterializedObject(Isolate* isolate, |
| (...skipping 14 matching lines...) Expand all Loading... |
| 11274 // Parameters. | 11278 // Parameters. |
| 11275 for (int i = 0; i < scope_info->ParameterCount(); ++i) { | 11279 for (int i = 0; i < scope_info->ParameterCount(); ++i) { |
| 11276 HandleScope scope(isolate); | 11280 HandleScope scope(isolate); |
| 11277 Handle<Object> value = GetProperty( | 11281 Handle<Object> value = GetProperty( |
| 11278 isolate, target, Handle<String>(scope_info->ParameterName(i))); | 11282 isolate, target, Handle<String>(scope_info->ParameterName(i))); |
| 11279 frame->SetParameterValue(i, *value); | 11283 frame->SetParameterValue(i, *value); |
| 11280 } | 11284 } |
| 11281 | 11285 |
| 11282 // Stack locals. | 11286 // Stack locals. |
| 11283 for (int i = 0; i < scope_info->StackLocalCount(); ++i) { | 11287 for (int i = 0; i < scope_info->StackLocalCount(); ++i) { |
| 11288 if (frame->GetExpression(i)->IsTheHole()) continue; |
| 11284 HandleScope scope(isolate); | 11289 HandleScope scope(isolate); |
| 11285 Handle<Object> value = GetProperty( | 11290 Handle<Object> value = GetProperty( |
| 11286 isolate, target, Handle<String>(scope_info->StackLocalName(i))); | 11291 isolate, target, Handle<String>(scope_info->StackLocalName(i))); |
| 11287 frame->SetExpression(i, *value); | 11292 frame->SetExpression(i, *value); |
| 11288 } | 11293 } |
| 11289 } | 11294 } |
| 11290 | 11295 |
| 11291 | 11296 |
| 11292 static Handle<JSObject> MaterializeLocalContext(Isolate* isolate, | 11297 static Handle<JSObject> MaterializeLocalContext(Isolate* isolate, |
| 11293 Handle<JSObject> target, | 11298 Handle<JSObject> target, |
| (...skipping 3181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14475 // Handle last resort GC and make sure to allow future allocations | 14480 // Handle last resort GC and make sure to allow future allocations |
| 14476 // to grow the heap without causing GCs (if possible). | 14481 // to grow the heap without causing GCs (if possible). |
| 14477 isolate->counters()->gc_last_resort_from_js()->Increment(); | 14482 isolate->counters()->gc_last_resort_from_js()->Increment(); |
| 14478 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 14483 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
| 14479 "Runtime::PerformGC"); | 14484 "Runtime::PerformGC"); |
| 14480 } | 14485 } |
| 14481 } | 14486 } |
| 14482 | 14487 |
| 14483 | 14488 |
| 14484 } } // namespace v8::internal | 14489 } } // namespace v8::internal |
| OLD | NEW |