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

Unified Diff: src/deoptimizer.cc

Issue 935623002: Convert to immutable heap number when materializing arguments object. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Tweak Created 5 years, 10 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 | « no previous file | test/mjsunit/regress/regress-457935.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/deoptimizer.cc
diff --git a/src/deoptimizer.cc b/src/deoptimizer.cc
index 7c79c89078b98a74e8d65bfb766e2670a8850ba4..c98d391632d358cf35298f02633c0fd7d36e9e22 100644
--- a/src/deoptimizer.cc
+++ b/src/deoptimizer.cc
@@ -3286,8 +3286,13 @@ SlotRefValueBuilder::SlotRefValueBuilder(JavaScriptFrame* frame,
Handle<Object> SlotRef::GetValue(Isolate* isolate) {
switch (representation_) {
- case TAGGED:
- return Handle<Object>(Memory::Object_at(addr_), isolate);
+ case TAGGED: {
+ Handle<Object> value(Memory::Object_at(addr_), isolate);
+ if (value->IsMutableHeapNumber()) {
+ HeapNumber::cast(*value)->set_map(isolate->heap()->heap_number_map());
+ }
+ return value;
+ }
case INT32: {
#if V8_TARGET_BIG_ENDIAN && V8_HOST_ARCH_64_BIT
@@ -3388,9 +3393,9 @@ Handle<Object> SlotRefValueBuilder::GetNext(Isolate* isolate, int lvl) {
case SlotRef::INT32:
case SlotRef::UINT32:
case SlotRef::DOUBLE:
- case SlotRef::LITERAL: {
+ case SlotRef::LITERAL:
return slot.GetValue(isolate);
- }
+
case SlotRef::ARGUMENTS_OBJECT: {
// We should never need to materialize an arguments object,
// but we still need to put something into the array
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-457935.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698