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

Unified Diff: src/code-stub-assembler.h

Issue 2610343002: Fix: KeyedStoreGeneric must check for writable array length (Closed)
Patch Set: introduce IsSetSmi(smi, mask) Created 3 years, 11 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/builtins-array.cc ('k') | src/ic/keyed-store-generic.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/code-stub-assembler.h
diff --git a/src/code-stub-assembler.h b/src/code-stub-assembler.h
index f983044f9340debf9646223cf55587c7098be816..7fda7450d8957a3ab3125997e7d3ec041790551d 100644
--- a/src/code-stub-assembler.h
+++ b/src/code-stub-assembler.h
@@ -781,6 +781,15 @@ class V8_EXPORT_PRIVATE CodeStubAssembler : public compiler::CodeAssembler {
return WordNotEqual(WordAnd(word, IntPtrConstant(mask)), IntPtrConstant(0));
}
+ // Returns true if any of the mask's bit are set in the given Smi.
+ // Smi-encoding of the mask is performed implicitly!
+ Node* IsSetSmi(Node* smi, int untagged_mask) {
+ intptr_t mask_word = bit_cast<intptr_t>(Smi::FromInt(untagged_mask));
+ return WordNotEqual(
+ WordAnd(BitcastTaggedToWord(smi), IntPtrConstant(mask_word)),
+ IntPtrConstant(0));
+ }
+
// Returns true if all of the |T|'s bits in given |word32| are clear.
template <typename T>
Node* IsClearWord32(Node* word32) {
« no previous file with comments | « src/builtins/builtins-array.cc ('k') | src/ic/keyed-store-generic.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698