| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/runtime/runtime-utils.h" | 5 #include "src/runtime/runtime-utils.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "src/arguments.h" | 9 #include "src/arguments.h" |
| 10 #include "src/ast/prettyprinter.h" | 10 #include "src/ast/prettyprinter.h" |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 } | 266 } |
| 267 | 267 |
| 268 | 268 |
| 269 RUNTIME_FUNCTION(Runtime_AllocateInTargetSpace) { | 269 RUNTIME_FUNCTION(Runtime_AllocateInTargetSpace) { |
| 270 HandleScope scope(isolate); | 270 HandleScope scope(isolate); |
| 271 DCHECK(args.length() == 2); | 271 DCHECK(args.length() == 2); |
| 272 CONVERT_SMI_ARG_CHECKED(size, 0); | 272 CONVERT_SMI_ARG_CHECKED(size, 0); |
| 273 CONVERT_SMI_ARG_CHECKED(flags, 1); | 273 CONVERT_SMI_ARG_CHECKED(flags, 1); |
| 274 CHECK(IsAligned(size, kPointerSize)); | 274 CHECK(IsAligned(size, kPointerSize)); |
| 275 CHECK(size > 0); | 275 CHECK(size > 0); |
| 276 CHECK(size <= kMaxRegularHeapObjectSize); | |
| 277 bool double_align = AllocateDoubleAlignFlag::decode(flags); | 276 bool double_align = AllocateDoubleAlignFlag::decode(flags); |
| 278 AllocationSpace space = AllocateTargetSpace::decode(flags); | 277 AllocationSpace space = AllocateTargetSpace::decode(flags); |
| 278 CHECK(size <= kMaxRegularHeapObjectSize || space == LO_SPACE); |
| 279 return *isolate->factory()->NewFillerObject(size, double_align, space); | 279 return *isolate->factory()->NewFillerObject(size, double_align, space); |
| 280 } | 280 } |
| 281 | 281 |
| 282 RUNTIME_FUNCTION(Runtime_AllocateSeqOneByteString) { | 282 RUNTIME_FUNCTION(Runtime_AllocateSeqOneByteString) { |
| 283 HandleScope scope(isolate); | 283 HandleScope scope(isolate); |
| 284 DCHECK_EQ(1, args.length()); | 284 DCHECK_EQ(1, args.length()); |
| 285 CONVERT_SMI_ARG_CHECKED(length, 0); | 285 CONVERT_SMI_ARG_CHECKED(length, 0); |
| 286 Handle<SeqOneByteString> result; | 286 Handle<SeqOneByteString> result; |
| 287 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( | 287 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
| 288 isolate, result, isolate->factory()->NewRawOneByteString(length)); | 288 isolate, result, isolate->factory()->NewRawOneByteString(length)); |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 472 | 472 |
| 473 RUNTIME_FUNCTION(Runtime_Typeof) { | 473 RUNTIME_FUNCTION(Runtime_Typeof) { |
| 474 HandleScope scope(isolate); | 474 HandleScope scope(isolate); |
| 475 DCHECK_EQ(1, args.length()); | 475 DCHECK_EQ(1, args.length()); |
| 476 CONVERT_ARG_HANDLE_CHECKED(Object, object, 0); | 476 CONVERT_ARG_HANDLE_CHECKED(Object, object, 0); |
| 477 return *Object::TypeOf(isolate, object); | 477 return *Object::TypeOf(isolate, object); |
| 478 } | 478 } |
| 479 | 479 |
| 480 } // namespace internal | 480 } // namespace internal |
| 481 } // namespace v8 | 481 } // namespace v8 |
| OLD | NEW |