| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/runtime/runtime-utils.h" | 5 #include "src/runtime/runtime-utils.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "src/accessors.h" | 9 #include "src/accessors.h" |
| 10 #include "src/arguments.h" | 10 #include "src/arguments.h" |
| (...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 | 370 |
| 371 // Skip the receiver. | 371 // Skip the receiver. |
| 372 iter++; | 372 iter++; |
| 373 argument_count--; | 373 argument_count--; |
| 374 | 374 |
| 375 *total_argc = argument_count; | 375 *total_argc = argument_count; |
| 376 std::unique_ptr<Handle<Object>[]> param_data( | 376 std::unique_ptr<Handle<Object>[]> param_data( |
| 377 NewArray<Handle<Object>>(*total_argc)); | 377 NewArray<Handle<Object>>(*total_argc)); |
| 378 bool should_deoptimize = false; | 378 bool should_deoptimize = false; |
| 379 for (int i = 0; i < argument_count; i++) { | 379 for (int i = 0; i < argument_count; i++) { |
| 380 // If we materialize any object, we should deoptimize the frame because we |
| 381 // might alias an object that was eliminated by escape analysis. |
| 380 should_deoptimize = should_deoptimize || iter->IsMaterializedObject(); | 382 should_deoptimize = should_deoptimize || iter->IsMaterializedObject(); |
| 381 Handle<Object> value = iter->GetValue(); | 383 Handle<Object> value = iter->GetValue(); |
| 382 param_data[i] = value; | 384 param_data[i] = value; |
| 383 iter++; | 385 iter++; |
| 384 } | 386 } |
| 385 | 387 |
| 386 if (should_deoptimize) { | 388 if (should_deoptimize) { |
| 387 translated_values.StoreMaterializedValuesAndDeopt(); | 389 translated_values.StoreMaterializedValuesAndDeopt(frame); |
| 388 } | 390 } |
| 389 | 391 |
| 390 return param_data; | 392 return param_data; |
| 391 } else { | 393 } else { |
| 392 it.AdvanceToArgumentsFrame(); | 394 it.AdvanceToArgumentsFrame(); |
| 393 frame = it.frame(); | 395 frame = it.frame(); |
| 394 int args_count = frame->ComputeParametersCount(); | 396 int args_count = frame->ComputeParametersCount(); |
| 395 | 397 |
| 396 *total_argc = args_count; | 398 *total_argc = args_count; |
| 397 std::unique_ptr<Handle<Object>[]> param_data( | 399 std::unique_ptr<Handle<Object>[]> param_data( |
| (...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 957 RUNTIME_FUNCTION(Runtime_StoreLookupSlot_Strict) { | 959 RUNTIME_FUNCTION(Runtime_StoreLookupSlot_Strict) { |
| 958 HandleScope scope(isolate); | 960 HandleScope scope(isolate); |
| 959 DCHECK_EQ(2, args.length()); | 961 DCHECK_EQ(2, args.length()); |
| 960 CONVERT_ARG_HANDLE_CHECKED(String, name, 0); | 962 CONVERT_ARG_HANDLE_CHECKED(String, name, 0); |
| 961 CONVERT_ARG_HANDLE_CHECKED(Object, value, 1); | 963 CONVERT_ARG_HANDLE_CHECKED(Object, value, 1); |
| 962 RETURN_RESULT_OR_FAILURE(isolate, StoreLookupSlot(name, value, STRICT)); | 964 RETURN_RESULT_OR_FAILURE(isolate, StoreLookupSlot(name, value, STRICT)); |
| 963 } | 965 } |
| 964 | 966 |
| 965 } // namespace internal | 967 } // namespace internal |
| 966 } // namespace v8 | 968 } // namespace v8 |
| OLD | NEW |