| 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 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 556 int argument_count = 0; | 556 int argument_count = 0; |
| 557 base::SmartArrayPointer<Handle<Object>> arguments = | 557 base::SmartArrayPointer<Handle<Object>> arguments = |
| 558 GetCallerArguments(isolate, &argument_count); | 558 GetCallerArguments(isolate, &argument_count); |
| 559 int num_elements = std::max(0, argument_count - start_index); | 559 int num_elements = std::max(0, argument_count - start_index); |
| 560 Handle<JSObject> result = | 560 Handle<JSObject> result = |
| 561 isolate->factory()->NewJSArray(FAST_ELEMENTS, num_elements, num_elements, | 561 isolate->factory()->NewJSArray(FAST_ELEMENTS, num_elements, num_elements, |
| 562 DONT_INITIALIZE_ARRAY_ELEMENTS); | 562 DONT_INITIALIZE_ARRAY_ELEMENTS); |
| 563 { | 563 { |
| 564 DisallowHeapAllocation no_gc; | 564 DisallowHeapAllocation no_gc; |
| 565 FixedArray* elements = FixedArray::cast(result->elements()); | 565 FixedArray* elements = FixedArray::cast(result->elements()); |
| 566 WriteBarrierMode mode = result->GetWriteBarrierMode(no_gc); | 566 WriteBarrierMode mode = elements->GetWriteBarrierMode(no_gc); |
| 567 for (int i = 0; i < num_elements; i++) { | 567 for (int i = 0; i < num_elements; i++) { |
| 568 elements->set(i, *arguments[i + start_index], mode); | 568 elements->set(i, *arguments[i + start_index], mode); |
| 569 } | 569 } |
| 570 } | 570 } |
| 571 return *result; | 571 return *result; |
| 572 } | 572 } |
| 573 | 573 |
| 574 | 574 |
| 575 RUNTIME_FUNCTION(Runtime_NewSloppyArguments) { | 575 RUNTIME_FUNCTION(Runtime_NewSloppyArguments) { |
| 576 HandleScope scope(isolate); | 576 HandleScope scope(isolate); |
| (...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1032 DCHECK_EQ(2, args.length()); | 1032 DCHECK_EQ(2, args.length()); |
| 1033 CONVERT_ARG_HANDLE_CHECKED(String, name, 0); | 1033 CONVERT_ARG_HANDLE_CHECKED(String, name, 0); |
| 1034 CONVERT_ARG_HANDLE_CHECKED(Object, value, 1); | 1034 CONVERT_ARG_HANDLE_CHECKED(Object, value, 1); |
| 1035 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, value, | 1035 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, value, |
| 1036 StoreLookupSlot(name, value, STRICT)); | 1036 StoreLookupSlot(name, value, STRICT)); |
| 1037 return *value; | 1037 return *value; |
| 1038 } | 1038 } |
| 1039 | 1039 |
| 1040 } // namespace internal | 1040 } // namespace internal |
| 1041 } // namespace v8 | 1041 } // namespace v8 |
| OLD | NEW |