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

Unified Diff: src/code-stubs-hydrogen.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/builtins.cc ('k') | src/collection.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/code-stubs-hydrogen.cc
diff --git a/src/code-stubs-hydrogen.cc b/src/code-stubs-hydrogen.cc
index 3901ef8026c58fbff5f65cbf8e49efb604362482..9f9b14e309d975f15c77020d72a6e38b8e3e0a28 100644
--- a/src/code-stubs-hydrogen.cc
+++ b/src/code-stubs-hydrogen.cc
@@ -367,14 +367,16 @@ HValue* CodeStubGraphBuilder<TypeofStub>::BuildCodeStub() {
{ Push(Add<HConstant>(factory->symbol_string())); }
is_symbol.Else();
{
+ HValue* bit_field = Add<HLoadNamedField>(
+ map, nullptr, HObjectAccess::ForMapBitField());
+ HValue* bit_field_masked = AddUncasted<HBitwise>(
+ Token::BIT_AND, bit_field,
+ Add<HConstant>((1 << Map::kIsCallable) |
+ (1 << Map::kIsUndetectable)));
IfBuilder is_function(this);
- HConstant* js_function = Add<HConstant>(JS_FUNCTION_TYPE);
- HConstant* js_function_proxy =
- Add<HConstant>(JS_FUNCTION_PROXY_TYPE);
- is_function.If<HCompareNumericAndBranch>(instance_type, js_function,
- Token::EQ);
- is_function.OrIf<HCompareNumericAndBranch>(
- instance_type, js_function_proxy, Token::EQ);
+ is_function.If<HCompareNumericAndBranch>(
+ bit_field_masked, Add<HConstant>(1 << Map::kIsCallable),
+ Token::EQ);
is_function.Then();
{ Push(Add<HConstant>(factory->function_string())); }
is_function.Else();
@@ -390,7 +392,9 @@ HValue* CodeStubGraphBuilder<TypeofStub>::BuildCodeStub() {
#undef SIMD128_BUILDER_OPEN
// Is it an undetectable object?
IfBuilder is_undetectable(this);
- is_undetectable.If<HIsUndetectableAndBranch>(object);
+ is_undetectable.If<HCompareNumericAndBranch>(
+ bit_field_masked, Add<HConstant>(1 << Map::kIsUndetectable),
+ Token::EQ);
is_undetectable.Then();
{
// typeof an undetectable object is 'undefined'.
« no previous file with comments | « src/builtins.cc ('k') | src/collection.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698