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

Side by Side Diff: src/compiler/linkage.cc

Issue 1576093004: [Interpreter] Add ForInPrepare runtime function which returns a ObjectTriple. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Comment and variable name tweaks Created 4 years, 11 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
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/ast/scopes.h" 5 #include "src/ast/scopes.h"
6 #include "src/code-stubs.h" 6 #include "src/code-stubs.h"
7 #include "src/compiler.h" 7 #include "src/compiler.h"
8 #include "src/compiler/common-operator.h" 8 #include "src/compiler/common-operator.h"
9 #include "src/compiler/frame.h" 9 #include "src/compiler/frame.h"
10 #include "src/compiler/linkage.h" 10 #include "src/compiler/linkage.h"
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 LocationSignature::Builder locations(zone, return_count, parameter_count); 236 LocationSignature::Builder locations(zone, return_count, parameter_count);
237 MachineSignature::Builder types(zone, return_count, parameter_count); 237 MachineSignature::Builder types(zone, return_count, parameter_count);
238 238
239 // Add returns. 239 // Add returns.
240 if (locations.return_count_ > 0) { 240 if (locations.return_count_ > 0) {
241 locations.AddReturn(regloc(kReturnRegister0)); 241 locations.AddReturn(regloc(kReturnRegister0));
242 } 242 }
243 if (locations.return_count_ > 1) { 243 if (locations.return_count_ > 1) {
244 locations.AddReturn(regloc(kReturnRegister1)); 244 locations.AddReturn(regloc(kReturnRegister1));
245 } 245 }
246 if (locations.return_count_ > 2) {
247 locations.AddReturn(regloc(kReturnRegister2));
248 }
246 for (size_t i = 0; i < return_count; i++) { 249 for (size_t i = 0; i < return_count; i++) {
247 types.AddReturn(MachineType::AnyTagged()); 250 types.AddReturn(MachineType::AnyTagged());
248 } 251 }
249 252
250 // All parameters to the runtime call go on the stack. 253 // All parameters to the runtime call go on the stack.
251 for (int i = 0; i < js_parameter_count; i++) { 254 for (int i = 0; i < js_parameter_count; i++) {
252 locations.AddParam( 255 locations.AddParam(
253 LinkageLocation::ForCallerFrameSlot(i - js_parameter_count)); 256 LinkageLocation::ForCallerFrameSlot(i - js_parameter_count));
254 types.AddParam(MachineType::AnyTagged()); 257 types.AddParam(MachineType::AnyTagged());
255 } 258 }
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 LocationSignature::Builder locations(zone, return_count, parameter_count); 445 LocationSignature::Builder locations(zone, return_count, parameter_count);
443 MachineSignature::Builder types(zone, return_count, parameter_count); 446 MachineSignature::Builder types(zone, return_count, parameter_count);
444 447
445 // Add returns. 448 // Add returns.
446 if (locations.return_count_ > 0) { 449 if (locations.return_count_ > 0) {
447 locations.AddReturn(regloc(kReturnRegister0)); 450 locations.AddReturn(regloc(kReturnRegister0));
448 } 451 }
449 if (locations.return_count_ > 1) { 452 if (locations.return_count_ > 1) {
450 locations.AddReturn(regloc(kReturnRegister1)); 453 locations.AddReturn(regloc(kReturnRegister1));
451 } 454 }
455 if (locations.return_count_ > 2) {
456 locations.AddReturn(regloc(kReturnRegister2));
457 }
452 for (size_t i = 0; i < return_count; i++) { 458 for (size_t i = 0; i < return_count; i++) {
453 types.AddReturn(return_type); 459 types.AddReturn(return_type);
454 } 460 }
455 461
456 // Add parameters in registers and on the stack. 462 // Add parameters in registers and on the stack.
457 for (int i = 0; i < js_parameter_count; i++) { 463 for (int i = 0; i < js_parameter_count; i++) {
458 if (i < register_parameter_count) { 464 if (i < register_parameter_count) {
459 // The first parameters go in registers. 465 // The first parameters go in registers.
460 Register reg = descriptor.GetRegisterParameter(i); 466 Register reg = descriptor.GetRegisterParameter(i);
461 Representation rep = 467 Representation rep =
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 } else { 537 } else {
532 DCHECK(loc == regloc(kContextRegister)); 538 DCHECK(loc == regloc(kContextRegister));
533 return LinkageLocation::ForCalleeFrameSlot(Frame::kContextSlot); 539 return LinkageLocation::ForCalleeFrameSlot(Frame::kContextSlot);
534 } 540 }
535 } 541 }
536 542
537 543
538 } // namespace compiler 544 } // namespace compiler
539 } // namespace internal 545 } // namespace internal
540 } // namespace v8 546 } // namespace v8
OLDNEW
« no previous file with comments | « src/code-stubs.h ('k') | src/ia32/code-stubs-ia32.cc » ('j') | src/runtime/runtime-forin.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698