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

Unified Diff: src/hydrogen-instructions.cc

Issue 1316933002: [es6] Initial steps towards a correct implementation of IsCallable. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase again. 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/hydrogen-instructions.h ('k') | src/ia32/lithium-codegen-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen-instructions.cc
diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc
index 7dd604b5f805e1adef0d5b1599632b58234f0e05..be0b71be41b750158b1e3c56d3c42da75b95aa5a 100644
--- a/src/hydrogen-instructions.cc
+++ b/src/hydrogen-instructions.cc
@@ -1299,7 +1299,9 @@ std::ostream& HTypeofIsAndBranch::PrintDataTo(
}
-static String* TypeOfString(HConstant* constant, Isolate* isolate) {
+namespace {
+
+String* TypeOfString(HConstant* constant, Isolate* isolate) {
Heap* heap = isolate->heap();
if (constant->HasNumberValue()) return heap->number_string();
if (constant->IsUndetectable()) return heap->undefined_string();
@@ -1330,14 +1332,14 @@ static String* TypeOfString(HConstant* constant, Isolate* isolate) {
UNREACHABLE();
return nullptr;
}
- case JS_FUNCTION_TYPE:
- case JS_FUNCTION_PROXY_TYPE:
- return heap->function_string();
default:
+ if (constant->IsCallable()) return heap->function_string();
return heap->object_string();
}
}
+} // namespace
+
bool HTypeofIsAndBranch::KnownSuccessorBlock(HBasicBlock** block) {
if (FLAG_fold_constants && value()->IsConstant()) {
@@ -2705,15 +2707,15 @@ HConstant::HConstant(Handle<Object> object, Representation r)
: HTemplateInstruction<0>(HType::FromValue(object)),
object_(Unique<Object>::CreateUninitialized(object)),
object_map_(Handle<Map>::null()),
- bit_field_(HasStableMapValueField::encode(false) |
- HasSmiValueField::encode(false) |
- HasInt32ValueField::encode(false) |
- HasDoubleValueField::encode(false) |
- HasExternalReferenceValueField::encode(false) |
- IsNotInNewSpaceField::encode(true) |
- BooleanValueField::encode(object->BooleanValue()) |
- IsUndetectableField::encode(false) |
- InstanceTypeField::encode(kUnknownInstanceType)) {
+ bit_field_(
+ HasStableMapValueField::encode(false) |
+ HasSmiValueField::encode(false) | HasInt32ValueField::encode(false) |
+ HasDoubleValueField::encode(false) |
+ HasExternalReferenceValueField::encode(false) |
+ IsNotInNewSpaceField::encode(true) |
+ BooleanValueField::encode(object->BooleanValue()) |
+ IsUndetectableField::encode(false) | IsCallableField::encode(false) |
+ InstanceTypeField::encode(kUnknownInstanceType)) {
if (object->IsHeapObject()) {
Handle<HeapObject> heap_object = Handle<HeapObject>::cast(object);
Isolate* isolate = heap_object->GetIsolate();
@@ -2723,6 +2725,7 @@ HConstant::HConstant(Handle<Object> object, Representation r)
bit_field_ = InstanceTypeField::update(bit_field_, map->instance_type());
bit_field_ =
IsUndetectableField::update(bit_field_, map->is_undetectable());
+ bit_field_ = IsCallableField::update(bit_field_, map->is_callable());
if (map->is_stable()) object_map_ = Unique<Map>::CreateImmovable(map);
bit_field_ = HasStableMapValueField::update(
bit_field_,
« no previous file with comments | « src/hydrogen-instructions.h ('k') | src/ia32/lithium-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698