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

Side by Side Diff: src/objects-debug.cc

Issue 1542963002: [runtime] Introduce dedicated JSBoundFunction to represent bound functions. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@FunctionConstructor
Patch Set: [arm64] Poke does not preserve flags with --debug-code. Created 4 years, 12 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-body-descriptors-inl.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 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/objects.h" 5 #include "src/objects.h"
6 6
7 #include "src/bootstrapper.h" 7 #include "src/bootstrapper.h"
8 #include "src/disasm.h" 8 #include "src/disasm.h"
9 #include "src/disassembler.h" 9 #include "src/disassembler.h"
10 #include "src/macro-assembler.h" 10 #include "src/macro-assembler.h"
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 break; 107 break;
108 case JS_MODULE_TYPE: 108 case JS_MODULE_TYPE:
109 JSModule::cast(this)->JSModuleVerify(); 109 JSModule::cast(this)->JSModuleVerify();
110 break; 110 break;
111 case JS_VALUE_TYPE: 111 case JS_VALUE_TYPE:
112 JSValue::cast(this)->JSValueVerify(); 112 JSValue::cast(this)->JSValueVerify();
113 break; 113 break;
114 case JS_DATE_TYPE: 114 case JS_DATE_TYPE:
115 JSDate::cast(this)->JSDateVerify(); 115 JSDate::cast(this)->JSDateVerify();
116 break; 116 break;
117 case JS_BOUND_FUNCTION_TYPE:
118 JSBoundFunction::cast(this)->JSBoundFunctionVerify();
119 break;
117 case JS_FUNCTION_TYPE: 120 case JS_FUNCTION_TYPE:
118 JSFunction::cast(this)->JSFunctionVerify(); 121 JSFunction::cast(this)->JSFunctionVerify();
119 break; 122 break;
120 case JS_GLOBAL_PROXY_TYPE: 123 case JS_GLOBAL_PROXY_TYPE:
121 JSGlobalProxy::cast(this)->JSGlobalProxyVerify(); 124 JSGlobalProxy::cast(this)->JSGlobalProxyVerify();
122 break; 125 break;
123 case JS_GLOBAL_OBJECT_TYPE: 126 case JS_GLOBAL_OBJECT_TYPE:
124 JSGlobalObject::cast(this)->JSGlobalObjectVerify(); 127 JSGlobalObject::cast(this)->JSGlobalObjectVerify();
125 break; 128 break;
126 case CELL_TYPE: 129 case CELL_TYPE:
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after
535 } 538 }
536 539
537 540
538 void SlicedString::SlicedStringVerify() { 541 void SlicedString::SlicedStringVerify() {
539 CHECK(!this->parent()->IsConsString()); 542 CHECK(!this->parent()->IsConsString());
540 CHECK(!this->parent()->IsSlicedString()); 543 CHECK(!this->parent()->IsSlicedString());
541 CHECK(this->length() >= SlicedString::kMinLength); 544 CHECK(this->length() >= SlicedString::kMinLength);
542 } 545 }
543 546
544 547
548 void JSBoundFunction::JSBoundFunctionVerify() {
549 CHECK(IsJSBoundFunction());
550 VerifyObjectField(kLengthOffset);
551 VerifyObjectField(kNameOffset);
552 VerifyObjectField(kBoundThisOffset);
553 VerifyObjectField(kBoundTargetFunctionOffset);
554 VerifyObjectField(kBoundArgumentsOffset);
555 VerifyObjectField(kCreationContextOffset);
556 CHECK(bound_target_function()->IsCallable());
557 CHECK(creation_context()->IsNativeContext());
558 CHECK(IsCallable());
559 CHECK_EQ(IsConstructor(), bound_target_function()->IsConstructor());
560 }
561
562
545 void JSFunction::JSFunctionVerify() { 563 void JSFunction::JSFunctionVerify() {
546 CHECK(IsJSFunction()); 564 CHECK(IsJSFunction());
547 VerifyObjectField(kPrototypeOrInitialMapOffset); 565 VerifyObjectField(kPrototypeOrInitialMapOffset);
548 VerifyObjectField(kNextFunctionLinkOffset); 566 VerifyObjectField(kNextFunctionLinkOffset);
549 CHECK(code()->IsCode()); 567 CHECK(code()->IsCode());
550 CHECK(next_function_link() == NULL || 568 CHECK(next_function_link() == NULL ||
551 next_function_link()->IsUndefined() || 569 next_function_link()->IsUndefined() ||
552 next_function_link()->IsJSFunction()); 570 next_function_link()->IsJSFunction());
553 CHECK(map()->is_callable()); 571 CHECK(map()->is_callable());
554 } 572 }
(...skipping 753 matching lines...) Expand 10 before | Expand all | Expand 10 after
1308 1326
1309 // Both are done at the same time. 1327 // Both are done at the same time.
1310 CHECK_EQ(new_it.done(), old_it.done()); 1328 CHECK_EQ(new_it.done(), old_it.done());
1311 } 1329 }
1312 1330
1313 1331
1314 #endif // DEBUG 1332 #endif // DEBUG
1315 1333
1316 } // namespace internal 1334 } // namespace internal
1317 } // namespace v8 1335 } // namespace v8
OLDNEW
« no previous file with comments | « src/objects-body-descriptors-inl.h ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698