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

Side by Side Diff: src/fast-accessor-assembler.cc

Issue 2186593002: Add faster, but unsafe version of LoadInternalField. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 4 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/fast-accessor-assembler.h" 5 #include "src/fast-accessor-assembler.h"
6 6
7 #include "src/base/logging.h" 7 #include "src/base/logging.h"
8 #include "src/code-stub-assembler.h" 8 #include "src/code-stub-assembler.h"
9 #include "src/code-stubs.h" // For CallApiCallbackStub. 9 #include "src/code-stubs.h" // For CallApiCallbackStub.
10 #include "src/handles-inl.h" 10 #include "src/handles-inl.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 assembler_->Bind(&is_not_jsobject); 84 assembler_->Bind(&is_not_jsobject);
85 Node* fail_value = assembler_->UndefinedConstant(); 85 Node* fail_value = assembler_->UndefinedConstant();
86 result.Bind(fail_value); 86 result.Bind(fail_value);
87 assembler_->Goto(&merge); 87 assembler_->Goto(&merge);
88 88
89 // Return. 89 // Return.
90 assembler_->Bind(&merge); 90 assembler_->Bind(&merge);
91 return FromRaw(result.value()); 91 return FromRaw(result.value());
92 } 92 }
93 93
94 FastAccessorAssembler::ValueId FastAccessorAssembler::LoadInternalFieldUnsafe(
vogelheim 2016/07/27 09:50:56 I briefly discussed handling the LoadInternalField
Alfonso 2016/07/28 14:39:13 The C++ counterpart returns NULL (instead of undef
95 ValueId value, int field_no) {
96 CHECK_EQ(kBuilding, state_);
97 Node* result = assembler_->LoadObjectField(
98 FromId(value), JSObject::kHeaderSize + kPointerSize * field_no,
99 MachineType::Pointer());
100 return FromRaw(result);
101 }
102
94 FastAccessorAssembler::ValueId FastAccessorAssembler::LoadValue(ValueId value, 103 FastAccessorAssembler::ValueId FastAccessorAssembler::LoadValue(ValueId value,
95 int offset) { 104 int offset) {
96 CHECK_EQ(kBuilding, state_); 105 CHECK_EQ(kBuilding, state_);
97 return FromRaw(assembler_->LoadBufferObject(FromId(value), offset, 106 return FromRaw(assembler_->LoadBufferObject(FromId(value), offset,
98 MachineType::IntPtr())); 107 MachineType::IntPtr()));
99 } 108 }
100 109
101 FastAccessorAssembler::ValueId FastAccessorAssembler::LoadObject(ValueId value, 110 FastAccessorAssembler::ValueId FastAccessorAssembler::LoadObject(ValueId value,
102 int offset) { 111 int offset) {
103 CHECK_EQ(kBuilding, state_); 112 CHECK_EQ(kBuilding, state_);
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 void FastAccessorAssembler::Clear() { 238 void FastAccessorAssembler::Clear() {
230 for (auto label : labels_) { 239 for (auto label : labels_) {
231 delete label; 240 delete label;
232 } 241 }
233 nodes_.clear(); 242 nodes_.clear();
234 labels_.clear(); 243 labels_.clear();
235 } 244 }
236 245
237 } // namespace internal 246 } // namespace internal
238 } // namespace v8 247 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698