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

Unified Diff: src/runtime/runtime-strings.cc

Issue 2028983002: Introduce IsUndefined(Isolate*) and IsTheHole(Isolate*) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: reducing old cmpare patterns Created 4 years, 7 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
Index: src/runtime/runtime-strings.cc
diff --git a/src/runtime/runtime-strings.cc b/src/runtime/runtime-strings.cc
index 8df345313698e197ae3384456f321c989e096f86..97f21458493169d12662468161c9475869580862 100644
--- a/src/runtime/runtime-strings.cc
+++ b/src/runtime/runtime-strings.cc
@@ -725,12 +725,11 @@ static int CopyCachedOneByteCharsToArray(Heap* heap, const uint8_t* chars,
FixedArray* elements, int length) {
DisallowHeapAllocation no_gc;
FixedArray* one_byte_cache = heap->single_character_string_cache();
- Object* undefined = heap->undefined_value();
int i;
WriteBarrierMode mode = elements->GetWriteBarrierMode(no_gc);
for (i = 0; i < length; ++i) {
Object* value = one_byte_cache->get(chars[i]);
- if (value == undefined) break;
+ if (value->IsUndefined(heap->isolate())) break;
elements->set(i, value, mode);
}
if (i < length) {

Powered by Google App Engine
This is Rietveld 408576698