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

Side by Side Diff: src/interpreter/bytecode-array-builder.cc

Issue 1410953003: [Interpreter] Adds delete operator to interpreter. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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/bytecode-array-builder.h" 5 #include "src/interpreter/bytecode-array-builder.h"
6 6
7 namespace v8 { 7 namespace v8 {
8 namespace internal { 8 namespace internal {
9 namespace interpreter { 9 namespace interpreter {
10 10
(...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after
626 BytecodeArrayBuilder& BytecodeArrayBuilder::CallRuntime( 626 BytecodeArrayBuilder& BytecodeArrayBuilder::CallRuntime(
627 Runtime::FunctionId function_id, Register first_arg, size_t arg_count) { 627 Runtime::FunctionId function_id, Register first_arg, size_t arg_count) {
628 DCHECK(FitsInIdx16Operand(function_id)); 628 DCHECK(FitsInIdx16Operand(function_id));
629 DCHECK(FitsInIdx8Operand(arg_count)); 629 DCHECK(FitsInIdx8Operand(arg_count));
630 Output(Bytecode::kCallRuntime, static_cast<uint16_t>(function_id), 630 Output(Bytecode::kCallRuntime, static_cast<uint16_t>(function_id),
631 first_arg.ToOperand(), static_cast<uint8_t>(arg_count)); 631 first_arg.ToOperand(), static_cast<uint8_t>(arg_count));
632 return *this; 632 return *this;
633 } 633 }
634 634
635 635
636 BytecodeArrayBuilder& BytecodeArrayBuilder::Delete(Register object,
637 LanguageMode language_mode) {
638 Bytecode bytecode = (language_mode == STRICT)
rmcilroy 2015/10/21 14:52:54 Could you move this code into a BytecodeForDelete
mythria 2015/10/23 14:48:00 Done.
639 ? Bytecode::kDeletePropertyStrict
640 : Bytecode::kDeletePropertySloppy;
641 Output(bytecode, object.ToOperand());
642 return *this;
643 }
644
645
636 size_t BytecodeArrayBuilder::GetConstantPoolEntry(Handle<Object> object) { 646 size_t BytecodeArrayBuilder::GetConstantPoolEntry(Handle<Object> object) {
637 // These constants shouldn't be added to the constant pool, the should use 647 // These constants shouldn't be added to the constant pool, the should use
638 // specialzed bytecodes instead. 648 // specialzed bytecodes instead.
639 DCHECK(!object.is_identical_to(isolate_->factory()->undefined_value())); 649 DCHECK(!object.is_identical_to(isolate_->factory()->undefined_value()));
640 DCHECK(!object.is_identical_to(isolate_->factory()->null_value())); 650 DCHECK(!object.is_identical_to(isolate_->factory()->null_value()));
641 DCHECK(!object.is_identical_to(isolate_->factory()->the_hole_value())); 651 DCHECK(!object.is_identical_to(isolate_->factory()->the_hole_value()));
642 DCHECK(!object.is_identical_to(isolate_->factory()->true_value())); 652 DCHECK(!object.is_identical_to(isolate_->factory()->true_value()));
643 DCHECK(!object.is_identical_to(isolate_->factory()->false_value())); 653 DCHECK(!object.is_identical_to(isolate_->factory()->false_value()));
644 654
645 size_t* entry = constants_map_.Find(object); 655 size_t* entry = constants_map_.Find(object);
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
885 895
886 Register TemporaryRegisterScope::NewRegister() { 896 Register TemporaryRegisterScope::NewRegister() {
887 count_++; 897 count_++;
888 last_register_index_ = builder_->BorrowTemporaryRegister(); 898 last_register_index_ = builder_->BorrowTemporaryRegister();
889 return Register(last_register_index_); 899 return Register(last_register_index_);
890 } 900 }
891 901
892 } // namespace interpreter 902 } // namespace interpreter
893 } // namespace internal 903 } // namespace internal
894 } // namespace v8 904 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698