Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2017 the V8 project authors. All rights reserved. | 1 // Copyright 2017 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/interpreter/interpreter-intrinsics-generator.h" | 5 #include "src/interpreter/interpreter-intrinsics-generator.h" |
| 6 | 6 |
| 7 #include "src/allocation.h" | 7 #include "src/allocation.h" |
| 8 #include "src/builtins/builtins.h" | 8 #include "src/builtins/builtins.h" |
| 9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
| 10 #include "src/frames.h" | 10 #include "src/frames.h" |
| (...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 427 Node* IntrinsicsGenerator::GeneratorGetResumeMode(Node* args_reg, | 427 Node* IntrinsicsGenerator::GeneratorGetResumeMode(Node* args_reg, |
| 428 Node* arg_count, | 428 Node* arg_count, |
| 429 Node* context) { | 429 Node* context) { |
| 430 Node* generator = __ LoadRegister(args_reg); | 430 Node* generator = __ LoadRegister(args_reg); |
| 431 Node* const value = | 431 Node* const value = |
| 432 __ LoadObjectField(generator, JSGeneratorObject::kResumeModeOffset); | 432 __ LoadObjectField(generator, JSGeneratorObject::kResumeModeOffset); |
| 433 | 433 |
| 434 return value; | 434 return value; |
| 435 } | 435 } |
| 436 | 436 |
| 437 Node* IntrinsicsGenerator::GeneratorClose(Node* args_reg, Node* arg_count, | |
| 438 Node* context) { | |
| 439 Node* generator = __ LoadRegister(args_reg); | |
| 440 Node* const value = | |
| 441 __ LoadObjectField(generator, JSGeneratorObject::kResumeModeOffset); | |
| 442 __ StoreObjectFieldNoWriteBarrier( | |
| 443 generator, JSGeneratorObject::kContinuationOffset, | |
| 444 __ SmiConstant(JSGeneratorObject::kGeneratorClosed)); | |
| 445 | |
| 446 return value; | |
| 447 } | |
| 448 | |
|
neis1
2017/05/19 17:58:12
I don't think we need to read and return the mode
mvstanton
2017/05/19 19:11:37
Good catch! Yes, the runtime function just returns
| |
| 437 Node* IntrinsicsGenerator::AsyncGeneratorReject(Node* input, Node* arg_count, | 449 Node* IntrinsicsGenerator::AsyncGeneratorReject(Node* input, Node* arg_count, |
| 438 Node* context) { | 450 Node* context) { |
| 439 return IntrinsicAsBuiltinCall(input, context, | 451 return IntrinsicAsBuiltinCall(input, context, |
| 440 Builtins::kAsyncGeneratorReject); | 452 Builtins::kAsyncGeneratorReject); |
| 441 } | 453 } |
| 442 | 454 |
| 443 Node* IntrinsicsGenerator::AsyncGeneratorResolve(Node* input, Node* arg_count, | 455 Node* IntrinsicsGenerator::AsyncGeneratorResolve(Node* input, Node* arg_count, |
| 444 Node* context) { | 456 Node* context) { |
| 445 return IntrinsicAsBuiltinCall(input, context, | 457 return IntrinsicAsBuiltinCall(input, context, |
| 446 Builtins::kAsyncGeneratorResolve); | 458 Builtins::kAsyncGeneratorResolve); |
| 447 } | 459 } |
| 448 | 460 |
| 449 void IntrinsicsGenerator::AbortIfArgCountMismatch(int expected, Node* actual) { | 461 void IntrinsicsGenerator::AbortIfArgCountMismatch(int expected, Node* actual) { |
| 450 InterpreterAssembler::Label match(assembler_); | 462 InterpreterAssembler::Label match(assembler_); |
| 451 Node* comparison = __ Word32Equal(actual, __ Int32Constant(expected)); | 463 Node* comparison = __ Word32Equal(actual, __ Int32Constant(expected)); |
| 452 __ GotoIf(comparison, &match); | 464 __ GotoIf(comparison, &match); |
| 453 __ Abort(kWrongArgumentCountForInvokeIntrinsic); | 465 __ Abort(kWrongArgumentCountForInvokeIntrinsic); |
| 454 __ Goto(&match); | 466 __ Goto(&match); |
| 455 __ Bind(&match); | 467 __ Bind(&match); |
| 456 } | 468 } |
| 457 | 469 |
| 458 } // namespace interpreter | 470 } // namespace interpreter |
| 459 } // namespace internal | 471 } // namespace internal |
| 460 } // namespace v8 | 472 } // namespace v8 |
| OLD | NEW |