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

Unified Diff: src/objects-inl.h

Issue 1360403002: Revert of [es6] Introduce spec compliant IsConstructor. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 3 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/objects.cc ('k') | src/parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index 2efd7ef6597a5e9cb174a9a2301eb6898a3ec28d..4aa0ea18b56950802b79c2c1c82f2a5091b28fa6 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -189,12 +189,6 @@
bool Object::IsCallable() const {
return Object::IsHeapObject() && HeapObject::cast(this)->map()->is_callable();
-}
-
-
-bool Object::IsConstructor() const {
- return Object::IsHeapObject() &&
- HeapObject::cast(this)->map()->is_constructor();
}
@@ -4538,17 +4532,13 @@
}
-void Map::set_is_constructor(bool value) {
- if (value) {
- set_bit_field(bit_field() | (1 << kIsConstructor));
- } else {
- set_bit_field(bit_field() & ~(1 << kIsConstructor));
- }
-}
-
-
-bool Map::is_constructor() const {
- return ((1 << kIsConstructor) & bit_field()) != 0;
+void Map::set_function_with_prototype(bool value) {
+ set_bit_field(FunctionWithPrototype::update(bit_field(), value));
+}
+
+
+bool Map::function_with_prototype() {
+ return FunctionWithPrototype::decode(bit_field());
}
@@ -4805,7 +4795,6 @@
return instance_type() >= FIRST_JS_OBJECT_TYPE;
}
bool Map::IsJSArrayMap() { return instance_type() == JS_ARRAY_TYPE; }
-bool Map::IsJSFunctionMap() { return instance_type() == JS_FUNCTION_TYPE; }
bool Map::IsStringMap() { return instance_type() < FIRST_NONSTRING_TYPE; }
bool Map::IsJSProxyMap() {
InstanceType type = instance_type();
@@ -6264,6 +6253,11 @@
return prototype;
}
return instance_prototype();
+}
+
+
+bool JSFunction::should_have_prototype() {
+ return map()->function_with_prototype();
}
« no previous file with comments | « src/objects.cc ('k') | src/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698