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

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

Issue 2028983002: Introduce IsUndefined(Isolate*) and IsTheHole(Isolate*) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: doing proper rebase Created 4 years, 6 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-literals.cc
diff --git a/src/runtime/runtime-literals.cc b/src/runtime/runtime-literals.cc
index 5cb97c6ce673009b02e1763a1f422a3775dbacc8..1ad864f33f3e651435dbda554ea7f795510556a5 100644
--- a/src/runtime/runtime-literals.cc
+++ b/src/runtime/runtime-literals.cc
@@ -209,7 +209,7 @@ RUNTIME_FUNCTION(Runtime_CreateRegExpLiteral) {
// Check if boilerplate exists. If not, create it first.
Handle<Object> boilerplate(closure->literals()->literal(index), isolate);
- if (boilerplate->IsUndefined()) {
+ if (boilerplate->IsUndefined(isolate)) {
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
isolate, boilerplate, JSRegExp::New(pattern, JSRegExp::Flags(flags)));
closure->literals()->set_literal(index, *boilerplate);
@@ -236,7 +236,7 @@ RUNTIME_FUNCTION(Runtime_CreateObjectLiteral) {
Handle<Object> literal_site(literals->literal(literals_index), isolate);
Handle<AllocationSite> site;
Handle<JSObject> boilerplate;
- if (*literal_site == isolate->heap()->undefined_value()) {
+ if (literal_site->IsUndefined(isolate)) {
Handle<Object> raw_boilerplate;
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
isolate, raw_boilerplate,
@@ -272,7 +272,7 @@ MUST_USE_RESULT static MaybeHandle<AllocationSite> GetLiteralAllocationSite(
// Check if boilerplate exists. If not, create it first.
Handle<Object> literal_site(literals->literal(literals_index), isolate);
Handle<AllocationSite> site;
- if (*literal_site == isolate->heap()->undefined_value()) {
+ if (literal_site->IsUndefined(isolate)) {
DCHECK(*elements != isolate->heap()->empty_fixed_array());
Handle<Object> boilerplate;
ASSIGN_RETURN_ON_EXCEPTION(

Powered by Google App Engine
This is Rietveld 408576698