| 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 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 641 int argument_count = 0; | 641 int argument_count = 0; |
| 642 base::SmartArrayPointer<Handle<Object>> arguments = | 642 base::SmartArrayPointer<Handle<Object>> arguments = |
| 643 GetCallerArguments(isolate, &argument_count); | 643 GetCallerArguments(isolate, &argument_count); |
| 644 int num_elements = std::max(0, argument_count - start_index); | 644 int num_elements = std::max(0, argument_count - start_index); |
| 645 Handle<JSObject> result = | 645 Handle<JSObject> result = |
| 646 isolate->factory()->NewJSArray(FAST_ELEMENTS, num_elements, num_elements, | 646 isolate->factory()->NewJSArray(FAST_ELEMENTS, num_elements, num_elements, |
| 647 DONT_INITIALIZE_ARRAY_ELEMENTS); | 647 DONT_INITIALIZE_ARRAY_ELEMENTS); |
| 648 { | 648 { |
| 649 DisallowHeapAllocation no_gc; | 649 DisallowHeapAllocation no_gc; |
| 650 FixedArray* elements = FixedArray::cast(result->elements()); | 650 FixedArray* elements = FixedArray::cast(result->elements()); |
| 651 WriteBarrierMode mode = result->GetWriteBarrierMode(no_gc); | 651 WriteBarrierMode mode = elements->GetWriteBarrierMode(no_gc); |
| 652 for (int i = 0; i < num_elements; i++) { | 652 for (int i = 0; i < num_elements; i++) { |
| 653 elements->set(i, *arguments[i + start_index], mode); | 653 elements->set(i, *arguments[i + start_index], mode); |
| 654 } | 654 } |
| 655 } | 655 } |
| 656 return *result; | 656 return *result; |
| 657 } | 657 } |
| 658 | 658 |
| 659 | 659 |
| 660 RUNTIME_FUNCTION(Runtime_NewSloppyArguments) { | 660 RUNTIME_FUNCTION(Runtime_NewSloppyArguments) { |
| 661 HandleScope scope(isolate); | 661 HandleScope scope(isolate); |
| (...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1134 DCHECK_EQ(2, args.length()); | 1134 DCHECK_EQ(2, args.length()); |
| 1135 CONVERT_ARG_HANDLE_CHECKED(String, name, 0); | 1135 CONVERT_ARG_HANDLE_CHECKED(String, name, 0); |
| 1136 CONVERT_ARG_HANDLE_CHECKED(Object, value, 1); | 1136 CONVERT_ARG_HANDLE_CHECKED(Object, value, 1); |
| 1137 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, value, | 1137 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, value, |
| 1138 StoreLookupSlot(name, value, STRICT)); | 1138 StoreLookupSlot(name, value, STRICT)); |
| 1139 return *value; | 1139 return *value; |
| 1140 } | 1140 } |
| 1141 | 1141 |
| 1142 } // namespace internal | 1142 } // namespace internal |
| 1143 } // namespace v8 | 1143 } // namespace v8 |
| OLD | NEW |