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

Unified Diff: src/ic/handler-configuration-inl.h

Issue 2412983008: [ic] Move Smi-handler creation code to SmiHandler class. (Closed)
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ic/handler-configuration.h ('k') | src/ic/ic.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ic/handler-configuration-inl.h
diff --git a/src/ic/handler-configuration-inl.h b/src/ic/handler-configuration-inl.h
new file mode 100644
index 0000000000000000000000000000000000000000..985ccd60fe28c2114808407a5774a3c93e5a4273
--- /dev/null
+++ b/src/ic/handler-configuration-inl.h
@@ -0,0 +1,38 @@
+// Copyright 2016 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef V8_IC_HANDLER_CONFIGURATION_INL_H_
+#define V8_IC_HANDLER_CONFIGURATION_INL_H_
+
+#include "src/ic/handler-configuration.h"
+
+#include "src/field-index-inl.h"
+
+namespace v8 {
+namespace internal {
+
+Handle<Object> SmiHandler::MakeLoadFieldHandler(Isolate* isolate,
+ FieldIndex field_index) {
+ int config = LoadHandlerTypeBit::encode(kLoadICHandlerForProperties) |
+ FieldOffsetIsInobject::encode(field_index.is_inobject()) |
+ FieldOffsetIsDouble::encode(field_index.is_double()) |
+ FieldOffsetOffset::encode(field_index.offset());
+ return handle(Smi::FromInt(config), isolate);
+}
+
+Handle<Object> SmiHandler::MakeKeyedLoadHandler(Isolate* isolate,
+ ElementsKind elements_kind,
+ bool convert_hole_to_undefined,
+ bool is_js_array) {
+ int config = LoadHandlerTypeBit::encode(kLoadICHandlerForElements) |
+ KeyedLoadElementsKind::encode(elements_kind) |
+ KeyedLoadConvertHole::encode(convert_hole_to_undefined) |
+ KeyedLoadIsJsArray::encode(is_js_array);
+ return handle(Smi::FromInt(config), isolate);
+}
+
+} // namespace internal
+} // namespace v8
+
+#endif // V8_IC_HANDLER_CONFIGURATION_INL_H_
« no previous file with comments | « src/ic/handler-configuration.h ('k') | src/ic/ic.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698