| 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 "src/accessors.h" | 7 #include "src/accessors.h" |
| 8 #include "src/arguments.h" | 8 #include "src/arguments.h" |
| 9 #include "src/ast/scopeinfo.h" | 9 #include "src/ast/scopeinfo.h" |
| 10 #include "src/ast/scopes.h" | 10 #include "src/ast/scopes.h" |
| (...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 551 int argument_count = 0; | 551 int argument_count = 0; |
| 552 base::SmartArrayPointer<Handle<Object>> arguments = | 552 base::SmartArrayPointer<Handle<Object>> arguments = |
| 553 GetCallerArguments(isolate, &argument_count); | 553 GetCallerArguments(isolate, &argument_count); |
| 554 int num_elements = std::max(0, argument_count - start_index); | 554 int num_elements = std::max(0, argument_count - start_index); |
| 555 Handle<JSObject> result = | 555 Handle<JSObject> result = |
| 556 isolate->factory()->NewJSArray(FAST_ELEMENTS, num_elements, num_elements, | 556 isolate->factory()->NewJSArray(FAST_ELEMENTS, num_elements, num_elements, |
| 557 DONT_INITIALIZE_ARRAY_ELEMENTS); | 557 DONT_INITIALIZE_ARRAY_ELEMENTS); |
| 558 { | 558 { |
| 559 DisallowHeapAllocation no_gc; | 559 DisallowHeapAllocation no_gc; |
| 560 FixedArray* elements = FixedArray::cast(result->elements()); | 560 FixedArray* elements = FixedArray::cast(result->elements()); |
| 561 WriteBarrierMode mode = result->GetWriteBarrierMode(no_gc); | 561 WriteBarrierMode mode = elements->GetWriteBarrierMode(no_gc); |
| 562 for (int i = 0; i < num_elements; i++) { | 562 for (int i = 0; i < num_elements; i++) { |
| 563 elements->set(i, *arguments[i + start_index], mode); | 563 elements->set(i, *arguments[i + start_index], mode); |
| 564 } | 564 } |
| 565 } | 565 } |
| 566 return *result; | 566 return *result; |
| 567 } | 567 } |
| 568 | 568 |
| 569 | 569 |
| 570 RUNTIME_FUNCTION(Runtime_NewSloppyArguments) { | 570 RUNTIME_FUNCTION(Runtime_NewSloppyArguments) { |
| 571 HandleScope scope(isolate); | 571 HandleScope scope(isolate); |
| (...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1028 RUNTIME_FUNCTION(Runtime_StoreLookupSlot_Strict) { | 1028 RUNTIME_FUNCTION(Runtime_StoreLookupSlot_Strict) { |
| 1029 HandleScope scope(isolate); | 1029 HandleScope scope(isolate); |
| 1030 DCHECK_EQ(2, args.length()); | 1030 DCHECK_EQ(2, args.length()); |
| 1031 CONVERT_ARG_HANDLE_CHECKED(String, name, 0); | 1031 CONVERT_ARG_HANDLE_CHECKED(String, name, 0); |
| 1032 CONVERT_ARG_HANDLE_CHECKED(Object, value, 1); | 1032 CONVERT_ARG_HANDLE_CHECKED(Object, value, 1); |
| 1033 RETURN_RESULT_OR_FAILURE(isolate, StoreLookupSlot(name, value, STRICT)); | 1033 RETURN_RESULT_OR_FAILURE(isolate, StoreLookupSlot(name, value, STRICT)); |
| 1034 } | 1034 } |
| 1035 | 1035 |
| 1036 } // namespace internal | 1036 } // namespace internal |
| 1037 } // namespace v8 | 1037 } // namespace v8 |
| OLD | NEW |