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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « src/builtins.cc ('k') | src/collection.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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/code-stubs.h" 5 #include "src/code-stubs.h"
6 6
7 #include "src/bailout-reason.h" 7 #include "src/bailout-reason.h"
8 #include "src/field-index.h" 8 #include "src/field-index.h"
9 #include "src/hydrogen.h" 9 #include "src/hydrogen.h"
10 #include "src/ic/ic.h" 10 #include "src/ic/ic.h"
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 } 360 }
361 is_oddball.Else(); 361 is_oddball.Else();
362 { 362 {
363 IfBuilder is_symbol(this); 363 IfBuilder is_symbol(this);
364 is_symbol.If<HCompareNumericAndBranch>( 364 is_symbol.If<HCompareNumericAndBranch>(
365 instance_type, Add<HConstant>(SYMBOL_TYPE), Token::EQ); 365 instance_type, Add<HConstant>(SYMBOL_TYPE), Token::EQ);
366 is_symbol.Then(); 366 is_symbol.Then();
367 { Push(Add<HConstant>(factory->symbol_string())); } 367 { Push(Add<HConstant>(factory->symbol_string())); }
368 is_symbol.Else(); 368 is_symbol.Else();
369 { 369 {
370 HValue* bit_field = Add<HLoadNamedField>(
371 map, nullptr, HObjectAccess::ForMapBitField());
372 HValue* bit_field_masked = AddUncasted<HBitwise>(
373 Token::BIT_AND, bit_field,
374 Add<HConstant>((1 << Map::kIsCallable) |
375 (1 << Map::kIsUndetectable)));
370 IfBuilder is_function(this); 376 IfBuilder is_function(this);
371 HConstant* js_function = Add<HConstant>(JS_FUNCTION_TYPE); 377 is_function.If<HCompareNumericAndBranch>(
372 HConstant* js_function_proxy = 378 bit_field_masked, Add<HConstant>(1 << Map::kIsCallable),
373 Add<HConstant>(JS_FUNCTION_PROXY_TYPE); 379 Token::EQ);
374 is_function.If<HCompareNumericAndBranch>(instance_type, js_function,
375 Token::EQ);
376 is_function.OrIf<HCompareNumericAndBranch>(
377 instance_type, js_function_proxy, Token::EQ);
378 is_function.Then(); 380 is_function.Then();
379 { Push(Add<HConstant>(factory->function_string())); } 381 { Push(Add<HConstant>(factory->function_string())); }
380 is_function.Else(); 382 is_function.Else();
381 { 383 {
382 #define SIMD128_BUILDER_OPEN(TYPE, Type, type, lane_count, lane_type) \ 384 #define SIMD128_BUILDER_OPEN(TYPE, Type, type, lane_count, lane_type) \
383 IfBuilder is_##type(this); \ 385 IfBuilder is_##type(this); \
384 is_##type.If<HCompareObjectEqAndBranch>( \ 386 is_##type.If<HCompareObjectEqAndBranch>( \
385 map, Add<HConstant>(factory->type##_map())); \ 387 map, Add<HConstant>(factory->type##_map())); \
386 is_##type.Then(); \ 388 is_##type.Then(); \
387 { Push(Add<HConstant>(factory->type##_string())); } \ 389 { Push(Add<HConstant>(factory->type##_string())); } \
388 is_##type.Else(); { 390 is_##type.Else(); {
389 SIMD128_TYPES(SIMD128_BUILDER_OPEN) 391 SIMD128_TYPES(SIMD128_BUILDER_OPEN)
390 #undef SIMD128_BUILDER_OPEN 392 #undef SIMD128_BUILDER_OPEN
391 // Is it an undetectable object? 393 // Is it an undetectable object?
392 IfBuilder is_undetectable(this); 394 IfBuilder is_undetectable(this);
393 is_undetectable.If<HIsUndetectableAndBranch>(object); 395 is_undetectable.If<HCompareNumericAndBranch>(
396 bit_field_masked, Add<HConstant>(1 << Map::kIsUndetectable),
397 Token::EQ);
394 is_undetectable.Then(); 398 is_undetectable.Then();
395 { 399 {
396 // typeof an undetectable object is 'undefined'. 400 // typeof an undetectable object is 'undefined'.
397 Push(Add<HConstant>(factory->undefined_string())); 401 Push(Add<HConstant>(factory->undefined_string()));
398 } 402 }
399 is_undetectable.Else(); 403 is_undetectable.Else();
400 { 404 {
401 // For any kind of object not handled above, the spec rule for 405 // For any kind of object not handled above, the spec rule for
402 // host objects gives that it is okay to return "object". 406 // host objects gives that it is okay to return "object".
403 Push(object_string); 407 Push(object_string);
(...skipping 1801 matching lines...) Expand 10 before | Expand all | Expand 10 after
2205 return Pop(); 2209 return Pop();
2206 } 2210 }
2207 2211
2208 2212
2209 Handle<Code> KeyedLoadGenericStub::GenerateCode() { 2213 Handle<Code> KeyedLoadGenericStub::GenerateCode() {
2210 return DoGenerateCode(this); 2214 return DoGenerateCode(this);
2211 } 2215 }
2212 2216
2213 } // namespace internal 2217 } // namespace internal
2214 } // namespace v8 2218 } // namespace v8
OLDNEW
« 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