Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(267)

Side by Side Diff: src/runtime/runtime-scopes.cc

Issue 2109603002: Use proper write barrier mode when creating rest parameters. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698