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

Side by Side Diff: src/objects.cc

Issue 2274823002: Add flags to FrameArray (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@frame-array
Patch Set: Rebase Created 4 years, 4 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/objects.h ('k') | src/objects-inl.h » ('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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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/objects.h" 5 #include "src/objects.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 #include <iomanip> 8 #include <iomanip>
9 #include <memory> 9 #include <memory>
10 #include <sstream> 10 #include <sstream>
(...skipping 10190 matching lines...) Expand 10 before | Expand all | Expand 10 after
10201 EnsureSpaceInFixedArray(array, kFirstIndex + length)); 10201 EnsureSpaceInFixedArray(array, kFirstIndex + length));
10202 if (empty) ret->SetLength(0); 10202 if (empty) ret->SetLength(0);
10203 return ret; 10203 return ret;
10204 } 10204 }
10205 10205
10206 // static 10206 // static
10207 Handle<FrameArray> FrameArray::AppendJSFrame(Handle<FrameArray> in, 10207 Handle<FrameArray> FrameArray::AppendJSFrame(Handle<FrameArray> in,
10208 Handle<Object> receiver, 10208 Handle<Object> receiver,
10209 Handle<JSFunction> function, 10209 Handle<JSFunction> function,
10210 Handle<AbstractCode> code, 10210 Handle<AbstractCode> code,
10211 int offset) { 10211 int offset, int flags) {
10212 const int frame_count = in->FrameCount(); 10212 const int frame_count = in->FrameCount();
10213 const int new_length = LengthFor(frame_count + 1); 10213 const int new_length = LengthFor(frame_count + 1);
10214 Handle<FrameArray> array = EnsureSpace(in, new_length); 10214 Handle<FrameArray> array = EnsureSpace(in, new_length);
10215 array->SetReceiver(frame_count, *receiver); 10215 array->SetReceiver(frame_count, *receiver);
10216 array->SetFunction(frame_count, *function); 10216 array->SetFunction(frame_count, *function);
10217 array->SetCode(frame_count, *code); 10217 array->SetCode(frame_count, *code);
10218 array->SetOffset(frame_count, Smi::FromInt(offset)); 10218 array->SetOffset(frame_count, Smi::FromInt(offset));
10219 array->SetFlags(frame_count, Smi::FromInt(flags));
10219 array->set(kFrameCountIndex, Smi::FromInt(frame_count + 1)); 10220 array->set(kFrameCountIndex, Smi::FromInt(frame_count + 1));
10220 return array; 10221 return array;
10221 } 10222 }
10222 10223
10223 // static 10224 // static
10224 Handle<FrameArray> FrameArray::AppendWasmFrame(Handle<FrameArray> in, 10225 Handle<FrameArray> FrameArray::AppendWasmFrame(Handle<FrameArray> in,
10225 Handle<Object> wasm_object, 10226 Handle<Object> wasm_object,
10226 int wasm_function_index, 10227 int wasm_function_index,
10227 Handle<AbstractCode> code, 10228 Handle<AbstractCode> code,
10228 int offset) { 10229 int offset, int flags) {
10229 const int frame_count = in->FrameCount(); 10230 const int frame_count = in->FrameCount();
10230 const int new_length = LengthFor(frame_count + 1); 10231 const int new_length = LengthFor(frame_count + 1);
10231 Handle<FrameArray> array = EnsureSpace(in, new_length); 10232 Handle<FrameArray> array = EnsureSpace(in, new_length);
10232 array->SetWasmObject(frame_count, *wasm_object); 10233 array->SetWasmObject(frame_count, *wasm_object);
10233 array->SetWasmFunctionIndex(frame_count, Smi::FromInt(wasm_function_index)); 10234 array->SetWasmFunctionIndex(frame_count, Smi::FromInt(wasm_function_index));
10234 array->SetCode(frame_count, *code); 10235 array->SetCode(frame_count, *code);
10235 array->SetOffset(frame_count, Smi::FromInt(offset)); 10236 array->SetOffset(frame_count, Smi::FromInt(offset));
10237 array->SetFlags(frame_count, Smi::FromInt(flags));
10236 array->set(kFrameCountIndex, Smi::FromInt(frame_count + 1)); 10238 array->set(kFrameCountIndex, Smi::FromInt(frame_count + 1));
10237 return array; 10239 return array;
10238 } 10240 }
10239 10241
10240 void FrameArray::ShrinkToFit() { Shrink(LengthFor(FrameCount())); } 10242 void FrameArray::ShrinkToFit() { Shrink(LengthFor(FrameCount())); }
10241 10243
10242 // static 10244 // static
10243 Handle<FrameArray> FrameArray::EnsureSpace(Handle<FrameArray> array, 10245 Handle<FrameArray> FrameArray::EnsureSpace(Handle<FrameArray> array,
10244 int length) { 10246 int length) {
10245 return Handle<FrameArray>::cast(EnsureSpaceInFixedArray(array, length)); 10247 return Handle<FrameArray>::cast(EnsureSpaceInFixedArray(array, length));
(...skipping 9082 matching lines...) Expand 10 before | Expand all | Expand 10 after
19328 for (PrototypeIterator iter(isolate, this, kStartAtReceiver, 19330 for (PrototypeIterator iter(isolate, this, kStartAtReceiver,
19329 PrototypeIterator::END_AT_NULL); 19331 PrototypeIterator::END_AT_NULL);
19330 !iter.IsAtEnd(); iter.AdvanceIgnoringProxies()) { 19332 !iter.IsAtEnd(); iter.AdvanceIgnoringProxies()) {
19331 if (iter.GetCurrent<Object>()->IsJSProxy()) return true; 19333 if (iter.GetCurrent<Object>()->IsJSProxy()) return true;
19332 } 19334 }
19333 return false; 19335 return false;
19334 } 19336 }
19335 19337
19336 } // namespace internal 19338 } // namespace internal
19337 } // namespace v8 19339 } // namespace v8
OLDNEW
« no previous file with comments | « src/objects.h ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698