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

Side by Side Diff: src/code-stub-assembler.cc

Issue 2628863002: Do security checks in the promise constructor (Closed)
Patch Set: Created 3 years, 11 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
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 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 #include "src/code-stub-assembler.h" 4 #include "src/code-stub-assembler.h"
5 #include "src/code-factory.h" 5 #include "src/code-factory.h"
6 #include "src/frames-inl.h" 6 #include "src/frames-inl.h"
7 #include "src/frames.h" 7 #include "src/frames.h"
8 8
9 namespace v8 { 9 namespace v8 {
10 namespace internal { 10 namespace internal {
(...skipping 2958 matching lines...) Expand 10 before | Expand all | Expand 10 after
2969 2969
2970 Node* CodeStubAssembler::IsUnseededNumberDictionary(Node* object) { 2970 Node* CodeStubAssembler::IsUnseededNumberDictionary(Node* object) {
2971 return WordEqual(LoadMap(object), 2971 return WordEqual(LoadMap(object),
2972 LoadRoot(Heap::kUnseededNumberDictionaryMapRootIndex)); 2972 LoadRoot(Heap::kUnseededNumberDictionaryMapRootIndex));
2973 } 2973 }
2974 2974
2975 Node* CodeStubAssembler::IsJSFunction(Node* object) { 2975 Node* CodeStubAssembler::IsJSFunction(Node* object) {
2976 return HasInstanceType(object, JS_FUNCTION_TYPE); 2976 return HasInstanceType(object, JS_FUNCTION_TYPE);
2977 } 2977 }
2978 2978
2979 Node* CodeStubAssembler::IsJSBoundFunction(Node* object) {
2980 return HasInstanceType(object, JS_BOUND_FUNCTION_TYPE);
2981 }
2982
2979 Node* CodeStubAssembler::StringCharCodeAt(Node* string, Node* index, 2983 Node* CodeStubAssembler::StringCharCodeAt(Node* string, Node* index,
2980 ParameterMode parameter_mode) { 2984 ParameterMode parameter_mode) {
2981 CSA_ASSERT(this, IsString(string)); 2985 CSA_ASSERT(this, IsString(string));
2982 // Translate the {index} into a Word. 2986 // Translate the {index} into a Word.
2983 index = ParameterToWord(index, parameter_mode); 2987 index = ParameterToWord(index, parameter_mode);
2984 2988
2985 // We may need to loop in case of cons or sliced strings. 2989 // We may need to loop in case of cons or sliced strings.
2986 Variable var_index(this, MachineType::PointerRepresentation()); 2990 Variable var_index(this, MachineType::PointerRepresentation());
2987 Variable var_result(this, MachineRepresentation::kWord32); 2991 Variable var_result(this, MachineRepresentation::kWord32);
2988 Variable var_string(this, MachineRepresentation::kTagged); 2992 Variable var_string(this, MachineRepresentation::kTagged);
(...skipping 5346 matching lines...) Expand 10 before | Expand all | Expand 10 after
8335 StoreObjectFieldNoWriteBarrier(result, 8339 StoreObjectFieldNoWriteBarrier(result,
8336 PromiseReactionJobInfo::kDebugNameOffset, 8340 PromiseReactionJobInfo::kDebugNameOffset,
8337 SmiConstant(kDebugNotActive)); 8341 SmiConstant(kDebugNotActive));
8338 StoreObjectFieldNoWriteBarrier(result, PromiseReactionJobInfo::kContextOffset, 8342 StoreObjectFieldNoWriteBarrier(result, PromiseReactionJobInfo::kContextOffset,
8339 context); 8343 context);
8340 return result; 8344 return result;
8341 } 8345 }
8342 8346
8343 } // namespace internal 8347 } // namespace internal
8344 } // namespace v8 8348 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698