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

Side by Side Diff: src/frames.cc

Issue 2028983002: Introduce IsUndefined(Isolate*) and IsTheHole(Isolate*) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase master 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 unified diff | Download patch
« no previous file with comments | « src/factory.cc ('k') | src/full-codegen/arm/full-codegen-arm.cc » ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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/frames.h" 5 #include "src/frames.h"
6 6
7 #include <sstream> 7 #include <sstream>
8 8
9 #include "src/ast/ast.h" 9 #include "src/ast/ast.h"
10 #include "src/ast/scopeinfo.h" 10 #include "src/ast/scopeinfo.h"
(...skipping 1330 matching lines...) Expand 10 before | Expand all | Expand 10 after
1341 Object* WasmFrame::wasm_obj() { 1341 Object* WasmFrame::wasm_obj() {
1342 FixedArray* deopt_data = LookupCode()->deoptimization_data(); 1342 FixedArray* deopt_data = LookupCode()->deoptimization_data();
1343 DCHECK(deopt_data->length() == 2); 1343 DCHECK(deopt_data->length() == 2);
1344 return deopt_data->get(0); 1344 return deopt_data->get(0);
1345 } 1345 }
1346 1346
1347 uint32_t WasmFrame::function_index() { 1347 uint32_t WasmFrame::function_index() {
1348 FixedArray* deopt_data = LookupCode()->deoptimization_data(); 1348 FixedArray* deopt_data = LookupCode()->deoptimization_data();
1349 DCHECK(deopt_data->length() == 2); 1349 DCHECK(deopt_data->length() == 2);
1350 Object* func_index_obj = deopt_data->get(1); 1350 Object* func_index_obj = deopt_data->get(1);
1351 if (func_index_obj->IsUndefined()) return static_cast<uint32_t>(-1); 1351 if (func_index_obj->IsUndefined(isolate())) return static_cast<uint32_t>(-1);
1352 if (func_index_obj->IsSmi()) return Smi::cast(func_index_obj)->value(); 1352 if (func_index_obj->IsSmi()) return Smi::cast(func_index_obj)->value();
1353 DCHECK(func_index_obj->IsHeapNumber()); 1353 DCHECK(func_index_obj->IsHeapNumber());
1354 uint32_t val = static_cast<uint32_t>(-1); 1354 uint32_t val = static_cast<uint32_t>(-1);
1355 func_index_obj->ToUint32(&val); 1355 func_index_obj->ToUint32(&val);
1356 DCHECK(val != static_cast<uint32_t>(-1)); 1356 DCHECK(val != static_cast<uint32_t>(-1));
1357 return val; 1357 return val;
1358 } 1358 }
1359 1359
1360 namespace { 1360 namespace {
1361 1361
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after
1787 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) { 1787 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) {
1788 StackFrame* frame = AllocateFrameCopy(it.frame(), zone); 1788 StackFrame* frame = AllocateFrameCopy(it.frame(), zone);
1789 list.Add(frame, zone); 1789 list.Add(frame, zone);
1790 } 1790 }
1791 return list.ToVector(); 1791 return list.ToVector();
1792 } 1792 }
1793 1793
1794 1794
1795 } // namespace internal 1795 } // namespace internal
1796 } // namespace v8 1796 } // namespace v8
OLDNEW
« no previous file with comments | « src/factory.cc ('k') | src/full-codegen/arm/full-codegen-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698